How to pass sysid of the workspace page to ui page?

Uday_Kumar
Giga Guru

Hi @Ankur Bawiskar @Community Alums @AndersBGS  @Allen Andreas @Prince Arora @AnveshKumar M 

I need to pass the sysid of the workspace page to the ui page normally we use set preference in glidedialogwindow but in workspace ui actions we use g_modal. can anyone please help me out how to pass sys_id of the workspace page to ui page through workspace ui action script.

Uday_Kumar_0-1680777069250.png

Thanks in Advance

16 REPLIES 16

Vaibhav
Mega Guru

Hello Uaday,

 

You can pass record sys_id  in workspace client script by using below line.

 

var recSysId = g_form.getUniqueValue();

 

Mark as correct and helpful if it solved your query.

Regards,
Vaibhav

@Vaibhav   Ok but how to retrive that in ui page

you can write this line in UI Page Client script section and utilise this variable.

 

For your reference you can refer below OOTB code written in UI Page Client Script section:

copyAsmt: function() {
this._closeDialog();
var changeRequestSysId = g_form.getUniqueValue();
var tableName = g_form.getTableName();
var ga = new GlideAjax("ChangeRiskAsmtAjax");
ga.addParam("sysparm_name", "copyAssessmentAjax");
ga.addParam("sysparm_id", changeRequestSysId);
ga.addParam("sysparm_class", tableName);
ga.getXMLAnswer(this.processAsmt.bind(this));
},

 

tried not working @Vaibhav  

Narendranath R1
Tera Contributor

@Ankur Bawiskar 

 

I'm having similar usecase, I have a ui action where i'm passing few parameters from client scirpt using setpreference and opening an ui page using glide dialog window and accessing them on ui page using render properties. This works as expected on native view but not workspace. I'm not able to figure out a way to pass parameters to ui page when it is opened from workspace client script. I have tried solutions suggested on communities but no luck.

 

@Uday_Kumar , did you manage to work this out?