Jump to content
  • Posts

    • Hello Everyone,

      I am new to this forum ,really  appreciate the way people share their ideas i have been looking for solution to a enhancement request.

      we are working on CA Service Desk 14.1 where we are trying to make external_ticket_system required when the resolution_code=='Vendor'

      i have gone through some similarly looking question and solution in this forum and created a spel file but that does not seems to work for me.

      hope to get some thoughts from you all .

      zmyscript.spl

      // Use 'cr' for Requests, Incidents & Problems, 'chg' for Changes, and 'iss' for Issues
      cr::zmyscript(...) {
      string zmsg;
      // Enter an if statement
      if (is_empty(external_ticket_system)&& resolution_code == "resocode:400012") {
      // Enter an alert message that appears when the if statement is fulfilled
      zmsg=format("external_ticket_system is required in order to close this ticket");
      set_error(1);
      set_return_data(zmsg);
      return;
      }
      }

      zmyscript.mod

       

      // Use OBJECT cr for Requests, Incidents & Problems
      // Use OBJECT chg for Change Orders
      // Use OBJECT iss for Issues
      OBJECT cr {
        TRIGGERS {
          PRE_VALIDATE zmyscript() 111 FILTER(EVENT("UPDATE"));
      };
      };

       

       

       

       

       

       

    • CA doesn't provide much guidance on this topic, all I've seen them say is reorganize/rebuild table indexes when needed. I plan to review the following automated reorganize script with one of our dbas and scheduling it for a weekend. 

      http://sqlfool.com/2011/06/index-defrag-script-v4-1/

      You can also check for long running queries and review them with a dba to see if additional indexes would be a benefit. 

      https://www.sqlservercentral.com/Forums/Topic619606-360-1.aspx

    • Required guidance on performing Service Desk DB Maintenance activity. Database is working on SQL.

    • Hi; so I finally resolved this via a different approach; appreciate all your assistance but I think our pages were too heavily customised for the proposed process to work correctly at our end.

      I got it working by adapting the employee; update status page as follows:

           <PDM_MACRO name=button caption="Approve Request" disabled="defer" func="detailSave()" hotkey_name="Save" id="btn001" width=0>

           <PDM_MACRO name=button caption="Cancel" disabled="defer" func="detailCancel()" hotkey_name="Cancel" id="btn002"    width=0>

           <PDM_MACRO name=button caption="Clear Remarks" disabled="defer" func="document.main_form.reset()" hotkey_name="Clear Remarks" id="btn003" width=0>

           <PDM_MACRO name=btnEndRow>

           <PDM_MACRO name=dtlStart>

           </script>

           <input type=hidden name=SET.status value="PRBAPP">

           <script language="JavaScript">

           add_date_field("alg.time_stamp", "$args.alg.time_stamp_INT_DATE");

           <PDM_MACRO name=dtlStartRow>

           <PDM_MACRO name=dtlReadonly hdr="Current Status" attr=status>

           <PDM_MACRO name=dtlStartRow>

           <PDM_MACRO name=dtlTextbox hdr="Please enter reasons for approval" attr=alg.description colspan=3 keeplinks=yes rows=8 size=80 spellchk=yes>

           <PDM_MACRO name=dtlEndTable>

      My new custo drives the status changes from the save button action; and I have created 3 of these called from my previous links. The base code behind the update status page seems to include the base code to call the page refresh upon save and thereby solves the problem I was experiencing.

       

       

    • Quote

      Is there part of the code that can be 'hijacked' for my button to do the same?

      not sure how to do this for employee role, but:

      Quote

      its still dropping me back to the request

      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

      • Like 1
    • Sorry that is what I meant. I have tried using both  popupActivityWithURL & display_new_page on my employee role.

      I noticed that I was currently using the former, on my latest attempt at getting the employee page working. I have now switched back to display_new_page; its still dropping me back to the request, and not the home page.

      I've noticed that other 'update status' activities (for example - when the user requests close) forces the status change to update the screen. Is there part of the code that can be 'hijacked' for my button to do the same? I'm not actually sure what part of the page calls the screen refresh, whether it's part of the function itself, or java-script or what part of the actual code calls the page re-fresh.(My colleague here is also stumped, he is a bit more 'webpage savvy' than myself and tried your recommended changes above on our test system, with the same results to what we get on live. )

       

    • there is no need to supress popups :) you need to use popupActivityWithURL for analyst role and display_new_page for employee.

      BTW after supressing popups what happening when you save the chenges? Does browser navigate to home screen or back to request?

    • 34 minutes ago, cdtj said:

      Defaulty all new forms for employee interface group opens in a same window, have you tried to avoid popups? this could be a clue. Providing final code for z_customer_chase also might be helpful.

      Thanks once again for the reply;

      Ok, I have supressed pop-ups and now have it all the frames loading in the same window, however my problem is still present.

      The code for z_customer_chase is the function I have provided all along from the start  - but Alas, this is an error on my part, as I did not include the header line of my function I see...

               function z_customer_chase(persid,factory,type)

                        {

                              var url=cfgCgi+

                              "?SID="+cfgSID+

                              "+FID="+fid_generator()+

                                    ect...

    • Defaulty all new forms for employee interface group opens in a same window, have you tried to avoid popups? this could be a clue. Providing final code for z_customer_chase also might be helpful.

    • 15 hours ago, cdtj said:

      hi,

      one question to determine starting point: what happens when employee clicks Save button?

      Regards, cdtj

      Good morning;

      So, let me start from the beginning. The user opens up the request via an email link; and is presented with 3 buttons;

      Approve; Partially Approve and Reject, - all are linked to the (above) function. The code behind each of the 3 buttons is

               

                       ImgBtnCreate("btnzup", "APPROVE ALL", "z_customer_chase('$args.persistent_id', 'cr','BUS_APP')", "defer", 0)

                       ImgBtnCreate("btnzup1", "APPROVE PARTIALLY", "z_customer_chase('$args.persistent_id', 'cr','BUS_PAPP')", "defer", 0)

                       ImgBtnCreate("btnzup2", "REJECT", "z_customer_chase('$args.persistent_id', 'cr','BUS_REJ')", "defer", 0)

       

      Each of these buttons requires a comment from the end user, so when one of these buttons in clicked a new window pops-up stating 'Update Required On Request 123456'. The user is required to enter a comment and click Save. When save is clicked the employee is returned back to the request screen; (not home.htmpl). This wouldn't be an issue, except that on the request screen, the status does not show the latest status change - the status remains the same. The only way the employee has of knowing there action was successful, is to scroll down to the activity log; where the latest activity has been written.

      If the employee returns to the home page, and then goes back into the request, the status change has occurred.

      I hope this helps.

      Edited by lawrencem
    • hi,

      one question to determine starting point: what happens when employee clicks Save button?

      Regards, cdtj

    • Hi again,

      So I have had a week working on other things; back on this today I have retested the code, again this morning, but even with the above 3 statements added to the pages in the correct positions I am still not getting the desired page refresh action on my employee form.

      Happy to share files if this helps trouble-shoot things, but I can't help but feel I must be missing something here. I can't understand why my analyst form works, yet my employee one does not :(

      As always I appreciate the support

    • Hi,

      you can try to create POST_CI trigger for INSERT event, which will check related data for newly created contact but I'm not sure on what stage of copying process LREL data filling.

      Regards, cdtj

    • any ideas?

    • Thank you cdtj

      I will test this further in the morning, alas I have run out of time today.

      I am hitting a few snags as I have a customised 'home.htmpl' page, so I am trying to debug where this is failing.

      I will update with my findings in the morning.

       

      Edited by lawrencem
    • 19 hours ago, lawrencem said:

      Thanks for your continued perseverance :) I have attached my file

       

      detail_alg.htmpl

      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>

       

      • Like 1
    • On ‎16‎/‎07‎/‎2017 at 9:33 AM, cdtj said:

      this sounds very strange, could you share your detail_alg.htmpl for employee form group?

      Thanks for your continued perseverance :) I have attached my file

       

      detail_alg.htmpl

    • this sounds very strange, could you share your detail_alg.htmpl for employee form group?

    • This code reference was very helpful. Thank you, Cdtj!!

    • 24 minutes ago, cdtj said:

      but display_new_page should open new form in the same page (ahdframe) and after submitting should return you back isn't it?

      Could you try this one:

      
      {
      	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";
      	display_new_page(url);
      }

      Yes, this does drop me back to the detail.cr page after the status update is saved (both from an email link and via Service Desk) but the status field, still doesn't show the update that has just occurred, unless I refresh the screen again (manually).

      Much appreciate all of your help thus far.

×