Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Related list action assignment query

Kiran Kumar 76
Tera Expert

I have created related list action(new) for escalation table in incident task related list

when i clicked on it source record shall populate with incident task reference ,i have created an related list uxf acton ,but not sure where to set the source record to incident task when clicked

KiranKumar76_1-1760793923814.pngKiranKumar76_2-1760793971035.png

 

 

KiranKumar76_3-1760794104962.png

 

1 ACCEPTED SOLUTION

lauri457
Giga Sage

I couldn't figure out how to do below using the list component on the related records page 
Bind an event to a declarative action

But you can just swap your action assignment to a type of client script and use this in your client script:

	g_aw.openRecord("sn_customerservice_escalation", "-1", {
		query: `source_record=${g_form.getUniqueValue()}^source_table=${g_form.getTableName()}^reason=0`
	})

Passing a query property in the third param of the openRecord method in GlideAgentWorkspace will apply a similar effect as a sysparm_query url parameter on the classic forms. The existing client actions I guess do not work with document id fields

View solution in original post

4 REPLIES 4

Sarthak Kashyap
Kilo Sage

Hi @Kiran Kumar 76 ,

 

I tried your problem in my PDI and it is working file for me please check below solution 

 

Please navigate to All> Now Experiece Frame Work> Related list action , Create new (sys_declarative_action_assignment Table name for your Reference).

 

SarthakKashyap_0-1760860769708.png

Result 

SarthakKashyap_1-1760860792441.png

SarthakKashyap_2-1760860839262.png

 

Once I click on newly created button it is showing me the task it taking the reference of the INC00014.

 

Please mark my answer correct and helpful if this works for you

Thanks and Regards 

Sarthak

 

 

@Kiran Kumar 76 ,

 

Any update on your problem, is it resolve or not ? 

 

Please mark my answer correct and helpful if this works for you

Thanks and Regards 

Sarthak

nityabans27
Kilo Patron

Hi @Kiran Kumar 76,

You created a Related List Action (New) for the Escalation table shown under Incident Task.
To auto-populate the Source Record with the current Incident Task when clicking ā€œNewā€:

  • If you’re using Workspace UXF form/modal →
    In the Related List Action setup, bind parameters:

    source_record = ${context.record.sys_id}
    source_table = ${context.table}

    This passes the current Incident Task to the Escalation form.

  • If you’re using classic form view →
    Edit the action’s URL to include:

    /escalation.do?sys_id=-1&sysparm_query=source_record=${context.record.sys_id}^source_table=incident_task

āœ… Result: when you click New in the related list, the Escalation record opens with Source Record prefilled with that Incident Task.

lauri457
Giga Sage

I couldn't figure out how to do below using the list component on the related records page 
Bind an event to a declarative action

But you can just swap your action assignment to a type of client script and use this in your client script:

	g_aw.openRecord("sn_customerservice_escalation", "-1", {
		query: `source_record=${g_form.getUniqueValue()}^source_table=${g_form.getTableName()}^reason=0`
	})

Passing a query property in the third param of the openRecord method in GlideAgentWorkspace will apply a similar effect as a sysparm_query url parameter on the classic forms. The existing client actions I guess do not work with document id fields