PdcCalculation.CalculationNo: Difference between revisions
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 == | ||
CalculationNo as String | |||
== Description == | == Description == | ||
Returns the calculationnumber | |||
== Notes == | == Notes == | ||
This property returns the calculation number of the calculation currently in the calculation object. Especially useful for reporting the progress and results of the script. | |||
== Code example == | |||
This code example reports the calculation number, the cost estimation and the total billed value for a set of calculations. | |||
= | <source lang="vb"> | ||
dim objCalc | |||
dim tblORDER | |||
dim strlstFile | |||
dim strlstText | |||
dim i | |||
set tblORDER = pdc.Database.OpenTable(pdcConData, "DO_CALC", "DO_ORDNR") | |||
set strlstFile = TStringList.Create | |||
set strlstText = TStringList.Create | |||
if IsValid(tblORDER) then | |||
tblORDER.FirstRecord | |||
for i = 0 to 10 | |||
set objCalc = pdc.OpenCalculation(tblORDER.GetField("DO_ORDNR")) | |||
if IsValid(objCalc) then | |||
strlstText.Clear | |||
strlstText.Text = "Calculatie " & objCalc.CalculationNo & " | VoorCalc = " & objCalc.CostEstimation & " | Gefactureerd = " & objCalc.Billed | |||
strlstFile.Add strlstText.Text | |||
end if 'IsValid(objCalc) | |||
tblORDER.NextRecord | |||
next 'i | |||
end if 'IsValid(tblORDER) | |||
msgbox strlstFile.Text | |||
</source> | </source> | ||
== Availability == | == Availability == |
Latest revision as of 09:00, 21 May 2012
Declaration
CalculationNo as String
Description
Returns the calculationnumber
Notes
This property returns the calculation number of the calculation currently in the calculation object. Especially useful for reporting the progress and results of the script.
Code example
This code example reports the calculation number, the cost estimation and the total billed value for a set of calculations.
dim objCalc
dim tblORDER
dim strlstFile
dim strlstText
dim i
set tblORDER = pdc.Database.OpenTable(pdcConData, "DO_CALC", "DO_ORDNR")
set strlstFile = TStringList.Create
set strlstText = TStringList.Create
if IsValid(tblORDER) then
tblORDER.FirstRecord
for i = 0 to 10
set objCalc = pdc.OpenCalculation(tblORDER.GetField("DO_ORDNR"))
if IsValid(objCalc) then
strlstText.Clear
strlstText.Text = "Calculatie " & objCalc.CalculationNo & " | VoorCalc = " & objCalc.CostEstimation & " | Gefactureerd = " & objCalc.Billed
strlstFile.Add strlstText.Text
end if 'IsValid(objCalc)
tblORDER.NextRecord
next 'i
end if 'IsValid(tblORDER)
msgbox strlstFile.Text