Re: Notification for KM Articles/documents !! (456 Views)
Reply
Advisor
Posts: 36
Registered: ‎02-27-2014
Message 1 of 8 (562 Views)

Notification for KM Articles/documents !!

Hi Experts 

 

Good Day !!

 

i have below requirement in KM Module,

 

Notification mail to creator/author of the KM document, which should trigger before 2 weeks  expiry date of KM document.

 

Kindly help me with the script or any other  approach to accomplish this scenario.

 

Thanks,

Jagan

HP Expert
Posts: 480
Registered: ‎02-15-2010
Message 2 of 8 (529 Views)

Re: Notification for KM Articles/documents !!

Hi Jagan

Here is a discussion that might help

http://h30499.www3.hp.com/t5/HP-Service-Manager-Service/Notification-email-from-KM-Module-in-SM9-3/t...

 

Lisa

"HP Support
If you find that this post or any post resolves your issue, please make sure to mark it as an accepted solution."
HP Expert
Posts: 480
Registered: ‎02-15-2010
Message 3 of 8 (527 Views)

Re: Notification for KM Articles/documents !!

Hi Jagan

Here is another one

http://h30499.www3.hp.com/t5/HP-Service-Manager-Service/How-to-send-notification/td-p/6196255#.U3tej...

 

Lisa

"HP Support
If you find that this post or any post resolves your issue, please make sure to mark it as an accepted solution."
Advisor
Posts: 36
Registered: ‎02-27-2014
Message 4 of 8 (508 Views)

Re: Notification for KM Articles/documents !!

Hi Lisa,

 

Thanks for your reply, yes i have checked these links but i need to know the procedure how to acheive this,

 

i am not good at scripting , and i belive this can be done using javascript and we need to run the sceheduler which will check for the KM document before 2 weeks of expirration and will send a notification to the author of the document.

 

can any one help me on this how i can achieve this ,since this is very urgent for me.

 

Thanks in Advance,

 

jagan

Advisor
Posts: 36
Registered: ‎02-27-2014
Message 5 of 8 (489 Views)

Re: Notification for KM Articles/documents !!

Hi All,

 

I have written the following script in Script library,its compiling but if i mannually execute the script nothing is happening,

 

no emails are triggering, kindly help me on this where i am doing mistake,

 

function KMexpirydocs()
{
var kmArticle = new SCFile("kmdocument");
var today=new Date();
var oT=kmArticle.expiration_date;
var Minutes=1000 * 3600 * 24;
do
{
var query=Math.ceil(oT.getTime()-today.getTime())/Minutes;
if(query > 1)
{
var rteReturnValue = new SCDatum();
var rteNames = new SCDatum();
var rteValues = new SCDatum();
var argNames = new SCDatum();
var argVals = new SCDatum();
var argVal=new SCDatum();

// Parameter names for RAD app us.notify

rteNames.push("name");
rteNames.push("record");
//Parameter values
rteValues.push("KMExpiryDocs");//Notification Name
rteValues.push("kmArticle");

system.functions.rtecall("callrad",
rteReturnValue,
"us.notify",
rteNames,
rteValues,
false); //run in same thread
}

else

print("No Expire Documents found")
}
while(kmArticle.getNext() == RC_SUCCESS)
}

 

Thanks,
JAgan

Advisor
Posts: 36
Registered: ‎02-27-2014
Message 6 of 8 (468 Views)

Re: Notification for KM Articles/documents !!

Hi All,

 

The below script is executing but on the screen i can see notification message, and event out record is not getting generated,

 

Alos,this script selecting only one record and executing, if i have 5 KM docs that are being expire by 2 or 3 days, script work for first record only.

 

Please help me, how can i send the notification if i have more KM docs.

 

Escalation()
function Escalation()
{
var f= new SCFile( "kmdocument" );
f.doSelect( "author = \"falcon\"" );
var oT=f.expiration_date;
while(oT != null)
{
var today=new Date();
var Minutes=1000 * 3600 * 24;
var rteReturnValue = 1
if((Math.ceil((oT.getTime()-today.getTime()))/Minutes) > 0)
{
system.functions.rtecall("callrad", rteReturnValue, "us.notify",
["name", "record"], ["KMExpiryDocs",f], false);
oT=null;
}
else
print("No Expiry docs")
}
print("End Test")
}

Regular Advisor
Posts: 106
Registered: ‎09-10-2013
Message 7 of 8 (459 Views)

Re: Notification for KM Articles/documents !!

try this

 

Escalation()
function Escalation()
{
 var f = new SCFile( "kmdocument" );
f.doSelect( "author = \"falcon\"" );
var oT=f.expiration_date;
var rc = f.doSelect(oT != null);
while(rc == RC_SUCCESS)
{print(oT);
var today=new Date();
var Minutes=1000 * 3600 * 24;
var rteReturnValue = 1
if((Math.ceil((oT.getTime()-today.getTime()))/Minutes) > 0)
{
system.functions.rtecall("callrad", rteReturnValue, "us.notify",
["name", "record"], ["KMExpire",f], false);
//oT=null;
}
else
print("No Expiry docs")
rc = f.getNext();
}
print("End Test")
}

Regular Advisor
Posts: 106
Registered: ‎09-10-2013
Message 8 of 8 (456 Views)

Re: Notification for KM Articles/documents !!

{
 var f = new SCFile( "kmdocument" );
f.doSelect( "author = \"falcon\"" );
var oT=f.expiration_date;
var rc = f.doSelect(oT != null);
while(rc == RC_SUCCESS)
{print(oT);
var today=new Date();
var Minutes=1000 * 3600 * 24;
var rteReturnValue = 1
if(oT>system.functions.tod() && (Math.ceil((oT.getTime()-today.getTime()))/Minutes) > 0)
{
system.functions.rtecall("callrad", rteReturnValue, "us.notify",
["name", "record"], ["KMExpire",f], false);
//oT=null;
}
else
print("No Expiry docs")
rc = f.getNext();
}
print("End Test")
}

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.