CA Service Management

Expand all | Collapse all

Add custom derived read only date field

  • 1.  Add custom derived read only date field

    Posted Sep 16, 2015 11:13 AM

    Hi Community!

     

    I have a requirement to show the total outage time.  To accomplish this, I'm trying to figure out how to get a derived date field to work.  The idea would be to auto populate a new field on the incident form once Start Time and End Time is entered.  Does anyone know how to accomplish this?



  • 2.  Re: Add custom derived read only date field

    Posted Sep 16, 2015 11:18 AM

    Hi, the only possibility i see is to use trigger and spel code. If you are not afraid of them, I or someone else from community can provide you the solution.



  • 3.  Re: Add custom derived read only date field

    Posted Sep 16, 2015 11:28 AM

    Hi Gutis,

     

    At this point we are OK with a customized solution.  If you could point me in the right direction I would be grateful.



  • 4.  Re: Add custom derived read only date field

    Posted Sep 16, 2015 11:46 AM

    Ok as i understand you need calculate the duration of the outage according do the values in outage_start_time and outage_end_time. is it correct?

    Did you already created custom duration field wich will hold calculated value, if yes what is the name of this field?

    Do you need to calculate just simple difference between outage_start_time and outage_end_time, or you need this according to some workshift, if yes what is workshift name or id?



  • 5.  Re: Add custom derived read only date field

    Posted Sep 16, 2015 12:08 PM

    I created a new field called z_outage_total with the type Duration.  We need the simple difference between the two.



  • 6.  Re: Add custom derived read only date field

    Posted Sep 16, 2015 12:15 PM

    Currently i am out of office, i will provide you with the solution later today or tomorow. Maybe someone from community will help you in the mean time.



  • 7.  Re: Add custom derived read only date field

    Posted Sep 16, 2015 12:27 PM

    Thank you Gutis, I appreciate the help.



  • 8.  Re: Add custom derived read only date field
    Best Answer

    Posted Sep 17, 2015 01:48 AM

    Good Morning,

    Place outage.spl and outage.mod files to %SDM_ROOT%/site/mods/majic and recycle SDM services

    I also attached xx_service_outage_tab_htmpl, but use it only if you have SDM14.1 and you have no others customizations in this file. Otherwise you need to add the following line after <PDM_MACRO name=dtlDate hdr="End Time" attr=outage_end_time>

     

    <PDM_MACRO name=dtlReadonly hdr="Total Outage" attr=z_outage_total>

     

    Please do this on testing system first if anything goes wrong simply delete outage.spl and outage.mod and recycle SDM services

    Attachment(s)

    zip
    outage.spl.zip   399 B 1 version
    zip
    outage.mod.zip   270 B 1 version


  • 9.  Re: Add custom derived read only date field

    Posted Sep 17, 2015 01:18 PM

    Hey Gutis,

     

    I have this working successfully in my dev environment without errors.  Thank you very much!



  • 10.  Re: Add custom derived read only date field

    Posted Sep 17, 2015 03:21 PM

    You are welcome



  • 11.  Re: Add custom derived read only date field

    Posted Sep 17, 2015 03:03 PM

    Thank you Gutis. I have looking for something like that.



  • 12.  Re: Add custom derived read only date field

    Posted Sep 17, 2015 03:21 PM

    You are welcome