PdcApplication.ChangeStock: Difference between revisions

From External Bemet Wiki
Jump to navigation Jump to search
Created page with "== Declaration == ChangeStock(strMatNr as String, dblMutatie as double) == Description == Changes the stock for the supplied material number. == Notes == This method will ad..."
 
 
Line 7: Line 7:
== Notes ==
== Notes ==
This method will add or subtract the supplied quantity to the stock for the supplied material number.
This method will add or subtract the supplied quantity to the stock for the supplied material number.
Use [[PdcApplication.CheckStock]] to calculate new stock needs.


== Code example ==
== Code example ==

Latest revision as of 11:57, 11 July 2017

Declaration

ChangeStock(strMatNr as String, dblMutatie as double)

Description

Changes the stock for the supplied material number.

Notes

This method will add or subtract the supplied quantity to the stock for the supplied material number.

Use PdcApplication.CheckStock to calculate new stock needs.

Code example

This code adds 100 items to the stated materialnumber's stock position.

dim strMatNr
dim tblMAT

  strMatNr = "12345"
  set tblMAT = pdc.Database.OpenTable(pdcConData, "LM_MAT", "LM_MATN")

  if IsValid(tblMat) and tblMat.Locate("LM_MATN", strMatNr) then
    msgbox "Current stock level = " & tblMat.GetField("LM_HOEV")
    pdc.ChangeStock(strMatNr, 100)
    msgbox "New stock level = " & tblMat.GetField("LM_HOEV")
    set tblMat = nothing
  end if

Availability

Available since November 2004 (From version 3.5)