PdcCalculation.SaveAsArticle
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