How does function Match of Acumatica works

350 views Asked by At

How does work function Match in Acumatica? For example I can't understand what following code does (this is code from coderepository.xml). Why in first case we don't mention table, but in second we mention table.

 1. Search<InventoryItem.inventoryID,
        Where<Match<Current<AccessInfo.userName>>>>


  2. Search2<APInvoice.refNbr, 
        InnerJoin<Vendor, On<APInvoice.vendorID, Equal<Vendor.bAccountID>>>,
        Where<APInvoice.docType, Equal<APInvoiceType.invoice>,
        And<APInvoice.vendorID, Equal<Current<FAService.vendorID>>,
        And<Match<Vendor, Current<AccessInfo.userName>>>>>
1

There are 1 answers

2
Gabriel On

Match is used to filter records based on the restriction groups in place. Restriction groups are used to support row-level security; for example you can use that to restrict some users to specific products, specific customers or specific vendors. The internal implementation is quite complex, and relies on a bit mask field called GroupMask. Although it is used on a few specific entity types, it can be extended to work with custom entities.

There's a whole chapter on row-level security in the Acumatica User Guide, which should provide you with all the information you need on setting it up.