PdcCalculation.RecalcDatesPerOperation: Difference between revisions

From External Bemet Wiki
Jump to navigation Jump to search
Created page with "== Declaration == ReadFromArticle(ArticleID as String) as Boolean == Description == Read an article in the calculation == Notes == This method reads a calculation of a standard article into the current calculation object. BEWARE; Beware that the save method in this case does NOT change the standard calculation but only the current calculation object. == Code example == This code example creates a new calculation, reads a standard calculation into it, changes the prod..."
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Declaration ==
== Declaration ==
ReadFromArticle(ArticleID as String) as Boolean
RecalcDatesPerOperation(calculateSubs: Boolean)


== Description ==
== Description ==
Read an article in the calculation
Recalculates the start date for all operations in the calculation, the parameter can be set to True to includes any subcalculations.


== Notes ==
== Notes ==
This method reads a calculation of a standard article into the current calculation object.
This method will recalculate the start date for alle operations and then refresh the form. The new dates are updated in the database.
 
BEWARE; Beware that the save method in this case does NOT change the standard calculation but only the current calculation object.


== Code example ==
== Code example ==
This code example creates a new calculation, reads a standard calculation into it, changes the production quantity and saves it.
This code example is will take the active calculation, that has a production number reserved, and adds a new operation that will not have a start date. Then by calling the function it will recalculate the start dates.


<source lang="vb">
<source lang="vb">
dim objCalc
PDC.App.ActiveCalculation.OperationList.InsertLineNumber(PDCEXT.pdcOperationKind.pdcInternalOp, "FR001", 15)
PDC.App.ActiveCalculation.RecalcDatesPerOperation(True)
PDC.App.ActiveCalculation.Save()


  set objCalc = pdc.NewCalculation
  if objCalc.ReadFromArticle("1234") then
    objCalc.OrderQuantity = 3
    objCalc.Save
    objCalc.Show
  else
    msgbox "Could not read article"
  end if
</source>
</source>


== Availability ==
== Availability ==
2024.2.3.0

Latest revision as of 11:34, 15 April 2024

Declaration

RecalcDatesPerOperation(calculateSubs: Boolean)

Description

Recalculates the start date for all operations in the calculation, the parameter can be set to True to includes any subcalculations.

Notes

This method will recalculate the start date for alle operations and then refresh the form. The new dates are updated in the database.

Code example

This code example is will take the active calculation, that has a production number reserved, and adds a new operation that will not have a start date. Then by calling the function it will recalculate the start dates.

PDC.App.ActiveCalculation.OperationList.InsertLineNumber(PDCEXT.pdcOperationKind.pdcInternalOp, "FR001", 15)
PDC.App.ActiveCalculation.RecalcDatesPerOperation(True)
PDC.App.ActiveCalculation.Save()

Availability

2024.2.3.0