- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-21-2024 04:58 AM
I want to create a button visible only workspace such taht after clicking it make additional comment madetory and after filing it, it will go to next state . How to proceed?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-21-2024 05:21 AM - edited ‎08-21-2024 05:28 AM
Hi @Rosy14 ,
Create a UI Action,
In the workspace client script,
function onClick(g_form) {
g_modal.showFields({
title: "Enter your reason",
fields: [{
type: 'textarea',
name: 'comments',
label: getMessage('Reason'),
mandatory: true
}],
size: 'lg'
}).then(function(fieldValues) {
g_form.setValue('comments', fieldValues.updatedFields[0].value);
g_form.setValue('state',[Backend value of the state];
g_form.save();
});
}
On clicking of the UI action, a popup will populate to fill mandatory Additional comments.
Clicking Ok will map it to additional comments and state changes to state mapped in. (Add the state from the last 4th line of the code).
If this information helps you, kindly mark. it as Helpful and Accept the solution.
Regards,
Najmuddin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-21-2024 07:01 AM
Hi @Rosy14 ,
Move the incident state to InProgress and according to my code, it changes back to New state.
g_form.setValue('state',1); // 1 is the backend value of New.
Regards,
Najmuddin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-21-2024 07:25 AM
I tried that way. I tried to update description also, this is updating only state is not
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-21-2024 08:11 AM
Hi @Rosy14 ,
can you share the code that you have written, the table on which it is written and what's your exact requirement. (which state should be changed).
Happy to help.
Regards,
Najmuddin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-21-2024 08:24 AM
Workspace client script
function onClick(g_form) {
g_modal.showFields({
title: "Enter Additional comments",
fields: [{
type: 'textarea',
name: 'comments',
label: getMessage('Reason'),
mandatory: true
}],
size: 'lg'
}).then(function(fieldValues) {
g_form.setValue('state',18);
g_form.setValue('description',"Test");
g_form.setValue('comments', fieldValues.updatedFields[0].value);
g_form.save();
});
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-21-2024 10:35 AM - edited ‎08-21-2024 10:36 AM
Hi @Rosy14 ,
One thing to consider is make sure to have State and Description field on the form. Since we are updating using g_form which is client side, the fields need to be on the form. Sharing the images and also attaching the update set xml.
UI Action name : Awaiting Info community.
I hope it will help you.
Regards,
Najmuddin.