Navigating a User Back From a Creatio Freedom UI Page

There are some scenarios where you want to prevent a user from proceeding to a page and instead force them to go back to where they started. It could be scenarios where they need to complete other things first, or maybe they don’t have a specified permission to proceed to a given page. You can force the user to navigate back by executing a crt.7XRequest request with an action of BackHistoryState.

if (someCondition) {
	Terrasoft.showInformation("You can't be here");
	await request.$context.executeRequest({
		type: "crt.7XRequest",
		action: "BackHistoryState",
		$context: request.$context,
	});
}

The end result will be that the user will click something to go to a page, but then instead sees the message. It all happens quickly, the user won’t even see the page load. A little flash and then the message displays.

A note about the crt.7XRequest. This request allows you to do a this.sandbox.publish sandbox message as you would in classic pages. It’s a stop-gap for doing things that there might not be a complete Freedom UI request equivalent yet.

Want content like this delivered to your inbox? Sign up for our newsletter!
ABOUT THE AUTHOR

Ryan Farley

Ryan Farley is the Director of Development for Customer FX and creator of slxdeveloper.com. He's been blogging regularly about SalesLogix, now Infor CRM, since 2001 and believes in sharing with the community. His new passion for CRM is Creatio, formerly bpm'online. He loves C#, Javascript, web development, open source, and Linux. He also loves his hobby as an amateur filmmaker.

Submit a Comment

Your email address will not be published. Required fields are marked *