Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Behaviour of Lookup "Update Other Fields"

Locked
armstrs01
Posts: 20
Joined: Tue Jul 14, 2015 5:00 pm

Behaviour of Lookup "Update Other Fields"

Unread post by armstrs01 »

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.
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Behaviour of Lookup "Update Other Fields"

Unread post by admin »

armstrs01,

If you select a record from a Browse #RECORD_ID# will refer to the id, if you type it in #RECORD_ID# will be the code.

Use #call_type# to find what was done.
Capture.PNG
Steven
You do not have the required permissions to view the files attached to this post.
armstrs01
Posts: 20
Joined: Tue Jul 14, 2015 5:00 pm

Re: Behaviour of Lookup "Update Other Fields"

Unread post by armstrs01 »

Fantastic! Thanks you. :D
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Behaviour of Lookup "Update Other Fields"

Unread post by admin »

.
Locked