Product: WebViewer
Product Version: 8.0.0
Please give a brief summary of your issue:
(Think of this as an email subject)
Multiple Files are Saved. postMessage posts message twice
Please describe your issue and provide steps to reproduce it:
(The more descriptive your answer, the faster we are able to help you)
Hello,
I am not sure if you can help me with this. I have a LWC component for new record. It has Web viewer in that component. When the user clicks on submit button, I create a JSON object to store form data and then call an event listener in config.js that grabs the document from Web viewer, converts it to blob, and calls another event listener with blob data which tells LWC component that blob file is available. After receiving the blob file, LWC calls the Apex function to save form data to Salesforce and blob file to Azure.
This setup works great when you create the first record after landing on Salesforce. After creating the first record, if you try to create another record, listener call from config.js post messages twice so LWC creates two records, one with current form data and file and the second with previous form data and current file.
I am doing something wrong, but I am not able to figure this out. I am not posting messages twice. If I am, then LWC should create two records with same form data and not different form data.
I would appreciate if you guys can assist me with this. Thank you!