SalesforceCommerceCloud / b2c-crm-sync

... a contemporary perspective on how to integrate B2C Commerce and the Salesforce Customer 360 Platform to power frictionless customer experiences in the B2C domain.
https://salesforcecommercecloud.github.io/b2c-crm-sync/
BSD 3-Clause "New" or "Revised" License
64 stars 47 forks source link

Flow B2C Commerce: Platform Event: Process Contact Update - You have uncommitted work pending #24

Closed filipecarvalho15 closed 2 years ago

filipecarvalho15 commented 3 years ago

Hi, i have already installed the connector in two production orgs and it's working properly, the only issue i still have is whenever an update is made from the storefronts this flow is giving me an error because of the DML statement inside the callout, the synchronization works fine but we get an error email everytime an update is made.

Salesforce help link

ericszulc commented 3 years ago

Hi @filipecarvalho15 , the emails should include a debug in Flow link. Does it point the element and Flow that is sending the error email?

filipecarvalho15 commented 3 years ago

Hello @ericszulc, here it goes:

image

ericszulc commented 3 years ago

Hi @filipecarvalho15 , can you set to execute a new transaction and see if that helps? as seen here https://jenwlee.com/2020/12/29/spring-21-flow-enhancements/

filipecarvalho15 commented 3 years ago

Hi @ericszulc, I wasn't able to find that feature in my action.

ericszulc commented 3 years ago

Hi @filipecarvalho15 , when you open advanced on the callout action in Flow, you don't see options to control the transaction?

ericszulc commented 3 years ago

it should be B2CCommerce_PlatformEvent_ProcessContactUpdate based on the error description

filipecarvalho15 commented 3 years ago

image image

ericszulc commented 3 years ago

hmm... ok. Well, another was to do it is edit the metadata directly and deploy.

https://github.com/SalesforceCommerceCloud/b2c-crm-sync/blob/72f5c4e66bb883a7de71c5a1759f98bddd682388/src/sfdc/base/main/default/flows/B2CCommerce_PlatformEvent_ProcessContactUpdate.flow-meta.xml

changing FlowTransactionModel to <FlowTransactionModel>NewTransaction</FlowTransactionModel>

filipecarvalho15 commented 3 years ago

force-app/main/default/flows/B2CCommerce_PlatformEvent_ProcessContactUpdate.flow-meta.xml ia_retrieveB2CCommerceCustomerProfile (Action) - The process type 'Autolaunched Flow' only supports 'CurrentTransaction' in 'FlowTransactionModel'

ericszulc commented 3 years ago

Hi @filipecarvalho15 , ok i see. i'm trying to find where the pending work could be occurring.