Create a Record in flow designer throws up an error

haripriyat82638
Tera Contributor

I am trying to look up for an existing customer account using the Salesforce ID provided in the catalog form. If there is an existing customer account, I just update those records with few field values. Whereas, if the customer account is a new account I am trying to create a record in customer_account table using a flow designer. Everytime, there is a new record flow designers throws up an error while creating a record. I am running this flow as a system user. 

Help me understand what needs to be done to resolve this.

haripriyat82638_0-1719915926129.png

haripriyat82638_1-1719915965493.pngharipriyat82638_2-1719915987515.png

 

8 REPLIES 8

Sandeep Rajput
Tera Patron
Tera Patron

@haripriyat82638 Please check if there is any business rule defined on your customer_account table which is preventing creation of a new record using current.setAbortAction(true)l

Currently there are no BR's which are trying to setAbortAction(true)l on customer_Account table

@haripriyat82638 Did you try to set the Run As System on the flow properties? This will make the flow run as system hence the ACL won't be an issue for it.

Hi Mark, 

I found the issue and now the flow is fixed.

Cause:

Looks like our organization is creating customer account records by importing data from other instances, which made the account code values out of sync. Because of the mismatch of these values I was getting an error while creating a new account as below:

java.sql.BatchUpdateException: Duplicate entry for key account_path

 

Fix:

  1. I Determined the account code for the last created account. By Adding the Account code field to the list view of the customer_account table and sorted it to find the latest update.
  2. Navigated to the System Property [sys_properties] table.
  3. Set the com.snc.cs_base.last.generated.code.tree.path property to the value determined in step 1 if it is not the same.