Jump to content


Popular Content

Showing content with the highest reputation since 09/21/2017 in all areas

  1. 2 points
    hi, try this one: function zAlgPopup(aty, htmpl) { var alg_url = window.cfgCgi + "?SID=" + window.cfgSID + "+FID=" + window.fid_generator() + "+FACTORY=cr" + "+PERSID=" + window.argPersistentID + "+OP=UPDATE+ACTIVITY_LOG_TYPE=" + aty; if (typeof(htmpl) == "string") { alg_url += "+HTMPL=" + htmpl; } popupActivityWithURL(alg_url); } <PDM_MACRO name=button Caption="Log Comment" Func="zAlgPopup('LOG', 'detail_alg_edit.htmpl')" hotkey_name="LOG[G]" ID="LOG"> button should located between dtlForm and dtlStart.
  2. 1 point
    you need to know: - spel basics; - vanilla javascript, jquery basics. I have list of tasks like Approval, Implementation, User testing, etc. Then I have registered trigger for that tasks, once task switch status from WAIT to PEND, trigger fires some activity to change chg's status. Whole logic contains ~2000 lines of spel and js code.
  3. 1 point
    you can redefine create button using sfStart pdm_macro: https://docops.ca.com/ca-service-management/14-1/en/building/building-ca-service-desk-manager/using-the-web-screen-painter-wsp/pdm-macro-definitions#PDMMacroDefinitions-sfStartas I remember you need to pass own javascript function as extraCreateURL, ex: <PDM_MACRO name=sfStart extraCreateURL="zCreateBREL"> function zCreateBREL() { create_new('z_table', <few attrs like window height/width>, 'PRESET=z_chg:$args.KEEP.chg_id'); } Its a good practice to use KEEP array to pass through id from main form to tab: <PDM_MACRO NAME=tab SRC="OP=SEARCH+FACTORY=z_table+KEEP.chg_id=$args.id...<some_other_params>">
  4. 1 point
    oh, if I misunderstood you and you want to predefine chg on your custom form you can use PRESET functionallity: // in URL: +PRESET=<attr_name>:<rel_attr> // example, where 12345 is id and z_chg is your attr name: +PRESET=z_chg:12345 // or if you want to predefine chg using chg_ref_num, where 54321 is ref num: +PRESET_REL=z_chg:chg.id:chg_ref_num:54321
  5. 1 point
    Hi, thats very simple. You have to seperate the new subcategory with a dot. For example: ITAS.AMS for the first entry. For the second entry create a new category with ITAS.ATM PROVIEW. For a third level category: ITAS.AMS.Test
  6. 1 point
    Hi Isaque, You need some coding at client side to update the combo options, based on category changing events. The code you developed will work only for saved tickets where current category is hardware.celular. Regards, Eduardo
  7. 1 point
    You must provide a new site-defined trigger for your custom field to trigger activity based on updates. The syntax is as follows: This file has a command of the type, POST_CI val_fieldupdate_site(persistent_id, audit_userid, CHANGED_ONLY, zattr) 111 FILTER( EVENT("UPDATE") ); where zattr is your custom object. if you have more than one custom object, add them all separated by commas. This trigger is entered via Web Screen Painter's Schema Designer for table cr (Request), within Site-Defined Triggers under the Advanced tab. If you examine the file cr_site.mod under site\mods in your CA SDM installation, the comments will explain this in more detail. It will also show that this must be done for each custom object you wish to perform Activity logging on.
  8. 1 point
    Well, I'm not an expert on this, but I see two things: Your function doesn't correctly calculate your local time: I assume the following: * In your environment the function DATEPART(dw, ...) will give back a 1 for Sunday, a 2 for monday, and so on * Your DST starts on the second sunday in March at 02:00 and ends at first Sunday in November at 02:00 If this is right, your function should look like CREATE FUNCTION [dbo].[GetDateFromEpoch] ( @Seconds int, @ConvertToLocalTime bit ) RETURNS datetime AS BEGIN DECLARE @datLocalDateTime datetime if(@ConvertToLocalTime = 0) BEGIN SET @datLocalDateTime = dateadd(s, @Seconds, '1/1/1970') END ELSE BEGIN DECLARE @datToCheck datetime SET @datToCheck = dateadd(s, @Seconds, '1/1/1970') DECLARE @intYear integer DECLARE @strMar1 varchar(18) DECLARE @strNov1 varchar(18) DECLARE @DayOfTheWeek integer DECLARE @DateDifference integer DECLARE @datDSTStarts datetime DECLARE @datDSTEnds datetime DECLARE @intGMTOffset integer /* Calculate when DST begins for the year in question */ SET @intYear = DATEPART(yyyy, @datToCheck); SET @strMar1 = CONVERT(varchar(18), @intYear) + '0301 02:00:00'; SET @DayOfTheWeek = DATEPART(dw, @strMar1); /* Day March 1 falls on in that year */ if(@DayOfTheWeek = 1) BEGIN SET @DateDifference = 7 /* Sunday is 1st day of the month */ END else BEGIN SET @DateDifference = 15 - @DayOfTheWeek; /* # of days between that day and the 2nd Sunday ("the second Sunday in March ", i.e. when DST begins)*/ END SET @datDSTStarts = DATEADD(dd, @DateDifference, @strMar1); /* Calculate when DST is over for the year in question */ SET @strNov1 = CONVERT(varchar(18), @intYear) + '1101 02:00:00'; SET @DayOfTheWeek = DATEPART(dw, @strNov1); /* Day Nov 1 falls on in that year */ if(@DayOfTheWeek = 1) BEGIN SET @DateDifference = 0 /* Sunday is 1st day of the month */ END else BEGIN SET @DateDifference = 8 - @DayOfTheWeek; /* # of days between that day and the 2nd Sunday ("the second Sunday in March ", i.e. when DST begins)*/ END SET @datDSTEnds = DATEADD(dd, @DateDifference, @strNov1); /* Determine if the date in question is in DST or not */ IF @datToCheck BETWEEN @datDSTStarts AND @datDSTEnds BEGIN SET @intGMTOffset = -4 /* DST */ END ELSE BEGIN SET @intGMTOffset = -5 /* No DST */ END SET @datLocalDateTime = DATEADD(hh, @intGMTOffset, @datToCheck) END RETURN @datLocalDateTime ENDNot that much changes, just the line "SET @DateDifference = 7 /* Sunday is 1st day of the month */". Otherwise, if the first march is a sunday in the year in question, your dst will begin already on the first sunday of march and not on the second one. Secondly, in your report, you are using this function with different parameters. For open_date, you are allways passing a 1 as the "ConvertToLocalTime" value, for resolve_date a 0. Why? If you pass a 0 to this function, no DST adjustment and no UTC adjustment (your timezone) will be done, never. This is the reason, your resolve date is wrongly calculated. My assumption is, that it is wrong all the time, because you allways pass a 0 as the ConvertToLocalTime parameter. And your calculated date difference is also wrong, because of the 0. Suggestion: From my point of view, you should allways pass a 1 in the ConvertToLocalTime parameter when calling your function GetDateFromEpoch. Hope that helps Regards ........mikelm
  9. 0 points
    hi, ref_num can be update on insert (new ticket creation) only. If you share your code and error message I can review it. Regards, cdtj