HI,
How do I push or replace navigation history in freedom. In classic UI you were able to do it using a sandbox message.
Is it possible to be done in Freedom?
Thank you!
Like
Are you referring to pushing to navigation history (as far as going to the record/page itself)?
If so, this shows how to open a page (section or other page) https://customerfx.com/article/navigating-to-a-page-via-code-in-a-creatio-freedom-ui-page/
This shows how to open a record page in add or edit mode https://customerfx.com/article/opening-an-edit-page-to-add-or-edit-a-record-via-code-in-a-creatio-freedom-ui-page/
If I've misunderstood what you're after let me know. Hope this helps.
Ryan
Hi Ryan, thank you for your answer.
No that's not what I'l looking for. What I want to do is what history.replaceState(state, unused, url) does in JS. change the shown url and the browser history, but not navigate.
Javier Collazo,
Ah I see now. I've not noticed any equivalent of that in the devkit. I've seen a navigationservice and router classes as possibilities in the internal code, but they aren't exposed in devkit.
One possibility is to use the "crt.7XRequest" request. I've been able to use that for what would have been a sandbox.publish previously, a least for what I've tried with it so far. See https://customerfx.com/article/navigating-a-user-back-from-a-creatio-freedom-ui-page/
Might take a little playing with to figure out how to get the other params passed for stateObj, pageTitle, etc. Searching the source for "crt.7XRequest" would likely find some examples of similar requests.
Ryan
Javier Collazo,
I did find an example:
await handlerChain.process({ type: "crt.7XRequest", $context: null, action: "ReplaceHistoryState", hash: someHash, stateObj: obj, silent: isSilent });
Ryan