Selecting records depending on AccountName
I would like to share my some database layouts with my customers. They log in with their personal username in IWP. I only want the records that pertain to them to show, the rest must remain hidden. This is what I have done so far.
A) I created a separate table where cAccountName=Get(AccountName) on window open and is stored as a global record.
B) Each Customer has a field that I fill in manually called OnlineUserName. This I make sure is identical to the username I assign to them.
C) Each record has a notion of what customer "owns" it and thus is related to the OnlineUserName
D) I created a script that goes to a layout and then Find Records where cAccountName=OnlineUserName
This gives me 0 records as a result and I don't understand why.
I am extremely grateful for any advice and open for a totally new approach but I am way amauerish in scripting so please be verbose.
Also I tried to just skip the whole table of cAccountName and just compare Get(AccountName) with OnlineUserName but that didn't work. I think it has to do with thta the user isn't the creator of the record and thus the Get(AccountName) gives my info instad of theirs.