Redirect to portal URL from UI action in backend form does not work in new UI frame

Jessica6
Tera Contributor

Hi guys,

 

We have created a UI action 'Create Change Release' in the backend form on the Problem table that, when clicked, should redirect the user to the SP portal form 'Create Change Release' and automatically populate the problem number in the field Related Problem (value Parent). In the record producer 'Create Change Release' we have setup a client script that extracts the problem sys_id from the URL and populates the field Related Problem with the correct problem record.

 

When this UI action is used from a problem that is opened in a seperate browser tab (so without the menu All, Favorites, History, etc on top of the screen (new UI)) this works like a charm.

The link that is used is: 

<instance>/sp?id=sc_cat_item&sys_id=d59a042b1bdd7110fc7d7739cd4bcb44&sysparm_category=c7ca53b01bfa5510fc7d7739cd4bcb81&sysparm_parent=c6d8fe7e47d53950161ee7e8036d43ff

 

However, when a problem record is opened within the new UI frame (with the menu's on top and navigation pane on the left) the redirect is done to the portal form but still within the new UI and the link is different than the link that is used in the other scenario. 

The link that is used now is:

<instance>/now/nav/ui/classic/params/target/sp%3Fid%3Dsc_cat_item%26sys_id%3Dd59a042b1bdd7110fc7d7739cd4bcb44%26sysparm_category%3Dc7ca53b01bfa5510fc7d7739cd4bcb81%26sysparm_parent%3D64ae64a047147150161ee7e8036d4352 (I have marked the differences in red)

 

In this scenario the problem id is not populated in the field Related Problem.

 

Has anyone encountered this issue before and can provide support to solve the issue. I don't have an issue with the portal form being opened in the UI frame of the backend, the issue is that the problem nr isn't populated in the field Related Problem.

 

Content of the script in the UI action:

Jessica6_0-1695977998455.png

 

Content of the onLoad client script in the record producer

Jessica6_1-1695977729814.png

 

 

1 ACCEPTED SOLUTION

Sebastian L
Mega Sage

Hi,

If you do a client-side UI action, you can do this:

 

function flyMe() {
var url = portalFormPath + '&sysparm_parent=' + problemId;
g_navigation.open(url, '_top');

}

Best regards,
Sebastian Laursen

View solution in original post

5 REPLIES 5

Peter Bodelier
Giga Sage

Hi @Jessica6 ,

 

Place a ./ in front of the url on line 8 of the UI Action. so './sp?id= etc


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

Hi Peter,

 

That didn't work, but the other solution provided by Sebastian L works like a charm

 

Cheers,

Jes

Yes, I missed you where using setRedirectUrl, that keeps you in the frame anyway. 🙂

 

Glad Sebastians solution worked out for you!


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

Sebastian L
Mega Sage

Hi,

If you do a client-side UI action, you can do this:

 

function flyMe() {
var url = portalFormPath + '&sysparm_parent=' + problemId;
g_navigation.open(url, '_top');

}

Best regards,
Sebastian Laursen