Ui button on workspace

Rosy14
Tera Guru

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?

1 ACCEPTED SOLUTION

Najmuddin Mohd
Mega Sage

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).

NajmuddinMohd_1-1724243327106.png

 

NajmuddinMohd_0-1724243297624.png

 



If this information helps you, kindly mark. it as Helpful and Accept the solution.

Regards,
Najmuddin.

View solution in original post

10 REPLIES 10

Najmuddin Mohd
Mega Sage

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).

NajmuddinMohd_1-1724243327106.png

 

NajmuddinMohd_0-1724243297624.png

 



If this information helps you, kindly mark. it as Helpful and Accept the solution.

Regards,
Najmuddin.

Thanks. working

Hi @Rosy14 ,

Nothing it's just empty.

NajmuddinMohd_0-1724245758514.png


Regards,
Najmuddin.

It is working but the state value is not changing btw.