AnsweredAssumed Answered

Manual validation giving inconsistent results

Question asked by mactabby on Oct 22, 2018
Latest reply on Oct 22, 2018 by philmodjunk

Hi - I'm having problems with manually validating a stock code field on an 'order items' date entry form.  The form is a portal on a 'sales order' form.  I'm on FMPro 16 using a FMS 16 database.

 

The user can key in a valid stock code, or a special code for a message line, or leave the code blank to move to the description field and key in using auto-complete.  Because of these latter options and some auto-populating of prices and qty I have to validate the field using a script which I'm triggering with onObjectValidate.  The script checks the validity of a relationship between the order items table with the main stock table based on the stock code, and if it doesn't find a valid relationship, shows a message and keeps the user in the field with an exit script: false.

 

This works fine if the code is valid, and correctly handles an invalid code, but when you correct an invalid code to a valid code it doesn't give a valid outcome.  I can't work out why.  My workaround is to use executeSQL to check the active field contents against the main stock table, but this feels clumsy to me.

 

What am I doing wrong and how should I do it instead?

 

Thanks in advance.

Outcomes