Jump to content


Popular Content

Showing content with the highest reputation since 07/17/2017 in all areas

  1. 1 point
    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
    That works fine: function zClearProp() { if (location.href.indexOf('METHOD=copy_cr') > 0) { var i; //Maximum porperties for (i=0; i<=22; i++) { document.main_form.elements["SET.prop"+ i +".value"].value = ""; } } } ........ body class="detailro" onload="loadActions();zClearProp();" onunload="unloadActions()">
  8. 1 point
    hi, you need to add any search condition, example: /CAisd/pdmweb.exe?OP=SEARCH+FACTORY=cr+QBE.GE.id=0 - obvious condition: "id equal or greater than 0", will show results; /CAisd/pdmweb.exe?OP=SEARCH+FACTORY=cr - will show filter first.
  9. 1 point
    not sure how to do this for employee role, but: that's the reason why I asked for full JavaScript function you use to open new page. You need to pass some extra param to URL to make status change form know where to navigate you and I have tested code from this post: and it works in my env... For more information could you open Status change form, then hit F12 to open browser's console and paste followed code then give result back: console.log("HTMPL : " + ahdframe.jq("[name=HTMPL]").val()); console.log("HOME ACTION : " + ahdframe.jq("[name=KEEP.HOME_ACTION]").val()); console.log("URL : " + ahdframe.window.location.href); // You can wipe site name from this line but keep everything after "?" sign Regards, cdtj
  10. 1 point
    Hi, do you use spel code to apply changes? because I didn't find any inputs for status or other attrs in attached file. Anyway, I remembered a universal solution, which will navigate employee to initial form and will show update message. Here is a way how to achieve it: 1. Add variable to func: { var url=cfgCgi+ "?SID="+cfgSID+ "+FID="+fid_generator()+ "+FACTORY="+factory+ "+PERSID="+persid+ "+OP=UPDATE"+ "+ACTIVITY_LOG_TYPE="+type+ "+EDIT_HTMPL=detail_alg_edit.htmpl" + "+AUTO_OVERRIDE_LOCK=true" + "+KEEP.zBackHome=1"; display_new_page(url); } 2. Use variable in condition on detail_alg.htmpl, add this code where hidden inputs are located: <PDM_IF "$args.KEEP.zBackHome" == "1"> <INPUT TYPE=hidden NAME=HTMPL VALUE="home.htmpl"> <INPUT TYPE=hidden NAME=KEEP.HOME_ACTION VALUE="Z_SUCCESS"> </PDM_IF> 3. Variable HOME_ACTION within KEEP array will be passed to home.htpml, so you can display custom message depending on it, find PDM_LINK OP=SHOW_DETAIL on home.htmpl and update it in this way: <PDM_LINK OP="SHOW_DETAIL" PERSID="$args.persistent_id" onmouseover="window.status = "Open Issue ${args.ref_num}"; return true;" onmouseout="window.status = window.defaultStatus; return true;"> <PDM_IF "$args.KEEP.HOME_ACTION" == "Z_SUCCESS"> <span class="alertmsg portlet_body_text">Issue ${args.ref_num} was updated.</span> <PDM_ELSE> <span class="alertmsg portlet_body_text">Issue ${args.ref_num} was created.</span> </PDM_IF> </PDM_LINK>
  11. 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.
  12. 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
  13. 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