PdcCalculation.Show: Difference between revisions

From External Bemet Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 36: Line 36:


== Availability ==
== Availability ==
Available in version 1.5 onwards

Latest revision as of 13:01, 15 April 2014

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

Availability

Available in version 1.5 onwards