The CreatorCon Call for Content is officially open! Get started here.

[Help] How to create a Pop up error message for a variable in catalog items

SUDCHAK
Tera Contributor

If a variable of type date/ time or just date is created then in the client scripts what should be coded if the user enters previous/future date where the variable accepts only future/previous date, for this an error message should pop up just around the variable field?

3 ACCEPTED SOLUTIONS

Danish Bhairag2
Tera Sage

Hi @SUDCHAK ,

 

U can create a UI policy for this mentioning in the condition if date field is before today . Then go to ur script tab n select run for all n under when condition is true u can specify the alert or field message

 

Thanks,

Danish

 

View solution in original post

Hi @SUDCHAK ,

 

In order to showcase error for a respective field u can try this

 

g_form.showFieldMsg('variable_name','Enter your message here','error');

 

Thanks,

Danish

 

View solution in original post

Hi @SUDCHAK ,

 

Plz do not use at or before as it will consider today as well I mean if some1 selects today then also error will show.

 

N instead of date select today from drop-down. Else it will always consider 19 as the reference.

 

N yes make the UI type as ALL if u r running on portal.

 

Thanks,

Danish

 

View solution in original post

13 REPLIES 13

But that is for applying conditions, here my requirement is to make appear a pop-up error message if a wrong entry in date/time or just date variable is made, which should appear just above or below the variable field.

Hi @SUDCHAK ,

 

In order to showcase error for a respective field u can try this

 

g_form.showFieldMsg('variable_name','Enter your message here','error');

 

Thanks,

Danish

 

Thanks a lot Danish for this answer, tried it out, totally working for me.

Thanks Again.

Aniket Chavan
Tera Sage
Tera Sage

Hello @SUDCHAK,

Firstly decide whether you want to restrict past dates or future and then Yes you can display the error message next to the variable and for that you can refer this "How to display error message next to a variable in the Service Catalog" community post as well.

Display Field Message (error) when past date selected on Date Type Variable

Let me know your views on this and Mark Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.


Regards,
Aniket