- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2019 10:52 AM
Version: Kingston
I have added a couple of fields to fm_expense_line table and using a client script I update the value of one of the fields but the value updated by the script does not get saved to the db even though it shows on the form.
Details:
Added three columns
quote_quantity
quote_item_cost
quote_item_total_cost
I set quote_item_total_cost = quote_quantity * quote_item_cost.
The updated values appear on the form correctly, however, they are not saved to the DB.
Any help is appreciated.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2019 04:34 AM
Turns out the problem was that the calculated field was not getting set.
I had leveraged some older comments on how to handle currency fields and it didn't work correctly.
I had:
g_form.setValue(fldName,amount);
g_form.setValue(fldName+'.display',amount);
g_form.setValue(fldName+'.currency', currency);
But really should have had: (this works)
g_form.setValue(fldName, currency+";"+amount,amount);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2019 11:06 AM
Hi, can you confirm that the (updated) form is being 'saved' by someone after it loads and the client script sets these new values?
What debugging have you undertaken?
Have you checked to see if the expected values are being overwritten by other code - BR\workflow etc.
Is there any difference between Update and Save behavior - if you drill into a record from list view and them update are the correct values shown when you are returned to the list.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2019 11:20 AM
Fairly new at this so bear with me.
- Behavior seems to be consistent regardless of save or update.
- As best I can tell there are no business rules causing an issue.
- I looked at the table listing, no value.
- I also update the record's "amount" field and it displays correctly on the form but is not saved. I even created a business rule which simply does a gs.addInfoMessage("amount"+current.amount) which, regardless of the value in the form, always displays "0".
Just not sure what else to check.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2019 04:34 AM
Turns out the problem was that the calculated field was not getting set.
I had leveraged some older comments on how to handle currency fields and it didn't work correctly.
I had:
g_form.setValue(fldName,amount);
g_form.setValue(fldName+'.display',amount);
g_form.setValue(fldName+'.currency', currency);
But really should have had: (this works)
g_form.setValue(fldName, currency+";"+amount,amount);