Limit NetSuite Real time trigger
Hi,
I have a custom flow which sync NetSuite Invoices to Salesforce. I want the sync to work only when Invoice is created in NetSuite or Payment is received for the Invoice. Currently. I have set the Real time listener with Execution Type as Create and Edit and the Execution context as User Interface. But the flow is triggered on all edits happen to Invoice neither it get triggered when Payment record is created for the Invoice. Can anyone suggestion feasible solutions to this issue?
Thanks in advance.
-
Hi Aishwarya M J,
One potential option is to break up the flow into two flows based upon the required business logic to avoid unwanted runs of the flow.
First Flow would be a real time listener only on the create of the invoice. By removing the edit logic this would prevent the flow from triggering during any routine record edits.
Second flow would be a real time listener on the payment records rather than the invoice followed by a lookup step to gather the invoice record data associated with that payment record. This flow would then kick off once a payment record is created and the lookup step would ensure you have all the relevant data about the invoice you need to move to salesforce.
Together these two flows would kick off only when an invoice is first created and then once a payment is created.
0 -
Hi Nate Briant
I have worked the solutions as you've suggested. A flow is created in the Create context of Invoice and added another flow which triggers on the create context of Payment. Now I've an issue in the Payment flow.
From NetSuite Payment record, I get the Invoice number in the apply to list. I fetch this Invoice number and try to Import to the Salesforce Invoice, but in the lookup to find existing record and error is occurring.
This does not work correctly. I always get same 2 Invoice from Salesforce as existing records, and there is an error "Multiple matches found for lookup."
Can you please help on this?
Thank You
0 -
This could be because of how you formatted the lookup filter on the salesforce step. Can you provide a screenshot inside of the filter UI?
Also have you check the two salesforce records that the lookup returns and seen if they do in fact have the same value in the invoice_number_c field. This would cause an issue if there are in fact multiple records that share an invoice number. You would have to add an additional logic statement as part of your lookup filter to ensure the correct record is being created.
0 -
Hi Nate Briant
This is my lookup filter.
Also the two salesforce Invoice records does not match with my Invoice Number. Infact they do not have values in the invoice_number_c field.
0 -
This indicates to me that the value being passed in the filter is blank and therefore returning multiple records which have blank Invoice number __c fields.
The other question I would have is are there ever going to be multiple lines in the payment that would need to update multiple invoices? That would change how you would need to build the flow. If there are multiple lines that need to be treated as separate invoices then you would need to indicate that with a one to many either on the import update step or in a first lookup step to return the invoices ID's per reference number and therefore change the filter.
If there is only ever going to be one line in the payment then I have a work around to have more control on the lookup filter.
0
Please sign in to leave a comment.
Comments
5 comments