PdcMaterialFile.CheckSourceFPart
Declaration
CheckSourceFPart(strMatNr as String, booStock as boolean) as Boolean
Description
This function adjusts the sourcing strategy for materials in Fparts according to the input paramater booStock (preferably the value of LM_MAT.LM_VR).
Notes
When changing a material's stock strategy in PdC, user is presented with the option to adjust all Fparts the material is incorporated in. This function executes that functionality from vbScript. Note that any checks required for setting a material to non-stocked (outstanding reservation, purchase order lines and existing stock position) need to be carried out in the script it self!
Code example
Adjust a material's sourcing strategy.
Sub btn_SelectMatNrClick(Sender)
edt_MatNr.Text = pdc.ChooseRecord(36, "", "")
End Sub
Sub btn_CheckSourcesClick(Sender)
dim booResult
dim booStock
booStock = (GetAnyField("LM_MAT", "LM_MATN", edt_MatNr.Text, "LM_VR") = "J")
booResult = pdc.MasterData.MaterialFile.CheckSourceFPart(edt_MatNr.Text, booStock)
msgbox "CheckSourceFPart = " & booResult
End Sub
Availability
Available since Jsnuary 2013 (4.3).