PdcCalculation.SetContactID
Declaration
SetContactID(ID as String) as Boolean
Description
Changes the contact
Notes
This method sets the contact person for the calculation. The input parameter is the ID of the required contact. The method will populate both the DO_CPID and DO_NAME column once the object is saved. To ensure proper data entry please use the pdc.ChooseRecord method to select the contact's ID. As the result of the method is boolean the result can be used to proceed or cancel the remainder of the script. The method returns a false for a contact ID not belonging to the calculations CustomerID.
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