PdcAllocations.Open: Difference between revisions
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..." |
|||
(2 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
== Declaration == | == Declaration == | ||
Open(SA_ID as Integer) as | Open(SA_ID as Integer) as [[pdcAllocation]] | ||
== Description == | == Description == | ||
Line 6: | Line 6: | ||
== Notes == | == 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 [[pdcAllocation | 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 [[pdcAllocation.WriteOff]] for more information. | ||
== Code example == | == 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. | 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) |
Latest revision as of 08:39, 1 May 2017
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 pdcAllocation.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)