Hello. Why omniscript reload when the method This.omniNavigateTo() is called from lwc that IS embeded in omniscript?
#Omnistudio #Omni #Vlocity #Vlocity Architects #Salesforce Developer #Salesforce Developers #Developer #Developers #Lightning Web ComponentsThe this.omniNavigateTo() function triggers a page navigation event. When used inside an LWC embedded within an OmniScript, it often bubbles up and causes the entire OmniScript container to refresh or re-initialize, looking like a "reload."
Solution:
Instead of this.omniNavigateTo(), use the
OmniScriptBaseMixin events to communicate with the parent OmniScript without forcing a full page navigation.- If moving to the Next Step:
javascript
this.dispatchEvent(new CustomEvent('omninesxtstep'));
If updating data:
javascript
this.omniApplyCallResp({ "yourData": "value" });
Why it happens: omniNavigateTo is designed for PageReference navigation (like moving from Salesforce Page A to Salesforce Page B). When you call it, the framework assumes you are leaving the current context, so it reloads the component wrapper. Avoid using it for simple step transitions inside the same OmniScript.