Anvaigo Mobile App / Best Practices / Individual Table Relations between Anvaigo Pages

Individual Table Relations between Anvaigo Pages

For most cases, Anvaigo Client Suite uses default relations defined in Anvaigo Page Table-Field Relation (Read more here).

In some cases, a more complex relation is required having multiple tables being involved, or dynamic filters are required like being based on current date. This can be achieved by using an Action Code in Anvaigo Script.

In the following example code, Anvaigo Script filters table customer ledger entry to related Customer No., to Open  = TRUE and also to Due Date <= TODAY. Finally, the desired Anvaigo Page ASLS_CL_ENTRIES will be opened using Anvaigo Script. This Action Code can be integrated on a customer list or -card page because it is based on Rec to be a customer.

[[Declare your required variables]]
local CLE = Record('Cust. Ledger Entry');

[[Define your filters here]]
CLE:SETRANGE('Customer No.', Rec:GETVALUE('No.'));
CLE:SETRANGE('Open', TRUE);
CLE:SETFILTER('Due Date', '..%1', TODAY());

[[Open Anvaigo Page]]
PAGE_OPEN('ASLS_CL_ENTRIES', CLE, Rec);
Anvaigo Script example code to show open and due customer ledger entries.

You only have to use Action Codes if you need complex filters with multiple tables or dynamic data filters. If you simply have relations from table-field to another, please use the set-up of Anvaigo Page Table-Field Relation. This set-up does not need any source code. Read more here.