How to add Edit related list action button

Alon Grod
Tera Expert

Hi,

 

im trying to add Edit related list action button in SOW on sys_user_grmember related list that on sys_user_group record. Can anyone help and share the configuration and the script?

5 REPLIES 5

Shree_G
Mega Sage

Hello @Alon Grod ,

 

I was able to create a "Edit" button by following below steps on "sys_user_grmember" table in Workspace.

 

1. Go to "Now Experience Framework" -> "Declarative Actions" -> "Related List Actions".

 

ShirishGhule1_0-1743423223291.png

 

2. Create "New" related list action and fill details like below :

 

ShirishGhule1_1-1743423336712.png

 

3. "Save" and click on Advance view to get "Conditions" section. Fill the condition as below :

 

parent.canWrite() && parent.getTavleName() == 'sys_user_grmember'

 

4. In Client Script paste below code. Which maps the relationship between User and Group.

 

function onClick() {
    var _strLink =
        '/sys_m2m_template.do?' +
        'sys_is_list=true&' +
        'sys_is_related_list=true&' +
        'sysparm_collectionID=' + g_form.getUniqueValue() + '&' +
        'sysparm_query=&' +
        'sysparm_referring_url=' + location.pathname + '&' +
        'sysparm_stack=no&' +
        'sys_target=sys_user_grmember&' +
        'sysparm_m2m_ref=sys_user_grmember&' +
        'sysparm_collection=sys_user&' +
        'sysparm_collection_key=user&' +
        'sysparm_collection_label=Group&' +
        'sysparm_collection_related_field=group&' +
        'sysparm_collection_related_file=sys_user_group&';

    var win = top.window.open(_strLink, '_self');

    win.focus();
}

 

ShirishGhule1_3-1743423613411.png

 

 

 

5. Save and Done. You will be able to see the edit button on SOW.

 

ShirishGhule1_2-1743423582637.png

 


If this solution helped resolve your issue, please consider marking it as helpful or correct.
This will assist others in finding the solution faster and close the thread.