How to find the current form name for a list context menu in an UI Action?

mkm1
Mega Guru

I have a form which includes related list, From this related list  a list context menu is invoked  which initiates an UI action and directs to another form.  Following is the script in the UI Action which redirects it to a form in another table:

var fundURL="table_name.do?sys_id=-1&sysparm_query=called_from=fyr^fy_requirement="+current.sys_id;
gs.setRedirect(fundURL)

I want to find out the form from which list context menu was invoked and pass that as a value in  argument called_from.

 

I have tried var f_name= current.getRecordClassName(), var f_name= current.getTableName() etc which returns the table name of related list not the parent table name. Is there a way to find out the form from which the list context menu was invoked?

1 ACCEPTED SOLUTION

Mark Stanger
Giga Sage

How about this?

parent.getTableName()

If you only want this to run for a related list action you might consider wrapping your code in this type of check...

// Only run for related lists, not standard lists
if (RP.isRelatedList()) {
    // Do something
}

 

View solution in original post

2 REPLIES 2

Mark Stanger
Giga Sage

How about this?

parent.getTableName()

If you only want this to run for a related list action you might consider wrapping your code in this type of check...

// Only run for related lists, not standard lists
if (RP.isRelatedList()) {
    // Do something
}

 

mkm1
Mega Guru

Thanks Mark, that was very helpful.