1

I have created a flow that creates a pricebook entry for new products (based on a custom field on the Product object), however when I debug the flow it comes up with the following quite generic error:

FIELD_INTEGRITY_EXCEPTION: field integrity exception.

I cannot work out what I am doing wrong. I have reduced the flow to three steps:

  1. Start
  2. Assignment: recNewPriceBookEntry
  3. CreateRecord (base on reNewPriceBookEntry)

The full output of the final step that causes the error is:

FAST CREATE: Create_New_Price_Book_Entry

Create PricebookEntry records using the values that are stored in {!recNewPriceBookEntry}.

Variable Values

[IsActive=true,Product2Id=01t25000003Hfy8,UnitPrice=1200,UseStandardPrice=true,Pricebook2Id=01s58000001nQb8]

Result

Failed to create records.

Error Occurred: This error occurred when the flow tried to create records: FIELD_INTEGRITY_EXCEPTION: field integrity exception.

I have also tried using the 18 character IDs (01t25000003Hfy8AAC & 01s58000001nQb8AAE), which results in the same error.

As this is a fresh sandbox, there are no entries in the Price Book Entry object (I double checked that with Developer Workbench).

If anyone can tell me what I am doing wrong that would be very much appreciated.

3
  • Do you have multicurrency enabled? Are you sure they are the correct ID values for that org?
    – sfdcfox
    Commented Feb 28, 2019 at 12:27
  • 1
    UseStandardPrice field value can not be set to true on insert. Commented Feb 28, 2019 at 12:39
  • Removing the UseStandardPrice field from recNewPriceBookEntry solved the problem. Thank you so much for your help.
    – Kees
    Commented Feb 28, 2019 at 13:40

2 Answers 2

1

Rohit Patil's comment solved the problem:

UseStandardPrice field value can not be set to true on insert.

I removed the UseStandardPrice field from recNewPriceBookEntry and it started working.

Thank you.

0

came across in a similar problem.

Findings:

if we have a discrepancy in unitPrice in between standard and custom price book and we are using UseStandardPrice = true then we will get the same error as follows:

FIELD_INTEGRITY_EXCEPTION

to solve the issue:

we have to maintain the unitPrice same as standard PriceBookEntry, then only we can mark the UseStandardPrice = true

or we need to mark UseStandardPrice = false if we want to insert the record with some different unit price value

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .