Question
How can some field in PBA control panel be marked as required? For example, your staff members create accounts using provider's control panel and it is important to have a tax zone or sales branch filled.
Answer
It can be done via customization of PBA interface:
Locate the screen you need to customize, prepare a container. The steps are described in the documentation:
- Create a customization file for the screen, find
<elements>
part of the file, find a necessary element (details are in the documentation by link above, "Creating customization file" part) - Add
required="yes"
attribute for needed element - Make sure that you have removed all elements and their attributes that are not used in customization
Restart www container to apply changes:
/etc/init.d/www restart
Note, it is possible to make an optional field obligatory, but it is not possible vise versa. If a fields is marked as obligatory in the default, not customized PBA, that means that the method executed on the button click expects the argument this field passes. If an argument is not passed, the method cannot be executed.
Example
Task
Make a Sales Branch
required field when creating an account from the provider's control panel.
Solution
Make sure the directory
/usr/local/bm/conf/wnd/BM/customization/customization
is a symlink to/usr/local/bm/customization
:# ls -ld /usr/local/bm/conf/wnd/BM/customization/customization /usr/local/bm/conf/wnd/BM/customization/customization -> /usr/local/bm/customization
If not, configure it:
# cd /usr/local/bm/conf/wnd/BM/customization # ln -s /usr/local/bm/customization customization
- Copy
Account_AddCustomerWin.xml
from~bm/customization
- Remove the
actions
and thelayout
sections. Leave only thewindow ID
andelements
section. - Leave only required element which is
BranchIDBranchID
, addrequired="yes"
Eventually you should get the customization file as following:
<window id="Account_AddCustomerWin"> <elements> <input id="BranchIDBranchID" required="yes"/> </elements> </window>
Restart www:
/etc/init.d./www restart
As a result you will see an asterisk near required field: