I want to create the UI action button along with state model.

dhineshkumar
Tera Guru

Hi Team 

I have a custome table and I want to ceate the button like work in progress. When I click on the work in progress button state model should move to new to work in progress. Before moving to the work in progress it should ask the  mandatory of the worknotes. 

dhineshkumar_0-1720975755698.png

Thank in advance.

 

1 REPLY 1

Bhavya11
Kilo Patron

hi @dhineshkumar 

 

please follow the these steps

 

Create UI action on your custom Table:

provide below detailed(note: select the custom table where you want to show the button)

 

 

Bhavya11_1-1721017232110.png

 

in side the script section past below code

 

function CheckMantroy() {
    g_form.setMandatory("work_notes", true);
    gsftSubmit(null, g_form.getFormElement(), 'caseworking');//caseworking is same name of your action name
}

if (typeof window == 'undefined')
    createKbFromIncident();

function createKbFromIncident() {

    current.state = 10;// please add your work in progress state value here
    current.update();
    action.setRedirectURL(current);

}

 

 

 

If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful."

 

 

Thanks,

BK