PdcCalculation.SetCustomerID: 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 ==
 
SetCustomerID(Value as String) as Boolean


== Description ==
== Description ==
 
Changes the customer


== Notes ==
== 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 ==
== 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:47, 21 May 2012

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

Availability