Behaviour of Lookup "Update Other Fields"
Posted: Wed Jul 15, 2015 12:21 pm
I have a nuBuilder Pro application with a form/subform that allows users to request parts from stock for a given project. On the subform, I have a Lookup object that allows the user to search the product list and select the desired product. In the “Update Other Fields” section of the Lookup object’s properties, I then call a PHP function “getStkLevel()” that queries the stock for the select (Lookup) part number and returns the quantity of stock available to another field/object “stkLevel” on the subform.
This works fine if the user clicks the Lookup arrow, searches the parts list and then clicks on the desired part. When the part description is returned to the subform, the PHP runs and the available stock level is returned correctly. However, if the already has the part number and just pastes it into the appropriate field on the subform, the PHP is just returning a stock level of 0. So either the PHP is running but at that point does not have the Part Number from the Lookup (as the user hasn’t physically clicked it), or the PHP is not running as the user has not physically clicked the Lookup. Either way, the available stock field is not being correctly updated.
I hope this makes sense. I’m pretty new to nuBuilder development.
Does anyone have any ideas how I can effectively “force” the Lookup to trigger in a way to cause the PHP to run as it does when a user clicks through it, rather than pasting data into it, without clicking through the lookup form.
Many thanks.
This works fine if the user clicks the Lookup arrow, searches the parts list and then clicks on the desired part. When the part description is returned to the subform, the PHP runs and the available stock level is returned correctly. However, if the already has the part number and just pastes it into the appropriate field on the subform, the PHP is just returning a stock level of 0. So either the PHP is running but at that point does not have the Part Number from the Lookup (as the user hasn’t physically clicked it), or the PHP is not running as the user has not physically clicked the Lookup. Either way, the available stock field is not being correctly updated.
I hope this makes sense. I’m pretty new to nuBuilder development.
Does anyone have any ideas how I can effectively “force” the Lookup to trigger in a way to cause the PHP to run as it does when a user clicks through it, rather than pasting data into it, without clicking through the lookup form.
Many thanks.