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???

4 REPLIES 4

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.

not sure if the whole DocUnitprice is a red herring since now I'm seeing a version 3 error message as shown below

johnw
Executive Chef I
Executive Chef I

so weird this used to be super random but now its happening a lot.

its only if the Standard pricebook is being used and Standard pricebook is only pricebook that can be USD, CDN or EURO so its almost like when adding the SKU its not sure which currency or its grabbing the first currency and doesn't match the Opportunity Currency. But adding teh opportunity Line item i don't have any way to force it to USD for example

 

very strange how this has been running fine for a while

johnw
Executive Chef I
Executive Chef I

At the opportunity level I enter the Price Book and the Currency

At the Opportunity Product object I have always just included the Product ID and its worked

The ONLY pricebook that has more than 1 currency is the Standard pricebook

As discussed here recently it randomly stopped working for SOME where I would get an error message when trying  to add the Opportunity Product records to a new Opportunity

Again this has been working fine for quite a while and just started doing this

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

But today I noticed this message what is version 3.0 and when did something change???:

  • Status code: FIELD_INTEGRITY_EXCEPTION,
  • 16          Message: field integrity exception: PricebookEntryId, unknown (versions 3.0 and higher must specify pricebook entry id, others must specify product id),
  • 17          Fields: [
    • 18             PricebookEntryId,
    • 19             unknown

It almost feels like its go9ng to force me to go search on every SKU now to find the exact pricebook entry ID for my pricebook and currency combination. This doesnโ€™t seem like progress since this was working fine.