Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Syntax for error message with a variable?

Avatar

Level 2

Is it possible to insert a variable in an error message in input forms? Non working sample code for illustration:

<check expr="[/tmp/@validationResult] == ''">
   <error>$([/tmp/@validationResult)</error>
</check>
1 Accepted Solution

Avatar

Correct answer by
Level 5

Hi @_lukas_ , unfortunately I think this is not possible as you try to do it (did not ever seen that).

But I know you can call the "alert()" method into a JS function with the <soapCall>, it will display a popup just as the alert method in a web browser. (it was available in a 6.0X instance, but should still work today)

It's not very simple, you have to declare a method (into a Schema), implement it in a JS, call it with argument (soapCall > param etc.) to do your check and alert if necessary.

If needed, you can make a general function to display messages to re-use it.

Hope this could help.

(Method implementation : https://experienceleague.adobe.com/docs/campaign-classic/using/configuring-campaign-classic/api/web-...

and https://experienceleague.adobe.com/docs/campaign-classic/using/configuring-campaign-classic/schema-r... (don't forget to declare the @library as mentioned in the doc, the function must be named as xxx_schema_Method() pattern in the js file)

SoapCall into forms : https://experienceleague.adobe.com/docs/campaign-classic/using/configuring-campaign-classic/input-fo...)

Cedric

 

View solution in original post

2 Replies

Avatar

Correct answer by
Level 5

Hi @_lukas_ , unfortunately I think this is not possible as you try to do it (did not ever seen that).

But I know you can call the "alert()" method into a JS function with the <soapCall>, it will display a popup just as the alert method in a web browser. (it was available in a 6.0X instance, but should still work today)

It's not very simple, you have to declare a method (into a Schema), implement it in a JS, call it with argument (soapCall > param etc.) to do your check and alert if necessary.

If needed, you can make a general function to display messages to re-use it.

Hope this could help.

(Method implementation : https://experienceleague.adobe.com/docs/campaign-classic/using/configuring-campaign-classic/api/web-...

and https://experienceleague.adobe.com/docs/campaign-classic/using/configuring-campaign-classic/schema-r... (don't forget to declare the @library as mentioned in the doc, the function must be named as xxx_schema_Method() pattern in the js file)

SoapCall into forms : https://experienceleague.adobe.com/docs/campaign-classic/using/configuring-campaign-classic/input-fo...)

Cedric

 

Avatar

Level 2

@CedricRey  Thank you so much for that suggestion! I had already done the soap-method for validation, so your approach was even more simple 🙂