Jump to content
vish

Show all log activities for tickets on request list form

Recommended Posts

I'm trying to display log activities for tickets on request list form but none of these attribute relations worked. Is this possible to display log activities on list form?

The requirement here is to have a provision for exporting tickets list along with related log activities from the list form and not sure if this is possible as well.

act_log.0.description

act_log_all.0.description

act_log.description

act_log_all.description

call_req_id.act_log_all.description

<list goes on...>

 

Share this post


Link to post
Share on other sites

Hi, you can try to fetch values using PDM_LIST and then apply data to the field.

Code could look like (not tested):

function zDrawAlg(value) {
	rs.data(alg_snap);
}
<PDM_MACRO name=lsWrite text="var alg_snap='';">
<PDM_MACRO name=lsWrite text="	<PDM_LIST ESC_STYLE=C FACTORY=cr WHERE=\"call_req_id = '@{list.persistent_id}'\" PREFIX=object>">
<PDM_MACRO name=lsWrite text="		var alg_type = '@{object.type.sym}';">
<PDM_MACRO name=lsWrite text="		var alg_time_stamp = '@{object.time_stamp}';">
<PDM_MACRO name=lsWrite text="		var alg_description = '@{object.description}';">
<PDM_MACRO name=lsWrite text="		var alg_analyst = '@{object.analyst.combo_name}';">
<PDM_MACRO name=lsWrite text="		alg_snap += alg_analyst + ' @ ' + alg_time_stamp + ' [' + alg_type + ']: ' + alg_description + '\n';">
<PDM_MACRO name=lsWrite text="	</PDM_LIST>">
<PDM_MACRO name=lsCol hdr="Activity" attr="id" fmtfunc=zDrawAlg sort=no>

 

Edited by cdtj
  • Like 1

Share this post


Link to post
Share on other sites

Hi, I tried adding the function before the start of <PDM_MACRO name=lsStart> and the rest of your code before the line <PDM_MACRO name=lsEnd>. I don't see any value displayed for Activity column. Did I put your code in the correct places on request list form?

Edited by vish

Share this post


Link to post
Share on other sites

hi, that's correct. have you checked browser's console/stdlog for details?

Share this post


Link to post
Share on other sites

Hi! Yes, looks like attribute not found issue.I have also tried removing combo_name and just couple other changes but still same errors minus dotted reference for Object.analyst. Any ideas?

Unknown attribute time_stamp ignored at PDM_EVAL{pdmlist@lsEnd.mac[56]}[459] in pdm_list at PDM_EVAL{pdmlist@lsEnd.mac[56]}[457]
Unable to resolve reference to analyst in dotted reference object.analyst.combo_name at PDM_EVAL{pdmlist@lsEnd.mac[56]}[461] in pdm_list at PDM_EVAL{pdmlist@lsEnd.mac[56]}[457]
Attribute call_req_id not found in cr:PDOB:PATTR:OB:MTH:
Parse error at : "call_req_id = 'cr:2346829'" (Attr not found or not atomic)
....
 

Share this post


Link to post
Share on other sites

Hi, 

You need to make two changes to cdtj's code. The factory should be alg and the IsCol should use persisitent_id.

function zDrawAlg(value) {
	rs.data(alg_snap);
}
<PDM_MACRO name=lsWrite text="var alg_snap='';">
<PDM_MACRO name=lsWrite text="	<PDM_LIST ESC_STYLE=C FACTORY=alg WHERE=\"call_req_id = '@{list.persistent_id}'\" PREFIX=object>">
<PDM_MACRO name=lsWrite text="		var alg_type = '@{object.type.sym}';">
<PDM_MACRO name=lsWrite text="		var alg_time_stamp = '@{object.time_stamp}';">
<PDM_MACRO name=lsWrite text="		var alg_description = '@{object.description}';">
<PDM_MACRO name=lsWrite text="		var alg_analyst = '@{object.analyst.combo_name}';">
<PDM_MACRO name=lsWrite text="		alg_snap += alg_analyst + ' @ ' + alg_time_stamp + ' [' + alg_type + ']: ' + alg_description + '\n';">
<PDM_MACRO name=lsWrite text="	</PDM_LIST>">
<PDM_MACRO name=lsCol hdr="Activity" attr="persistent_id" fmtfunc=zDrawAlg sort=no>

Conan

  • Like 2

Share this post


Link to post
Share on other sites

Hi!  This worked like a charm. Thanks so much cdtj and Conan.

Would it be possible to export the Activities data, as it is currently displaying this data on the list form?

Share this post


Link to post
Share on other sites

conanlam,

nice input! I have missed the factory in my code... btw: lscol's attribute doesn't matter because we don't pass it anywhere.

 

vish,

try to update as:

<PDM_MACRO name=lsCol hdr="Activity" attr="persistent_id" fmtfunc=zDrawAlg exportFmt=zDrawAlg sort=no>

Regards, cdtj

Share this post


Link to post
Share on other sites

cdtj,

Cool, good to know. I will need to try that exportFmt with customiz JS again, because last time I tried using custom JS, it did not work, maybe there were some error in my code. The CA document only shows three OOTB functions with exportFmt, and I only able to get "YesNo" (the CA document even provide the wrong syntax) to work.

BTW, your latest custom web OP function is really cool.

Conan

Share this post


Link to post
Share on other sites
8 hours ago, cdtj said:

vish,

try to update as:


<PDM_MACRO name=lsCol hdr="Activity" attr="persistent_id" fmtfunc=zDrawAlg exportFmt=zDrawAlg sort=no>

Regards, cdtj

Hi cdtj,

This is exporting just the persistent_id value for Activity column into export file using the above syntax.

Share this post


Link to post
Share on other sites

hm, haven't access to test env at this moment and documantion isn't clear engouh...

you can try in this way:

- create one more function that will return alg_snap as string and use it in exportFtm instead:

function zExportAlg(value) {
	return alg_snap;
}

<PDM_MACRO name=lsCol hdr="Activity" attr="persistent_id" fmtfunc=zDrawAlg exportFmt=zExportAlg sort=no>

 

Share this post


Link to post
Share on other sites

It looks like SDM is not considering of the function that's being passed in exportFmt, as it still export only the persistent_id value for Activity column.

Share this post


Link to post
Share on other sites
27 minutes ago, vgen said:

It looks like SDM is not considering of the function that's being passed in exportFmt, as it still export only the persistent_id value for Activity column.

Yes, hopefully there is some workaround for exporting the activity logs as well.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Announcements

    • Gregg

      Looking for the wiki content?

      12/20/2015

      Until I can transfer the wiki content over to the new Articles, you can find the old content here: http://www.greggsmith.net/wiki.
    • Gregg

      New site logo

      01/06/2016

      A special thanks to brianshs for creating a new site logo!
×