cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Random FIELD_INTEGRITY_EXCEPTION error that sometimes occurs but other times works

johnw
Executive Chef I
Executive Chef I

usually, we have a specific Pricebook in SFDC to link up to an order and each pricebook only has 1 Currency,

but on occasion there are multiple price books in Epicor so in SFDC I would use the Standard price book and when I create the opportunity I would set the Currency as USD or Euro etc.

normally this works fine but randomly like once a few months ago and then twice in 2 days I would get errors like this:

  • Status code: FIELD_INTEGRITY_EXCEPTION,
  •  Message: field integrity exception: unknown (pricebook entry currency code does not match opportunity currency code),
  • Fields: [
    • unknown

 

but today I had an order in Epicor with 3 SKUs and 2 worked and 1 didn't on the same Op

so i started looking at this formula since its calculation a discount and thought maybe its a simple rounding issue

originally it was just a simple Price * (1- Discount)/100 which shows the price per unit

"OrderDtl_DocUnitPrice"]}')* (1- "OrderDtl_DiscountPercent"]}')/100))

so thinking it as a rounding issue I added

).round(2)

then attempted to add currency conversion to the rounded formla 

.to_currency

and the error message changes to:

  • Status code: JSON_PARSER_ERROR,
  • Message: Cannot deserialize instance of currency from VALUE_STRING value $665.00 or request may be missing a required field at [Source: N/A; line: -1, column: -1][line:-1, column:-1],

its weird because it works fine 99.9999% of the time as it originally was.

Was thinking it would be as simple as just hard coding the currency when i add the SKU but that's not possible at the Opportunity Product level unless I loop through to find the pricebookentry ID which would eat up tasks if I had to do it for all SKUs using standard pricebook

any ideas???

1 REPLY 1

marlon-muela
Workato employee
Workato employee

Hi @johnw ,
The steps to reproduce is a bit confusing. It would be better to identify what values are causing the formula to error. You can check the input tab on the job report to see what value of the data pill the formula is using that causes an error. Based on your sample formula, you must check the values of "OrderDtl_DocUnitPrice" and "OrderDtl_DiscountPercent". It is possible that one of the value from the data pills used is blank or is not a valid format.