on 2023 Nov 15 9:26 PM
I'm using the following code in my groovy script to hide or show a button and a table controller in the form. But this is not working and not making any difference in the show/hide of the screen elements. This script is called on a button click in SAP advanced workflow form.
form.getButton(<button_name>).hide()
form.getWidget(<table_controller_name>).hide()
and
form.getButton(<button_name>).show()
form.getWidget(<table_controller_name>).show()
If someone can hep me in finding where I'm missing something then it will be greatly appreciated.
Request clarification before answering.
Hi,
In SAP Advanced Workflow, names of objects are used on screen, to see which object is, in a nice, human readable way. But when you reference some object in the script, you need to reference it with its system id, not with its name. In Form Designer, there is field 'System id' , and when you add an element, you need to enter a value for the System ID there if you want to access that element from your scripts.
If you want to hide one element try:
form.getField('my_cystom_field_system_id').hide();
form.getButton('my_button_system_id').hide();
If you wish to hide several fields, or entire reusable form, you can put them all inside a Section element in the Form Designer, and then hide that section, like this:
def section = form.getWidget('section_system_id');
section.hide();
The script which is doing show/hide things needs to be a 'Form Event' script, and it needs to be attached on appropriate Event on your action.
If you have further questions, or need additional explanations on something, feel free to ask.
Best regards
Lana
(Product Owner of SAP Advanced Workflow)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kashvi_Anaisha,
Unfortunately we don't have scripting methods to show/hide 'Add', 'Delete' and 'Select All' on Table Controllers.
These options can be either always turned on or off on entire Table Controller (in Setup->Fields and Forms -> Custom Fields , then find desired Table Controller, click Edit, then click Customise Table Controller)
Best regards
Lana
thank you @Lana
User | Count |
---|---|
78 | |
11 | |
9 | |
8 | |
7 | |
5 | |
4 | |
4 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.