Hello I have a 2 tiered pricing system and need to look up the quantity value to determine the pricing. This is done in a subform grid. The lookup table has a product small order price a min order quantity and a normal price. Right now the price is placed in the form from a lookup of product code after browse.
$lu = nuLookupRecord();
if (#OrdLineQty#<$lu->ProdWholeSaleMinQty)
{
nuSetFormValue('OrdLineRate', $lu->ProdSmWholeSale);}
else {
nuSetFormValue('OrdLineRate', $lu->ProdWholeSale);}
nuSetFormValue('OrdLineDesc', $lu->ProdDesc);
However I can see that hashcookies for subform objects are not available. Any suggestions on how to proceed?
What I'm trying to do is something like this:Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
Value of subform field. Topic is solved
Value of subform field.
You do not have the required permissions to view the files attached to this post.
-
- nuBuilder Team
- Posts: 4297
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact:
Re: Value of subform field.
Hi,
Add an onclick event to your lookup object to set a Hash Cookie that can be used in After Browse:
Add an onclick event to your lookup object to set a Hash Cookie that can be used in After Browse:
Code: Select all
var qty = nuSubformRowObject(event.target.parentElement.id, 'OrdLineQty').val();
nuSetProperty('OrdLineQty', qty);
Re: Value of subform field.
There seems to be a browser issue in Brave (my preferred browser), but things work fine in FireFox. What I'm finding is that the property is not always set. I'm seeing this through the console.
I'm assuming that the error is caused by the above, if not please let me know. FF reports no errors. Any idea how to resolve this?You do not have the required permissions to view the files attached to this post.
-
- nuBuilder Team
- Posts: 4297
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact:
Re: Value of subform field.
This is not an error but an "improvement issue" that is caused by the external library Google chart.
I tried to replicate your issue using Brave but was not able to do so.
What I did was set a Hash Cookie with nuSetProperty('#OrdLineQty#','someting') in a lookup's onclick event.
In the After Browse event I output it with nuDebug('#OrdLineQty#');
What you could do is a console.log() after setting the Hash Cookie to output its value to the console. This is to watch if is actually being set.
I tried to replicate your issue using Brave but was not able to do so.
What I did was set a Hash Cookie with nuSetProperty('#OrdLineQty#','someting') in a lookup's onclick event.
In the After Browse event I output it with nuDebug('#OrdLineQty#');
What you could do is a console.log() after setting the Hash Cookie to output its value to the console. This is to watch if is actually being set.
Code: Select all
nuSetProperty('OrdLineQty', qty);
console.log('OrdLineQty: ', qty);
Re: Value of subform field.
I did set a console.log. When it was set, things it worked, when it wasn't it didn't. It seems to work randomly mainly on new records. This is Brave on Ubuntu 22.04.