'Edit request form' widget in service portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2020 11:38 PM
Hi All,
We have 'Edit request form' widget on portal , when we raising request variables are working as expected ( based on Catalog ui policy and client script , some are visible , few are mandatory etc...) ,
But when i click on 'Edit request form' its showing all variables (not worked ui policy/client script) , i want to hide few of variables , here CATALOG UI POLICY or CLIENT SCRIPTs are NOT working , please find related screen shots and used widgets ...
Kindly help on widget to hide few variables on portal view , I'm using attached widget in CSM portal view , when i click on "Edit Request Form" button all variables appearing in editable view.
I want to hide few variables , kindly suggest me server script where can i add code to hide those variables
Catalog form showing on below url
https://instance.service-now.com/csm?id=csm_cat_item&sys_id=4ea0287adbc13b047654273605961978
After click on 'edit form' button navigating to below url and appearing all variables
https://instance.service-now.com/csm?id=csm_request_edit&sys_id=aa7456f6db10d0d0765427360596190b&table=sn_customerservice_case
(function(){
var gr = $sp.getRecord();
var table = gr.getTableName();
data.canRead = gr.canRead();
if (!data.canRead)
return;
//determines editablity based on the request's stage
//request is not editable while pending approval or after being approved.
data.isEditable = checkStage(gr.u_stage);
var agent = "";
var a = $sp.getField(gr, 'assigned_to');
if (a != null)
agent = a.display_value;
var list = "approval";
var fields = $sp.getFields(gr, list);
if (gr.getValue("sys_mod_count") > 0)
fields.push($sp.getField(gr, 'sys_updated_on'));
data.tableLabel = gr.getLabel();
data.variables = $sp.getVariablesArray();
data.fields = fields;
data.approval = fields.approval;
data.table = table;
data.sys_id = gr.getUniqueValue();
})();
function checkStage(stage) {
var editableStages = gs.getProperty('custom.list.csm.request_editor.visibility_stages').toString();
if(editableStages.indexOf(stage) >= 0) {
return true;
}
return false;
}
-
DOC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2020 05:04 AM