I have a form that contains a record for each branch (of which there are 5). Each branch has different territories (states) that they are allowed to access, but some of them may overlap (i.e. Branch 1 may be able to see records for IL and WI, whereas Branch 2 should only be able to see records in WI). The Branch records have a field which contains the emailaddress for the user in question.
What I would like to do is create a function which will return the states that the logged in user has access to, and then use that information in various places througout the app to filter data.
For a specific example, I want to use the zoho.loginuserid and check for a match in the branches table, and then filter a lookup by those states that they are allowed to see. What would be the best way to do this? I am familiar with scripting and development in general but have never worked with Deluge before and am having a tough time getting started.
Can anyone point me to an example of this being done? I've looked at the various filtering examples I could find but they all seem to be very simplistic and I haven't been able to make any progress on this.