@channel Anyone able to set the EXCHANGERATE value...
# suitescript
b
@channel Anyone able to set the EXCHANGERATE value on a PURCHASEORDER in PAGEINIT context? It looks like the client script sets the EXCHANGERATE field, and I can see that in the UI. But then a split second afterwards it seems native NetSuite overwrites my change and sets the EXCHANGERATE back to the proper rate informed by its native currency exchange rate table.
b
i cant imagine why you would want to change the exchange rate
but there are only specific circumstances where you would want it during pageInit
anything that changes the currency, like setting the vendor, would overwrite your exchange rate
even then you need to keep in mind you wont be able to change the exchange rate for the base currency
b
This client actually purchases currency quarterly. So they need a set exchange rate. As opposed to NetSuite's daily variable rate.
Good question though.
Thanks @battk you've given me an idea. Possibly use a sleep or wait function somehow.
To wait until native NetSuite writes the EXCHANGERATE... ensuring my script executes last!
b
the currency field on a transaction is not supposed to represent the purchase price of a currency
b
I appreciate your input @battk but I'm not sure you understand the business requirement.
Was really interested in talking Suitescript.
thx regardless
gonna try beforeLoad UE to see if that will get it... as opposed to pageInit in a CS
that may just do it
s
@Brian Brown i think what you're looking for is not to run it during pageInit, but after postSourcing...
b
ahhh ok @Sciuridae54696d Maybe that would work!
let me give it a try!
@Sciuridae54696d postSourcing worked flawless! Ty!
keanu thanks 1