October 23, 201510 yr Hello , i have a invoice solution and i want to prevent duplicate the items products on the same invoice portal. for example if i have a product called " 2525 " and then im trying to add the same "2525" shows me a custom dialog to stop . i use global fields with a button script to add items to the portal . please let me know how to resolve this, I've been trying many ways with no luck thank you
October 23, 201510 yr You should try to leverage the field level validation settings to handle this condition. If you have built a proper invoicing solution then you should have an invoice line items table that knits together invoice id, product ids, quantities and the like. the invoice line items table is the right place to put the unique, validate always, and don't allow user to override.validation. I would create an auto enter calculation that concatenates the invoice id and the product id and drop the validation on that. This method means that anywhere the invoice line item::product id field is expressed on a layout it will be validated if the value is changed. Another method that not safe for your data because its tied to the UI is to use an onObjectValidate script trigger on the layout object you want to control. Because the OnObjectValidate script trigger is a PRE event trigger you can cancel the event that triggers the trigger by returning False with the Exit script step i.e. Exit[False] http://www.soliantconsulting.com/blog/2015/05/filemaker-14-script-triggers Edited October 23, 201510 yr by Kris M
November 22, 201510 yr Checkout this thread... Sample files are there too http://fmforums.com/topic/98459-loop-script-to-update-portal-records/#comment-447649
Create an account or sign in to comment