- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-11-2022 09:29 AM
Hello All,
We have custom table where we have UI action (Create Knowledge Base) which should redirect to Knowledge article new record when clicked on it. we are able to navigate and populate the field from custom table form to knowledge article from. Once the knowledge article is created we wanted to show the article created from them has to shown in related list. so I have created a field(Instruct Model) on knowledge article form which is reference to field on a custom table.
So now I want to populate the value from custom field to the reference field on article table .I am not able to auto populate the reference field with the value from field from custom field to relate the show in the related list .
UI Action:
Expected result :
When clicked on create knowledge button , we are able to populate other field value from custom table to article new page but not able to populate the Experience ID with the experience ID from custom table:
CC: @Ankur Bawiskar , Thanks in Advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2022 08:03 AM
Hello,
Please use the below code:- In place of replaceknowledgeexpidfieldname enter the backend name of the Experience ID field on knowledge table
function createKnowledgeBase() {
var mName = g_form.getValue('instruct_model_name');
var mUrl = g_form.getValue('instruct_model_url');
var nDesc = g_form.getValue('model_description');
var expid= g_form.getUniqueValue();
var link = '<a href= ' + mUrl + ' target=_blank>Click here to launch</a>';
var mImg = '<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/d/d0/QR_code_for_mobile_English_Wikipedia.svg/2..."/>';
g_navigation.open("/kb_knowledge?sys_id=-1&sysparm_query=replaceknowledgeexpidfieldname="+expid+"^short_description= " + mName +
"^x_care3_carear_cus_instruct_model=" +mName +
"^text =" + '<h1> <strong> ' + mName + ' </strong></h1> ' +
'<br/>' + '<h2>' + nDesc + '</h2> ' +
'<br/>' + '<h2>' + link + '</h2> ' +
'<br/>' + mImg, "_blank");
Please mark my answer as correct based on Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-11-2022 10:11 AM
Hello,
Is the code to copy from one table to other there in the UI action? Can you paste the complete code of the UI action so that we can have a look and assist you.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2022 07:39 AM
Hey ,
Yeah we are trying to copy values from custom table to Knowledge article new record form when we click on UI action. Where we are not able to copy a value from field in custom table to the reference field on Knowledge article form.
Note: Reference field on knowledge article is field referring to the same custom table which has UI action.
UI Action script.
function createKnowledgeBase() {
var mName = g_form.getValue('instruct_model_name');
var mUrl = g_form.getValue('instruct_model_url');
var nDesc = g_form.getValue('model_description');
var link = '<a href= ' + mUrl + ' target=_blank>Click here to launch</a>';
var mImg = '<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/d/d0/QR_code_for_mobile_English_Wikipedia.svg/2..."/>';
g_navigation.open("/kb_knowledge?sys_id=-1&sysparm_query=short_description= " + mName +
"^x_care3_carear_cus_instruct_model=" +mName +
"^text =" + '<h1> <strong> ' + mName + ' </strong></h1> ' +
'<br/>' + '<h2>' + nDesc + '</h2> ' +
'<br/>' + '<h2>' + link + '</h2> ' +
'<br/>' + mImg, "_blank");
Custom Table : UI Action, We are passing values from this form, We are able to send experience name, URL and we want to display knowledge articles that will be created from this form should be shown in the related list.
Knowledge Article: I want to copy experience ID from above screen shot to experience ID field in article form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2022 08:03 AM
Hello,
Please use the below code:- In place of replaceknowledgeexpidfieldname enter the backend name of the Experience ID field on knowledge table
function createKnowledgeBase() {
var mName = g_form.getValue('instruct_model_name');
var mUrl = g_form.getValue('instruct_model_url');
var nDesc = g_form.getValue('model_description');
var expid= g_form.getUniqueValue();
var link = '<a href= ' + mUrl + ' target=_blank>Click here to launch</a>';
var mImg = '<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/d/d0/QR_code_for_mobile_English_Wikipedia.svg/2..."/>';
g_navigation.open("/kb_knowledge?sys_id=-1&sysparm_query=replaceknowledgeexpidfieldname="+expid+"^short_description= " + mName +
"^x_care3_carear_cus_instruct_model=" +mName +
"^text =" + '<h1> <strong> ' + mName + ' </strong></h1> ' +
'<br/>' + '<h2>' + nDesc + '</h2> ' +
'<br/>' + '<h2>' + link + '</h2> ' +
'<br/>' + mImg, "_blank");
Please mark my answer as correct based on Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2022 07:49 AM
I can see you are just passing only 3 fields but not the Experience ID field value.
Let me know if I misunderstood your code.
Murthy