By default, when you add a material or item to a workorder, the value is set to 1. This can be a problem for some entities because laborers can add a item number, select a storeroom then immediate save it without even bothering to enter a quantity. Logically, by default, Maximo doesn’t allow you to save a material or item with a quantity of zero. Of course it shouldn’t because it wouldn’t make sense. But it also doesn’t really make sense to default it to one either, without forcing the user to enter a quantity.
So how do we get around this? You can use the default value control in the application designer but it does have it’s limitations.
Let’s try using the default value control to set field defaults, but I’ll show you why this method doesn’t work.
Open up Application Designer and find and open the WOTRACK module. Click on the Actuals tab and find the Quantity field. Open the control palette and find the Default Value control near the quantity field control. Click on the properties and set the values as such:
I know we ultimately want the default value to be zero, but set it to 10 so you know that the control works. Save your changes and open up the workorder module. You should now be able to add a material with a default quantity of 10.
Now let’s try setting the default value to zero. Go into the application designer again and change the value from 10 to zero. Save your changes and try adding a material again. Notice something? Why is the default value 1, you ask? Without going into too much detail, there is a java class that handles the default value of this field when you click on the “New Row” button. This class basically checks to see if the default value control is zero, and if so, change it to 1. So, you can set the default value to anything other than zero withing application designer and it will work. But this doesn’t really solve our little issue of forcing the user to enter a quantity. There is an easier way to accomplish what we want.
Before we do this, go back into the application designer and delete the Default Value control you just created. You no longer need that.
So to set the default value to zero, go the Database Configuration module. Since we are working with material use, we have to find and open the MATUSETRANS object. Click on the Attributes tab and find the QUANTITY attribute. Expand it by clicking on the blue arrow. You can notice that the Default Value field is set to -1. Change this value to zero and save. That’s it!
Trying adding another material or item to a workorder and magically the default value is now zero. So if a user were to try and save without entering a quantity, they will see this message:
This is exactly what we wanted to achieve. We can now force the user to enter a quantity even it is just 1. How easy was that?