PdcCalculation.Children: Difference between revisions

From External Bemet Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 3: Line 3:


== Description ==
== Description ==
Changes the stock for the supplied material number.
Returns the CalculationList object.


== Notes ==
== Notes ==
This method will add or subtract the supplied quantity to the stock for the supplied material number.
This property returns the CalculationList object for the subcalculations of the calculation object.


== Code example ==
== Code example ==
This code adds 100 items to the stated materialnumber's stock position.
This code example loops through the subcalculations of a calculation and returns the description.


<source lang="vb">
<source lang="vb">
dim strMatNr
dim objCalc
dim tblMAT
dim objSubCalc
dim intCount


  strMatNr = "12345"
   set objCalc = pdc.ActiveCalculation
   set tblMAT = pdc.Database.OpenTable(pdcConData, "LM_MAT", "LM_MATN")
 
 
   for intCount = 0 to objCalc.Children.Count -1
   if IsValid(tblMat) and tblMat.Locate("LM_MATN", strMatNr) then
     set objSubCalc = objCalc.Children(intCount)
     msgbox "Current stock level = " & tblMat.GetField("LM_HOEV")
     msgbox objSubCalc.Description
    pdc.ChangeStock(strMatNr, 100)
   next
     msgbox "New stock level = " & tblMat.GetField("LM_HOEV")
    set tblMat = nothing
   end if
</source>
</source>


== Availability ==
== Availability ==
Available since November 2004 (From version 3.5)

Latest revision as of 10:36, 23 April 2012

Declaration

Children as pdcCalculationList

Description

Returns the CalculationList object.

Notes

This property returns the CalculationList object for the subcalculations of the calculation object.

Code example

This code example loops through the subcalculations of a calculation and returns the description.

dim objCalc
dim objSubCalc
dim intCount

  set objCalc = pdc.ActiveCalculation
  
  for intCount = 0 to objCalc.Children.Count -1
    set objSubCalc = objCalc.Children(intCount)
    msgbox objSubCalc.Description
  next

Availability