Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team,
I have a button which launches the external URL.
I would like to launch only if the user selects few mandataory fields ,if not just display an error message.
Thanks & Regards
Jeba
Hi Jebamalai,
you can use the Enable Condition field in the General tab of the button properties window as shown in the figure attached below.
You can control if the user selects a certain field using GetSelectedCount(YOUR_FIELD_1)>0 expression.
If you have more fields you can just AND them like this:
GetSelectedCount(YOUR_FIELD_1)>0 AND GetSelectedCount(YOUR_FIELD_2)>0 AND ...
If you want to make an error message appear in a popup window you should use a macro.
Regards,
Giacomo
Hi,
send your initial script please.
Thanks in advance
André Gomes
Hi Andre,
There is no specific script involved here.
In the Button click - > Add ->External->Launch->Application - Here is my URL.
Thanks & Regards
Jeba
Any help will be highly appreciated
Hi Jebamalai,
you can use the Enable Condition field in the General tab of the button properties window as shown in the figure attached below.
You can control if the user selects a certain field using GetSelectedCount(YOUR_FIELD_1)>0 expression.
If you have more fields you can just AND them like this:
GetSelectedCount(YOUR_FIELD_1)>0 AND GetSelectedCount(YOUR_FIELD_2)>0 AND ...
If you want to make an error message appear in a popup window you should use a macro.
Regards,
Giacomo
You could take Giacomo's idea a little bit further and use the button to show an error text box if the proper selections are not made. You could add to actions to your Button, one which launches the URL and another that conditionally sets a variable. So for your url launch you could do an if statement like:
if GetSelectedCount(Field1) >0 and GetSelectedCount(Field2) >0, Launch URL)
Then on your Variable setting action do
if GetSelectedCount(Field1) <> 0 and GetSelectedCount(Field2) <>0, 1, 0)
Use this variable to conditionally show a text box that would pop up (hide or undhide) based on the variable switched above. If i use an error box like that i put another button in the top corner of the box that uses the same hide/unhide condition to reset the variable to zero and allows the user to 'Cancel' the error box. Thus removing it from the screen.
If you want to use a macro you can:
1 - set a variable (Ctrl+Alt+V) vButtonEnabled=if(GetSelectedCount(Field1)>0 and GetSelectedCount(Field2)>0, 1, 0)
2 - add a Run Macro action to the button
3 - create the macro like in the figure
Note: substitute RunExe ("YOUR_PATH") with CreateObject("WScript.Shell").Exec("YOUR_PATH") in the script to launch the app.
In this case every time the user clicks on the button, the macro values the variable and if it is equal to 1 (the fields required are selected) launches the application, otherwise shows a popup window with the error message.
Regards,
Giacomo
Attached is a QVW example, It would be one option, and is nothing pretty but demos the concept.
Hi Charles,
It seems working and I am testing now.
Thanks & Regards
Jeba
Hi Giacomo,
This worked exactly what I want and thanks a lot for that.
Thanks & Regards
Jeba