Hi all i'm doing some workOrder template that pulls data on button click from detail_in.
Does anybody know how to pull the transfer time_stamp?
I would like to show it next to Close Date/Time.
In looking at this, the Incident object does not carry a transfer date field, so one way I could envision this working would be to include customisation in which code is executed whenever one does a transfer to write the date/time of the transfer onto a custom transfer date field
One of the problems I am noticing is that the date field you are interested in copying is from the incident activity log, which is a separate object from the incident object itself. Further, it is conceivable that an incident can be transferred multiple times, so it would be ambiguous which date you would want to pull from the activity log, if it was the first transfer, the latest transfer, or something in between.
Yes, David this is correct.
Any other idea? I'm trying to collect from log activites the first appereance of Transfer with JS function to target the string of ex: this.nth-child(2).innerHTML?
Trying with this but with no result.
I cant think of anything off hand here - this one is a bit out of our scope as it requires custom code, thus we dont have a ton of exposure to this type of thing. There are lots of folks out here though that have shared a lot of great stuff they have come up with, so I am hoping that someone can give you some ideas to help you out here.
Can anyone else offer some in sight to Domagoj ?
Also have a question with pulling the prop values.
When integrated USS_SC in catalog form i defined ca_sdm_prop_1, ca_sdm_prop2,...
How to collect the values, ex:
var myAssignee = '<PDM_FMT PAD=NO ESC_STYLE=C>$args.assignee.first_name</PDM_FMT>'; -works
var myProp1 = '<PDM_FMT PAD=NO ESC_STYLE=C>$prop.prop_4</PDM_FMT>'; -this does not
Regarding your original question , you might want to try someting like
var mytime=99999999999;<PDM_LIST PREFIX=mylist WHERE="call_req_id='$args.persistent_id' and type='TR'" FACTORY=alg> if( $mylist.time_stamp_INT_DATE < mytime ) mytime=$mylist.time_stamp_INT_DATE;</PDM_LIST>alert(date_to_string(mytime));
Regarding your 2nd question you can try( for the first property value):
var myProp1 = '<PDM_FMT PAD=NO ESC_STYLE=C>$args.properties.0.value</PDM_FMT>'
Thanks Michael_Mueller ! @dhrzic - does this give you the info you need?
Thank Michael. Works like a charm.
Michael, one more thing. To call the user who actually resolved the ticket from activity log:
var stringNAME = new String();<PDM_LIST PREFIX=mylist2 WHERE="call_req_id='$args.persistent_id' and type='RE'" FACTORY=alg> stringNAME=$mylist2.analyst;</PDM_LIST>
Hint: always use $args.... surrounded by double quotes at least
or even better
And be aware, that each of these pdm_list statements produces a db query each time an incindent is viewed.
Ok, thanks for help Michael.
Hi Michael, got another type of issue, need to pull out the entire logs activities. Any idea how to pull that out?
<PDM_LIST PREFIX=mylist WHERE="call_req_id='$args.persistent_id' and type='TR'" FACTORY=alg> gets only the TRansfer activities of the current ticket, changing the where clause a bit will fetch all activities of the current ticket:
<PDM_LIST PREFIX=mylist WHERE="call_req_id='$args.persistent_id'" FACTORY=alg>
Nevertheless I'm wondering if this is efficient. This kind of implementation will fetch each activity entry for each Ticket Detail regardless of the number of activities of the ticket....
It might harm the overall response time of your system.
Ok, so what i need to do is to print out the whole alg on separate page, any idea how to do this?
for now i'm pulling ticket fields, to vars
and then constructing a url to transfer it to new custom .html form in which we fill it then.
Customer wants to print out the whole ticket log activites
Two ideas I have in mind : take a look at the standard summary and detail Report (Report menu) and adopt it,
or create a separate htmpl file, which creates your print layout, where you can use the same PDM tags and $args references as in a normal htmpl file.
call this by
... OP=SHOW_DETAIL+HTMPL=your file here+FACTORY=cr+PERSID=your ticket persid ...
Hope this helps
so for example i also need to pull the log solution.
var mySolution = ' ';
<PDM_LIST PREFIX=mylist3 where="call_req_id='$args.persistend_id' AND type='RE'" factory=alg>
mySolution = $mylist3.description;
And not working..
For Log Solution activities try type='SOLN'
and as mentioned earlier use at least double quotes around you server variables
mySolution = "$mylist3.description";
Oh, again forget the quotes.. Thanks Michael.
i have an situation when using this
mySolution = "$mylist3.description";
detail_in.htmpl is breaking
when this description is "large"
I suppose that this is because <br> tag is in description.