Highlighted
Micro Focus Expert
Micro Focus Expert
159 views

Close related Quote when interaction is closed

Hi Experts,

we are having HP service manager 9.35.

I'm stuck in a issue :

A SD (interaction) has a related Quote.

I'm trying to close the quote which is in last phase, when the SD (interaction) is closed. Which is happening perfectly by a script placed in trigger records of incidents.

Now the issue is when I'm closing the SD from a connect-it scenario created , it is closing the interaction, but not the related Quote record. Manually which is happening as mentioned above.

I have tried placing the script in Display options , Process record but the script of closing quote record is not getting executed when the connect it scenario is executed.

I don't want to place the script in schedular since to avoid performance issue, may be use it as last resort.

Any help in this regard is appreciated.

Kindly suggest
Neo

 

0 Likes
5 Replies
Highlighted
Super Contributor.
Super Contributor.

Re: Close related Quote when interaction is closed

Hello,

Does the CIT scenario use eventin records or web services to close the SD?

LPP

Global Support Delivery Software Support Expert

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
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: Close related Quote when interaction is closed

Hi PLP,

Im using HPSM Web services connector,

Extacess record look like as below:

 

Capture.JPG

 

Trigger script:

Trigger Name: QuoteStatus

Table Name: incidents

Trigger Type: 4 - After Update

if (vars.$file.open=="Closed")
{
var frelation = new SCFile("screlation");
var findquote = frelation.doSelect('source="'+ vars.$file.incident_id +'" and source.filename="incidents" and depend.filename="ocmq" and depend.active="true"');
//print ("SR no. related to" + " " + vars.$file.incident_id + " is" + " " +frelation.depend )

if (findquote == RC_SUCCESS)
{
do
{
var srvreq = new SCFile("ocmq");
var matchreq = srvreq.doSelect("number=\""+ frelation.depend + "\"")
oldstat = srvreq.zstatus;
if (matchreq == RC_SUCCESS)
{
srvreq.zstatus = "closed";
var z = system.vars.$update_action.toArray();
//print( "The update action field array contains the following: " + z );
var a = srvreq.comments.toArray();
//print( "The comments field array contains the following: " + a );
//print( "Pushing first array entry..." );
var d = new XMLDate( system.functions.tod());
var datestamp = d.getSCDateTimeString();
var usr=system.functions.operator()
srvreq.comments.unshift( z);
srvreq.comments.unshift("*** "+ datestamp + "(" + usr+ ") ***" + "Update From Customer");
newstat = srvreq.zstatus;
srvreq.doAction("closequote");
//srvreq.doSave();
//print ("Quote status has been changed from " + " " +oldstat + " " +"to" +" " +newstat)
}
}while (frelation.getNext() == RC_SUCCESS)

}
}

The script is executing fine when manually I'm closing the incident or saving the incident, in turn it is closing the related quote, but not when SD is closed through connect it scenario. kindly suggest what I'm missing here.

Thanks

Neo

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: Close related Quote when interaction is closed

Hi Folks,

Any sugestions !!

Thanks

Neo

 

 

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: Close related Quote when interaction is closed

Hi All,

The issue is partially resolved as in the sm.log file I can see the error:

"ERROR Type Error system.vars.$update_action.toArray() has no properties at Char 1"

I used it like var z = "closed from user"   // hard coded the comments.

post this when the Connect It scenario is it is closing the Quote record as well.

But what is way forward in order to resolve this issue.

Kindly suggest

Neo

 

0 Likes
Highlighted
Super Contributor.
Super Contributor.

Re: Close related Quote when interaction is closed

Hello,

Could you please provide a debug log file with these parameters. 

rtm:4

debugdbquery:999

PLP

Global Support Delivery Software Support Expert

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
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.