Objective: Create the ability to generate and display a case number when creating a new case.
In the current state of the application when the user clicks the ‘create a case’ button the client info panel will be displayed. What we want to do is create a case that we are going to populate. Begin by opening the UI Manager.
Inside the UI Manager we are going to create a new function to create new cases, this is going to signify that the use is taking the create new case route and we need a new case to work with.
This method is going to create a new case, and then we are going to assign it to a variable.
When create new case is called, we are going to create a new case, and we want to assign a case number randomly from 0 to 999. Afterwards we are going to assign the random case ID number to the active case ID number.
Now when you select the create a file button you will generate a case number in the inspector. We now need to set that to the text object on the client info panel. Using an on enabled method we can grab the text object and set it to the active case ID.
Since we are using the on enable method, we need to change the method in which we call this panel. Instead of using the on click events we are going to use code. Create variables for the client info panel, as well as the border panel. After the active case ID has been generated, then we can activate the panel objects.
Now all that is left is to save your seen and test it out.
Now we understand how to create a new case and to generate and display some of its properties. Don’t be afraid to experiment with your code, and I’ll see you in the next tutorial!