PdcCalculation.SetCustomerID
Declaration
SetCustomerID(Value as String) as Boolean
Description
Changes the customer
Notes
This method sets the customer for the calculation. The input parameter is the ID of the required relation. The method will populate (if available) then delivery instructions, debtor and creditor numbers, costkind and country from the relationcard. To ensure proper data entry please use the pdc.ChooseRecord method to select the customer's ID. As the result of the method is boolean the result can be used to proceed or cancel the remainder of the script.
Code example
This code example creates a calculation, lets the user select the correct customer and contact, saves and shows it.
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