Highlighted
Norita Super Contributor.
Super Contributor.
171 views

Message Pop Up using Javascript in a Rule SM 9.34

Jump to solution

Hi, I'm working with SM Version: 9.34.2003 build P2  and I've been reading this post :

/t5/Service-Manager-Service-Center/Pop-Up-Message-Box-Use-Javascript/m-p/6777873#M127999

because I'm trying to validate a date field against the calholidays table and the messages must be validation type not information only, for the user to change the date properly.

I've attached the javascript code in this post.  Perhaps I'm doing it wrong and "Message Box: eval script" is not available in SM 9.34  or there's another way to do it (or there's no way).

Thanks in advance

Good questions will have Good answers
0 Likes
1 Solution

Accepted Solutions
Norita Super Contributor.
Super Contributor.

Re: Message Pop Up using Javascript in a Rule SM 9.34

Jump to solution

I've made it :

var dia;
dia=system.functions.dayofweek(record.planned_start);
var hora1=record.planned_start;
var hora=hora1.getHours();
var tconline=record.tc_online;

var fileholidays=new SCFile("calholidays");
var sql="true";
var salir="false";
var rc=fileholidays.doSelect(sql);

if (dia != "6" && dia != "7")
{
if ((hora<="18" || hora>"09") && tconline=="NO")
{
returnCode = 1;
message=system.functions.scmsg (2007, "cm3", ["El Inicio de implementación programado no corresponde a lo expresado en el campo ¿Se ejecuta durante el Online?. Verifique los datos, de lo contrario no podrá avanzar"]);
}
}

Best Regards,

Good questions will have Good answers
0 Likes
2 Replies
Carlos_V_SM Acclaimed Contributor.
Acclaimed Contributor.

Re: Message Pop Up using Javascript in a Rule SM 9.34

Jump to solution

Hi Norita,

hope you are doing fine.

are you receiving any error message or validation message after the changes made? or what is the behaviour of the system after changes.

Carlos Villalobos R
Customer Support Engineer
If you find that this or any other post resolves your issue, please be sure to mark it as an accepted solution.
If you are satisfied with anyone’s response please remember to give them a KUDOS by clicking on the STAR at the bottom left of the post and show your appreciation.
0 Likes
Norita Super Contributor.
Super Contributor.

Re: Message Pop Up using Javascript in a Rule SM 9.34

Jump to solution

I've made it :

var dia;
dia=system.functions.dayofweek(record.planned_start);
var hora1=record.planned_start;
var hora=hora1.getHours();
var tconline=record.tc_online;

var fileholidays=new SCFile("calholidays");
var sql="true";
var salir="false";
var rc=fileholidays.doSelect(sql);

if (dia != "6" && dia != "7")
{
if ((hora<="18" || hora>"09") && tconline=="NO")
{
returnCode = 1;
message=system.functions.scmsg (2007, "cm3", ["El Inicio de implementación programado no corresponde a lo expresado en el campo ¿Se ejecuta durante el Online?. Verifique los datos, de lo contrario no podrá avanzar"]);
}
}

Best Regards,

Good questions will have Good answers
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.