cancel
Showing results for 
Search instead for 
Did you mean: 

Syntax of Dynamic action?

gerhard_lang
Explorer
0 Kudos

Hello Guys,

I´m struggling with the correct syntax or maybe the understanding of 'dynamic'actions' in VC(7.0). What I intend to do is triggering one event (evt1) or another event (evt2) depending on the value of a table field (@CUSTOMER):

if(isnull(@customer),'EVT1','EVT2')

In my model evt2 is calling some data services and switches to the tab where the results are displayed (I use a layered iView). Without the dynamic action everything is working fine, but I want to supress calling the RFCs with an initial customer no. For certain reasons I don´t want to use the guard condition, this works, I know.

I tried it according to the example from Jarrod

[[/url]

The error message I get is the same as he described, but the eventing is not really taking place.

The only hint that I am not completly wrong is that the event evt2 is apparently triggered as far as the tab is switched, but none of data services is called.

Can anyone give a clear explanation of how dynamic actions are intended to work, what their syntax in VC should be or maybe where some piece of documentation can be found (please not the users guide, the modelers guide etc., they contain no information about it).

Tanks a lot in advance

Gerhard

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Gerhard,

If you are trying to call a Custom action, then the error message about the event not being able to be raised can not be ignored.

The solution - in your form with your button with the dynamic action, you need to add 2 more buttons.

One will need to raise the custom action EVT1, and the other will need to raise the custom action EVT2. Make both of these 2 buttons hidden. Now at compile time, you should no longer get any warnings, and it should give the desired behaviour at runtime.

Cheers,

Ryan

gerhard_lang
Explorer
0 Kudos

Hello Ryan,

I already use the custom action for several data flows but in this case I wanted to use the dynamic action, primarily to learn what can be achieved with it but also to avoid adding the same guard condition to several RFC-calls. The use of custom action in my case (with two buttons as you mentioned) would assume that the user knows under which condition he has to press the button for evt1 or evt2, but here evt1 should take place if there is a faulty condition (eg. @CUSTOMER is initial) and maybe to tell the user via a message what is wrong.

I think that the develpoers of VisualComposer must have thought about certain goal when they added the 'dynamic action' to the system actions. Unfortunately the information seems to having got lost on its way to the documentation.

Nevertheless thank you for your contribution

Cheers

Gerhard

gerhard_lang
Explorer
0 Kudos

Hello Ryan,

Sorry, I didn´t read your answer careful enough. You are right, adding two buttons that are connected with the desired events make the whole thing work (regardless of the name of the buttons).

There is only one thing left: I cannot find any option to hide a single button. I cannot hide the whole toolbar because of the third button I need to start the action with. Is it depending on the VC-version (currently VC 645.7.1)?

Thanks for your answer

Cheers

Gerhard

Former Member
0 Kudos

If these are buttons in a table, then there is no way to make them hidden (I assume this is why you are adding it to the toolbar)?

If they are buttons in a form, then you can add them as fields in the form (not in the toolbar) and you will then have the option to make them hidden (in the properties of the field, under the General tab).

If you are using a table, then the only thing I could suggest is to create a new form, put all 3 buttons on there (making 2 hidden), and then in the Layout tab, overlay your form and table so that at runtime, the 2 elements appear as 1 to the user.

AFAIK - you can't achieve what you are looking for using just the Table view.

Rgds

Ryan

gerhard_lang
Explorer
0 Kudos

Hello Ryan,

I also thought of solving the problem this way in case there would be no other one to hide the buttons (VC does it similarly when creating a value help popup). Anyway, you solved may main problem with your answers, the rest (hoefully) will be finetuning.

Tanks again and bye

Gerhard

Antonio_leites
Participant
0 Kudos

Hi,

concerning with the syntax of dynamic actions..... after the condition you have to write down the action code. This action code has to be in quotation ("). In your example you want a customer action for EVT1 and EVT2 so the syntax in the action formula should be:

if(isnull(@customer),"CMD(EVT1)","CMD(EVT2)").

For instance if you want to prompt some messages if a condition is achieved:

IF(@Date < DADD(now(),-1,'M') ,"PROMPT('Attencion!! lDate older than 1 month. Please check it,')",IF(@Date > now(),"PROMPT('Attention!! date in future.')"," ")).

I hope it helps to understand the syntax of dynamic actions...