November 30, 200916 yr Good Day, I have a database of hazardous materials. Some of the fields include: owner, chemical name, quantity etc. I have also activated IWP for people to go in and change their own inventory (ingenious, I know). A log in script filters for their 'stock' only and then can add and delete or edit. Now: IWP Accounts (online privilege set based - restricted access) are created automatically through the 'owner' field. The PWs are created based on the owner field plus a numeric string. So far, everything's going great .. I'm wondering now how I can automatically delete such a user account, when his/her 'stock' goes to zero (aka. when no more records with their 'owner' name exist (owner field content == account name) .. Any ideas greatly appreciated. thanks, Mat
December 1, 200916 yr Interesting setup. Have you thought of using RLA to limit the records that they see, rather than a find? Capture Get(AccountName) into gAccountName in an open script and set the rule for view to gAccountName=Owner. If you had a Users table, then you could run a script (FM Server script) that checks for Users that don't have any related records User::AccountName=Inventory::AccountName, and delete the corresponding account. If their stock goes to zero, will it ever come back? Perhaps it would be better to disable the account than delete it?
December 1, 200916 yr Author thanks b, I'll work through your solution and see what I can come up with. I never considered using views rather than searches ... ingenious, so much to learn }:(
Create an account or sign in to comment