How to set value on current form using ui action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2022 03:32 AM
How to set value on current form using ui action.
i have one ui action on incident form
when i click on it it will open one form with two fields from another table
and when i submit it will capture some fields on that form.
but i want it to restrict or create at once only after that it should not allow to create another record from that ui action.
for that i created one check box, when ui action is click then that checkbox should be true and added condition on ui action if false then only visible so another time ui action should not visible.
how to update that checkbox?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2022 03:41 AM
current.field_name_of_checkbox = true;
current.update();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2022 03:43 AM
Thank you for the reply survo
i tried with this but not working mu ui action is not running after adding this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2022 03:53 AM
Can you share your script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2022 04:00 AM
function createrecord() {
var sysId;
if (typeof rowSysId == 'undefined')
sysId = gel('sys_uniqueValue').value;
else
sysId = rowSysId;
var gModalForm = new GlideModalForm('Create new record', 'table name');
gModalForm.setPreference('sysparm_view', 'newview');
gModalForm.addParm('sysparm_query', 'description=' +
g_form.getValue('description').replace(/\^/g, '^^') + '^u_configuration_item=' + g_form.getValue("cmdb_ci") + '^parent=' + g_form.getUniqueValue() + '^classification=Feature' + sysId +
'^sys_class_name=table name');
gModalForm.setCompletionCallback(function(action_verb, sys_id, table, displayValue) {
if (action_verb == 'sysverb_insert') {
if (typeof GlideList2 !== 'undefined') {
if (GlideList2.get("incident.tablename"))
GlideList2.get("incident.tablename").refresh();
}
}
});
gModalForm.render();
}