Rule Tables
There are many rule tables in Logtrade Connect. A rule tables decides how data shall be assigned, or which automation actions to perform, based on different circumstances/data.
Rule tables has conditional columns that decide when a rule apply. In the example below the first seven columns are conditional columns and the column Service Code decides what service code to use when a rule applies to the data on a consignment.
In most cases a rule table is used to decide one single value to use, but rule tables can also be used to return multiple values. The example above shows the rule table that decides which consignment services that shall be created for a consignment. In this case the service code DHL ADVICE will be used for all consignments with shipping agent DHL and SMS ADVICE will be used for all consignments with sales order as source document type. This also means that a consignment with Source Document Type = Sales Order and Shipping Agent Code = DHL will have the services DHL ADVICE and SMS ADVICE.
The example below is the address rule table. This table is queried for each possible address type to see if any rules apply.
The table below shows what a sender address will be based on depending on different value son a consignment.
Source Document Type | Shipping Agent Code | Delivery Country Region Code | Sender address source |
---|---|---|---|
Sales Order | DHL | NO | Source Document, invoicing tab |
DHL | Company Information, general tab | ||
Sales Order | BRING NO | NO | Source Document, general tab |
The last result in the table above might seem a bit strange. The reason for this is that for each conditional column, a filter is applied that accepts a blank value or the actual value from the consignment. When all filters are set, a FindLast() is executed. Since Source Document Type is before Shipping Agent Code in the primary key the row with Source Document Type comes after the rows without. In order to have consignments based on sales orders with BRING NO to Norway to use the custom address NO, that rule would need to have a Source Document Type.
When a consignment based on a sales order with shipping agent BRING NO bound for Norway shall have it's sender address assigned the filter setting is as below:
SetFilter("Source Document Type", '%1|%2, '', "Source Document Type"::"Sales Order");
SetFilter("Shipping Agent Code", '%1|%2' , '', 'BRING NO');
SetFilter("Delivery Country/Region Code", '%1|%2, '', 'NO');
if FindLast() then