PdcAllocations.Open

From External Bemet Wiki
Revision as of 13:58, 25 April 2017 by Mike (talk | contribs) (Created page with "== Declaration == Open(SA_ID as Integer) as IAllocation == Description == Creates a TpdcAllocation object which will load its allocation information by using the SA_ID. == N...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Declaration

Open(SA_ID as Integer) as IAllocation

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.

source lang="vb" 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 /source

Availability

Available since May 2017 (from version 5.4)