PdcAllocations.Open: Difference between revisions

From External Bemet Wiki
Jump to navigation Jump to search
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..."
 
No edit summary
Line 11: Line 11:
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.
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"
<source lang="vb">
dim alloc
dim alloc
Set alloc = PDC.Logistics.Allocations.Open(166)
Set alloc = PDC.Logistics.Allocations.Open(166)
Line 19: Line 19:
else
else
   Label1.Caption = "error: " + PDC.LastError
   Label1.Caption = "error: " + PDC.LastError
end if /source
end if  
</source>
   
   
== Availability ==
== Availability ==
Available since May 2017 (from version 5.4)
Available since May 2017 (from version 5.4)

Revision as of 14:00, 25 April 2017

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.

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)