PdcAllocations.Open
Declaration
Open(SA_ID as Integer) as pdcAllocation
Description
Creates a TpdcAllocation object which will load its allocation information by using the SA_ID.
Notes
This TpdcAllocation object can be used to write off an allocation in PdC. 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 WriteOff for more information.
Code example
This code opens an allocation using its SA_ID(166), it checks if the alloc object is not nothing and then shows the ReservationID in a label. If the alloc object is nothing it means something went wrong during the Open function. PDC.LastError should contain a message what went wrong.
dim alloc
Set alloc = PDC.Logistics.Allocations.Open(166)
if not alloc Is Nothing then
Label1.Caption = alloc.ReservationID
else
Label1.Caption = "error: " + PDC.LastError
end if
Availability
Available since May 2017 (from version 5.4)