PdcCalculation.Show: Difference between revisions
Jump to navigation
Jump to search
Created page with "== Declaration == == Description == == Notes == == Code example == <source lang="vb"> </source> == Availability ==" |
No edit summary |
||
Line 1: | Line 1: | ||
== Declaration == | == Declaration == | ||
Show | |||
== Description == | == Description == | ||
Shows the form of the calculation object | |||
== Notes == | == Notes == | ||
This method shows the calculation. | |||
As this does enables the user to change the calculation while the script may not yet be finished, this method needs to be used with extreme care! | |||
== Code example == | == Code example == | ||
This code example creates a calculation, lets the user select the correct customer and contact, saves and shows it. | |||
While the message box is shown the user can change the calculation, once closed the script adds a material and saves and shows the calculation. | |||
As there is no refresh in this code, the calculation on screen will not show the added material and will appear unsaved. Upon closing and opening the calculation the user can see that both the manual changes and the script changes have been maintained. | |||
<source lang="vb"> | |||
dim objCalc | |||
dim strRelNr | |||
dim strCPID | |||
set objCalc = pdc.NewCalculation | |||
strRelNr = pdc.ChooseRecord(0,"", "") | |||
strCPID = pdc.ChooseRecord(8,"", "CP_DEBNR = '" & strRelNr & "'") | |||
objCalc.SetCustomerID(strRelNr) | |||
objCalc.SetContactID(strCPID) | |||
objCalc.Save | |||
objCalc.Show | |||
msgbox "Script continues" | |||
objCalc.MaterialList.Add("12345") | |||
objCalc.Save | |||
objCalc.Show | |||
</source> | </source> | ||
== Availability == | == Availability == |
Revision as of 08:48, 21 May 2012
Declaration
Show
Description
Shows the form of the calculation object
Notes
This method shows the calculation.
As this does enables the user to change the calculation while the script may not yet be finished, this method needs to be used with extreme care!
Code example
This code example creates a calculation, lets the user select the correct customer and contact, saves and shows it. While the message box is shown the user can change the calculation, once closed the script adds a material and saves and shows the calculation. As there is no refresh in this code, the calculation on screen will not show the added material and will appear unsaved. Upon closing and opening the calculation the user can see that both the manual changes and the script changes have been maintained.
dim objCalc
dim strRelNr
dim strCPID
set objCalc = pdc.NewCalculation
strRelNr = pdc.ChooseRecord(0,"", "")
strCPID = pdc.ChooseRecord(8,"", "CP_DEBNR = '" & strRelNr & "'")
objCalc.SetCustomerID(strRelNr)
objCalc.SetContactID(strCPID)
objCalc.Save
objCalc.Show
msgbox "Script continues"
objCalc.MaterialList.Add("12345")
objCalc.Save
objCalc.Show