Cs.redirect in a code studio event action rule

Hi,

I’m trying to redirect to a page (1) from another page (2) whose context id is not the same. I have created a rule which fires on a signal on page (2) which executes a rule whose Response is a code studio event action. The event action has a cs.redirect statement in it which should redirect to a url (the url of a page within the same Liberty create application: not external). This is the cs.redirect statement:

I have output the url to the Detective, copied and pasted it into a browser and it displays the correct page and details.

Please could anyone let me know why the cs.redirect statement in the event action does not work ?

Thanks,

Mark

Also tried using a page path and that too does not work:
cs.redirect(CasePathPrefix + cs.ref(‘case_progression_page’) + CaseContextId);

Hi Mark

Unsure if you managed to solve your issue but I have had something similar. The cs.redirect requires the full URL and from my understanding accepts no arguments. I made it work by building the full url and then call the redirect function.

const system_url = cs.config(‘SYSTEM_URL’);
const link = cs.link(cs.ref(‘PagePath’), your_context_record_id);
const full_redirect_path = system_url + link;
cs.redirect(full_redirect_path);

Maybe there is a better way to do it.

Hope this helps.
Carl

Hi Carl,

Thanks very much for providing a solution to this and letting me know. Very helpful!

Mark