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
BedrockMission!

Learn More

View all

Sign in to view all badges

Web application - Call Error page in Script

Avatar

Avatar
Validate 1
Level 2
tejashriw155148
Level 2

Likes

12 likes

Total Posts

70 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Give Back 5
Give Back 3
Give Back
Boost 5
View profile

Avatar
Validate 1
Level 2
tejashriw155148
Level 2

Likes

12 likes

Total Posts

70 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Give Back 5
Give Back 3
Give Back
Boost 5
View profile
tejashriw155148
Level 2

10-07-2020

Hi,

 

In web application, I have added code in script and want to call error page message(location- web application properties>Error page tab) in script.

tejashriw155148_0-1594387942716.png

 

 

Example:

code in script like

 

if (condition==true)

{

}

else{

//display error page message

}

 

Any suggestions?

 

Regards,

Tejashri

 

 

 

Accepted Solutions (0)

Answers (1)

Answers (1)

Avatar

Avatar
Affirm 100
MVP
_Manoj_Kumar
MVP

Likes

115 likes

Total Posts

327 posts

Correct Reply

100 solutions
Top badges earned
Affirm 100
Validate 1
Contributor
Ignite 1
Shape 1
View profile

Avatar
Affirm 100
MVP
_Manoj_Kumar
MVP

Likes

115 likes

Total Posts

327 posts

Correct Reply

100 solutions
Top badges earned
Affirm 100
Validate 1
Contributor
Ignite 1
Shape 1
View profile
_Manoj_Kumar
MVP

10-07-2020

Hello @tejashriw155148,

 

Error page comes in action when there is some issue with the page and the error page content is displayed.

 

If you want to show error then you can store that error in content variables like 

ctx.vars.line1="ERROR_2_CONTENT HERE";
ctx.vars.line2="ERROR_2_CONTENT_HERE";

 

and then you can print the error like this.

<%if (condition==true){
your logc here
}else{
%>
<%= ctx.vars.line1 %>
<%
}
%>

 

Let me know if that works.