PdcCalculation.SetContactID: Difference between revisions

From External Bemet Wiki
Jump to navigation Jump to search
Created page with "== Declaration == == Description == == Notes == == Code example == <source lang="vb"> </source> == Availability =="
 
No edit summary
 
Line 1: Line 1:
== Declaration ==
== Declaration ==
 
SetContactID(ID as String) as Boolean


== Description ==
== Description ==
 
Changes the contact


== Notes ==
== 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 ==
== Code example ==
 
This code example creates a calculation, lets the user select the correct customer and contact, saves and shows it.


<source lang="vb">
<source lang="vb">
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
</source>
</source>


== Availability ==
== Availability ==

Latest revision as of 08:46, 21 May 2012

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

Availability