I am trying to update Call back date from detail_alg.htmpl form, help me with function which can be used here.
Anjaneya Raju E
<PDM_MACRO name=dtlDate hdr="Call Back Date/Time" attr=call_back_date>
Example: This will only display the field on the log comment form.
<PDM_IF "$args.ACTIVITY_LOG_TYPE" == "LOG">
I think this is not an easy task. Could you please describe why you need this, most probably there is some business case behind, and maybe it can be implemented in different way
our requirement is user should be able to update call back date from log comment page.
There is a way using spell codes but does any one having idea on implementing this using java script using on change/on blur triggers.
You can implement this in the following way:
1. Add new custom activity to your menu bar somewhere near update status:
htmpl_str = "+HTMPL=";
if ( factory == "cr" ) // SDT 19319 - Added for ITIL vertical
htmpl_str += "log_comment_custom_cr.htmpl";
else if ( factory == "chg" )
htmpl_str += "log_comment_custom_chg.htmpl.htmpl";
else if ( factory == "iss" )
htmpl_str += "log_comment_custom_iss.htmpl.htmpl";
2. For the request copy request_status_change.htmpl to site mods and rename it to log_comment_custom_cr.htmpl
3. Remove from the form all fields that are related to status and add callback date
4. Clear cach log ou/log in and test it
You should get something like this
I have attached my test files, they are for version 14.1, and of course it is just the proof of concept, so if it will work for you you should cleanup log_comment_custom in order to remove all unneeded lines/
i was also thought the same but we must have a spell code or trigger to write to log a comment in the ticket, i hope this will only updates the field not log a comment.
thanks for the reply but any other way to implement by modifying the detail_alg.htmpl form only.
than you need to change activity type from LOG to FLD
and remove description field. In this case you will have an activity wich will set calback date.
To be honest i still can not understand what are You trying to achive.
I understand now. thank you for the answer.
I don't think this will work because you will not find an attr with name call_back_date in act_log table, we should reference a column from act_log table only to update the values.
I don't see factory method is available for DtlDate or DtlDateDropdown macros which is making difficult to use the refernce attr like call_req_id.call_back_date.
When I briefly tested the code it worked fine. I will provide a modified detail_alg with an example tomorrow. It performs a field update along with a log comment, the field update accounts for the call back date update.
I think that your approach will work. it will create two activities: log comment and field update. But it seems that this is not something AnjaneyaRaju is looking for,
I'm starting to understand the requirements, that doesn't mean they make sense to me though. :)
i got it noe .. thanks for your asnwers
You can still use the detail_alg form if you desire. I can't test this code as I'm not at work, but I like a challenge. Add the below pdm_object to your menubar activities area.
if ("$env.NX_EDIT_INACTIVE" != "No" || (typeof main_frame.argActive != "undefined" && main_frame.argActive == "1"))
Then add this block of code to detail_alg. Use Giedrius's detail_alg file to see where to place the code.
<PDM_IF "$args.ACTIVITY_LOG_TYPE" == "FLD">
Retrieving data ...