PdcAllocation.Save: Difference between revisions

From External Bemet Wiki
Jump to navigation Jump to search
Created page with "== Declaration == Save() as Boolean == Description == Creates an Allocation in PdC according to the filled in properties == Notes == '''Keep in mind''' that an allocation ca..."
 
 
Line 6: Line 6:


== Notes ==
== Notes ==
'''Keep in mind''' that an allocation can only be written off through scripting if the material has the correct write-off-settings. Check the notes in [[pdcAllocation|WriteOff]] for more information.
'''Keep in mind''' that an allocation can only be written off through scripting if the material has the correct write-off-settings. Check the notes in [[pdcAllocation.WriteOff]] for more information.


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

Latest revision as of 08:37, 1 May 2017

Declaration

Save() as Boolean

Description

Creates an Allocation in PdC according to the filled in properties

Notes

Keep in mind that an allocation can only be written off through scripting if the material has the correct write-off-settings. Check the notes in pdcAllocation.WriteOff for more information.

Code example

dim alloc
Set alloc = PDC.Logistics.Allocations.New

alloc.MaterialID = 2075
alloc.MaterialNo = "ASSY3 SCHAW10"
alloc.Quantity = 4
alloc.LMV_ID = 111
alloc.ReservationID = 357
alloc.UseExistingAlloc = False

if alloc.Save() then
  Label1.Caption = alloc.ReservationID
else
  Label1.Caption = "error: " + PDC.LastError
end if

Availability

Available since May 2017 (from version 5.4)