UI action for a choice list

Lana2xp
Tera Contributor

2) Create a field in the 'Detailed Inventory Control' table: Field Name: Status Type: Choice Options: (New, In Progress, Completed)

3) Define the 'Status' field, created above, as read-only;

..already done .

Theses steps from here i have really tried many times and nothing happen please help me !

4) Whenever a new item is created in the 'Detailed Inventory Control' table, the value of the Status field should be 'New';

5) Create an Action UI to change status field: - Button Name: 'In Progress'; - When display: Only when status field is 'New'; - What it should do: Change the status field to 'In Progress'

6) Create a new Action UI to change field status: - Button name: 'Done'; - When display: Only when status field is 'In Progress'; - What it should do: Change the status field to 'Done'

1 ACCEPTED SOLUTION

jcfourie
Kilo Expert

Elaine



This looks relatively simple, are you running into errors or problems or are you just unsure about how to do it?



4. What you need to do is set the default value for the field status to "New"


5. Simply create a new UI Action with the following values:



Name: In Progress


Table: Detailed Inventory Control


Action Name: In Progress


Form Button: CheckedCondition: current.status == 'New'


script:


                  current.status = 'In Progress'


                  current.update();



And you would do something very similar for 6, just change the values. Keep in mind this is very basic version of this script, you should ideally restrict it based on the user as well as encapsulate the code in a function for best-practice. But this will get the job done.


View solution in original post

4 REPLIES 4

jcfourie
Kilo Expert

Elaine



This looks relatively simple, are you running into errors or problems or are you just unsure about how to do it?



4. What you need to do is set the default value for the field status to "New"


5. Simply create a new UI Action with the following values:



Name: In Progress


Table: Detailed Inventory Control


Action Name: In Progress


Form Button: CheckedCondition: current.status == 'New'


script:


                  current.status = 'In Progress'


                  current.update();



And you would do something very similar for 6, just change the values. Keep in mind this is very basic version of this script, you should ideally restrict it based on the user as well as encapsulate the code in a function for best-practice. But this will get the job done.


Abhinay Erra
Giga Sage

What are the choice values of In Progress and Completed not the choice labels. Right click on the status field and go to show choice list and see what is the choice value.


hey Abhinay , i put the same as the labels ....  


Abhinay Erra
Giga Sage

If that is the case, then Juan's code should work