I have a scenario which I am trying to solve. I am getting sent an "exchange" transaction from the POS system that I have to convert to NetSuite cash sales and cash refunds to handle them correctly. The system currently handles sales and refunds correctly when the transaction is one or the other. I have 2 flows - one for cash sales and one for cash refunds. The cash sale is first and has a filter that "keeps" the sales and passes the refunds off to the next flow - which works correctly. With the incoming exchange transaction, I will always have both a sale and a refund that I will need to post separately in NetSuite - as they are done now. The initial data is received via a webhook that then uses a transform to correctly format the data for the NetSuite posts. The transformation lets me use simple import mappings for both the sale and refund. I have taken an exchange transaction and created the correct mapping, which makes both a sale and refund transaction. Here is the flow:
I thought about altering my filter from the CO listener, but it only returns a boolean value. I can create a presave hook to do anymore code changes, but I still need to split the one transaction into 2 or be able to process the sale and then pass the refund on to the final destination. Any help would be greatly appreciated.
Please sign in to leave a comment.