How to set value on current form using ui action

shweta14
Tera Contributor

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?

6 REPLIES 6

suvro
Mega Sage
Mega Sage

current.field_name_of_checkbox = true;

current.update();

shweta14
Tera Contributor

Thank you for the reply survo

 

i tried with this but not working mu ui action is not running after adding this.

Can you share your script?

shweta14
Tera Contributor

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();
}