PdcCalculation.SaveAsArticle: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 7: | Line 7: | ||
== Notes == | == Notes == | ||
This method saves the calculation object in the materials file. It is not necessary to have the calculation shown on screen to save it. | This method saves the calculation object in the materials file. It is not necessary to have the calculation shown on screen to save it. | ||
From version 4.3 August 2013 on it is not necessary to create the record in the materialfile first. | |||
== Code example == | == Code example == |
Revision as of 14:16, 21 October 2013
Declaration
SaveAsArticle as Boolean
Description
Stores the calculation materials file
Notes
This method saves the calculation object in the materials file. It is not necessary to have the calculation shown on screen to save it.
From version 4.3 August 2013 on it is not necessary to create the record in the materialfile first.
Code example
This code example creates a new calculation, reads a standard article into it, adds a material and operation to it and saves it as a standard article. Whether the save was succesful is reported to the user.
dim objCalc
set objCalc = pdc.NewCalculation
objCalc.ReadFromArticle("1234")
objCalc.MaterialList.Add("12345")
if objCalc.SaveAsArticle then
msgbox "Calculation " & objCalc.CalculationNo & " was saved successfully"
objCalc.Show
else
msgbox "An error has occurred while saving calculation " & objCalc.CalculationNo & ": " & pdc.lasterror
end if