- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2015 05:30 AM
The purchase order proc_po takes the Total Cost from the purchase order line items proc_po_item
We're set to GBP which is fine until I create a line item that is in USD. The line item shows as USD but the po converts it to local currency. How do I get this to just show the current / amount from proc_po_item ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2015 08:26 AM
Hello Ben,
New idea, include the u_total_cost field in the form. Hide it with a UI policy. Create an onChange client script on the cost field:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue == '') {
return;
}
g_form.setValue('u_total_cost', newValue );
}
The business rule will not be needed.
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2015 09:10 AM
Hello Ben,
I would suggest you to create a new field as a string in the proc_po_item table .( Lets call it u_total_cost for this example)
Then create a business rule to have the new field synced with the original total cost field.
Business rule should run on the proc_po_item table before insert and update. This should be the code:
current.u_total_cost = current.total_cost.toString();
Please make sure that the field name are correct.
Then you need to replace the field in the PO form.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2015 03:31 AM
Thanks Edwin, I've given this a go but the original Total cost field shows the currency converted value already as well.
I need to pick up the po_proc_item.cost but i've changed the Business Rule to :
function onBefore(current, previous) {
//This function will be automatically called when this rule is processed.
current.u_total_cost = current.cost.toString();
}
But it is still picking up the currency converted number
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2015 08:26 AM
Hello Ben,
New idea, include the u_total_cost field in the form. Hide it with a UI policy. Create an onChange client script on the cost field:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue == '') {
return;
}
g_form.setValue('u_total_cost', newValue );
}
The business rule will not be needed.
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2015 08:28 AM
I'll give it a go!