PdcProject.SetContactID

From External Bemet Wiki
Jump to navigation Jump to search

Declaration

SetContactID(ContactID as String) as Boolean

Description

Returns true or false whether the contact id is succesfully changed with the supplied id

Notes

This method sets the contact person for the project. The input parameter is the ID of the required contact. The method will populate both the DF_CPID and DF_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 projects CustomerID.

Code example

This code example creates a project, lets the user select the correct customer and contact, saves and shows it.

dim objProj
dim strRelNr
dim strCPID

  set objProj= pdc.Projects.New
  strRelNr = pdc.ChooseRecord(0,"", "")
  strCPID = pdc.ChooseRecord(8,"", "CP_DEBNR = '" & strRelNr & "'")
  objProj.SetCustomerID(strRelNr)
  objProj.SetContactID(strCPID)
  objProj.Save
  objProj.Show

Availability

Available since February 2011 (From version 4.2 onwards).