Appearance
Action.Partners
Declaration
property Partners : array of TFloTradingPartnerLink
Example
pascal
procedure OnMapEvent(var Value:Variant);
begin
if Action.PartnerCount > 0 then
LogInfo('First TradingPartner in current Action is ' + Action.Partners[0].PartnerName);
end;Description
Returns the array of Trading Partners that have been linked into the Action. The first item in the array is position 0.
Determine the number of Trading Partners in the array
You can return the number of linked Trading Partners by using Action.PartnerCount
Using Trading Partners to process one source file multiple times
The list of Trading Partners that has been configured on an Action's Trading Partner tab can be referenced using the Action.Partners array. A script can use the array to determine whether the currently active Trading Partner is the first to be processed, or the last, or somewhere in between.
For example, to process the same file multiple times across a set of Trading Partners, an Action must be stopped from moving the file to the audit folder when processing each Trading Partner except for the final one. This can be achieved by comparing the currently executing Partner (Action.Partner) with those listed in the array.
i := Action.PartnerCount - 1; // the array position of the final Partner linked into this Action
if GUIDToString(Action.Partner.ID) = GUIDToString(Action.Partners[i].PartnerFID) then
// the currently executing Partner is the final one - set DoMoveToAudit
Source.FileCon.DoMoveToAudit := True
else
Source.FileCon.DoMoveToAudit := False;
Other properties for Trading Partner links
Action.Partners[i].PartnerName - the company name of the linked Trading Partner
Action.Partners[i].Partner - returns a TFloTradingPartner object for that position in the array