How to Change state on request using button on custom table

Chaitanya Redd1
Tera Guru

Hello Team,

I have created new custom table in that I have added state field with below choices

New, In progress, On Hold, Resolved, Closed & cancelled. Here I have trying to add buttons on the form

Resolve, Reopen, cancel & close. I have tried to create Resolve button on the form button it's not changing the state field value I have written below script include and Script in ui action as well but didn't worked and I have checked state model it's fine.

 

find_real_file.png

find_real_file.png

 

find_real_file.png

Can anyone help me where I went wrong.

 

Thanks,

Chaitanya

1 ACCEPTED SOLUTION

It will appear as you are just changing the tranistion here and allowing the ticket to move to resolve state from new state.

You can check the condition in the ui action to appear in the states.

Can you try putting the condition in the ui action to appear in the new state. ti will work.as we are just changing the transition into the ui action condition

 

View solution in original post

11 REPLIES 11

Dhananjay Pawar
Kilo Sage

Hi,

In you ui action add simple one line.No need to write Script include and also no need to check client check box in ui action

current.state='4';

Thanks,

Dhananjay.

Check attached screenshot.

find_real_file.png

Hi Dhananjay,

Thanks I have tried it will set state to resolve but I wanted here the flow has to work same as change right when we click request approval on change form state changes to Asses then when it's approved state changes to Authorize and when we click on implement then state changes to implement same as this I'm trying to set state field based on button we click.

If I click on resolve state has to change to resolve and resolve button shouldn't visible it's still visible on the form. I have created state model on this custom table when state is new the resolve is visible when in click on resolve button it's not working in state model I have kept new state transitions condition empty 

 

Thanks

Chaitanya

If you want to hide button then you need to add conditions accordingly.

In UI action condition field is there.

e.g-

current.state=='closed'

If you add above condition in ui action , whenever record is in closed state only that time button will be visible.

Accordingly in which state you want to make visible you have to add conditions.

sample condition - current.state=='closed'||current.state=='pending'