Jump to content

eoliva

Members
  • Content Count

    19
  • Joined

  • Last visited

Community Reputation

0 Neutral

About eoliva

  • Rank
    Level 2 Contributor

Recent Profile Visitors

253 profile views
  1. Hi, I am attempting to make some fields mandatory whenever a status transition is performed on a Change Order, and am using the code listed below. The code works for my requests/incidents, but can't get it to work for Change Orders. I know that it triggers when the status is changed to ENGTSKEST because it pops up the window. However, it does not flag the field as mandatory as it did for requests/incidents. I could be missing something, and I'm hoping someone could highlight that to me. function preSaveTrigger() { // Make the GROUP and IMPLEMENTER field mandatory when the status is set to ENG TASK ESTIMATION. if (document.forms['main_form'].elements['SET.status'].value == "ENGTSKEST" ) { is_required = 1; popupWithURL('http://http://pqdvuc01:8060/wl/login.jsp', 1, 1); } else { is_required = 0; } z_setMandatory(document.forms['main_form'].elements['SET.z_task_implementer'].id, is_required ); z_setMandatory(document.forms['main_form'].elements['SET.group'].id, is_required ); return true; } // // This function sets or clears the mandatory flag for a field // function z_setMandatory(idToSet, is_required) { var fields = ""; for (var i = 0; i < _dtl.fieldToValidate.length; i++) { fields = fields + ", " + _dtl.fieldToValidate[i].id; if (_dtl.fieldToValidate[i].id == idToSet) { _dtl.fieldToValidate[i].is_required = is_required; } } } Thanks as usual for all the tips! Cheers, Erwin
  2. We have found a solution, and that is to copy the std_list.htmpl to the site/mods/www/wwwroot/scripts and edit it as follows: The only change needed was to change the last line of this code to return false instead of true. ResultSet.prototype.needTenantData=function() { if(ahdtop.cfgMultiTenancy=="off"|| typeof argFactoryTenancy!="string"|| argFactoryTenancy=="0"|| propFactory=="tenant"|| (cfgAccessTenantRestriction=="1"&& cfgAccessAdmin!="2"&& cfgAccessTenantAdmin=="0")) return false; if(typeof tenantColumn!="undefined"&&tenantColumn=="no") return false; return false; }
  3. Hi, We have customized the list_cr and list_in htmpl files to add or remove columns as needed. I want to remove the tenant column from both those files, but I can't find the code to remove. Would any one share or point me to the right place where I can remove the tenant column, so it won't show up in our List views? We are using multi-tenancy. Thanks for your kind help. Regards, Erwin
  4. Hi, We just migrated our KT data from Unicenter v6.0 to r12.5. We got the KT docs all migrated and viewing properly in r12.5, however we missed to migrate the knowledge file attachments. 1) Are KT doc file attachments stored in any table in version 6.0? If so, which one? 2) In r12.5 KT file attachments also go to the Attachments table. There is also a usp_lrel_attachment for change and requests, but there is none for Knowledge docs, so does anyone know which table stores the link between a Doc ID and the file attachment? Would appreciate any thoughts that you folks have! Cheers, Erwin
  5. I have the same requirement and have asked CA. I asked if there could be a ROLE parameter defined in the URL that gets sent out on notifications. Apparently there is none, and a few customers have raised similar enhancement requests for it.
  6. Our employees can reply to email notifications sent by CA Service Desk, and the assignee needed to get notified. The Default LOG notification rule notifies whoever created an activity log. So we have written a SPEL code to notify the assignee only when an activity log was created by anyone else. // This method is activated when a Call Request Activity Log record is created or updated. // It notifies the assignee of the activity as long as the person that created the activity is not the assignee. alg::z_notify_log(...) { string et, eb, errmsg, request_url, recipient; logf(SIGNIFICANT,"Start z_notify_log.spl\n"); if (analyst == call_req_id.assignee) { logf(SIGNIFICANT,"Activity Log done by the assignee. No need for notification \n"); return; } object cr_obj; cr_obj = zGetObj("cr", call_req_id); request_url = z_getCRUrl(cr_obj.id); recipient = format("cnt:%s", cr_obj.assignee.id); et = format("Received Activity Log for %s %s",cr_obj.type.sym, cr_obj.ref_num); eb = format("%s \n", description); eb += format("\n%s", request_url); logf(SIGNIFICANT,"Sending Activity Log notification to assignee.\n"); send(top_object(), "call_attr", "cnt", "notify_list", recipient, 2, et, eb, "", 28, persistent_id, 0, 0); if (msg_error()) { logf(ERROR, format("event error on notify_list '%s'", msg[0])); } } string z_getCRUrl(int id) { string url; string host; host = getenv("NX_WEB_CGI_URL"); url = format("Click on the following URL to view Request: \n %s?OP=SEARCH+FACTORY=cr+SKIPLIST=1+QBE.EQ.id=%s", host, id); return url; } object zGetObj(string objectType, string persid) { string where_clause; object obj; object obj_list; int count; where_clause = format("persistent_id = \'%s\'", persid); send_wait(0, top_object(), "call_attr", objectType, "sync_fetch", "STATIC", where_clause, -1, 0); obj_list = msg[0]; count = msg[1]; if (count > 0) { send_wait(0, obj_list, "dob_by_index", "DEFAULT", 0, 0); obj = msg[0]; } else { logf(SIGNIFICANT, "No %s records found for persid %s!", objectType, persid); } Add this entry in Web Screen Painter for ALG. POST_VALIDATE z_notify_log() 910 FILTER type { -> 'LOG'}; Hope you will find this useful. Cheers!
  7. We had a requirement to transfer requests or incidents to another tenant. The design was to allow an analyst to transfer a request/incident to another tenant by choosing the option from the "Activities" menu. A pop-up form will prompt for the target tenant. Once saved the status is changed to "Closed-Transfer Tenant", which inactivates the current request/incident, and then a SPEL code would be triggerred to create a copy of the request/incident to the target tenant. The following were performed. 1. Created an Aux Table called "z_Tenant_List" which contains a list of all tenant names. 2. Added new field in Call_Req "z_tenant_xfer" to reference the new table "z_Tenant_List". 3. Modified the appropriate menu_bar to add a new activity to "Xfer Tenant". 4. Added a pop-up form to prompt tenant selection and reason for transferring. 5. Defined the appropriate request/incident transition so that "Closed-Transfer Tenant" status could be involked from "Open, Acknowledged, Work-in-Progress". Below is the trigger: POST_CI z_transfer_tenant(persistent_id) 5500 FILTER( status { -> 'XFERTNT'}); The SPEL code is as follows. It may not be the most efficient SPEL code cr::z_transfer_tenant(...) { logf(SIGNIFICANT, "Start z_transfer_tenant.spl\n"); object cr_obj; cr_obj = zGetObject("cr", argv[2]); logf(SIGNIFICANT, "Got cr record for %s \n", cr_obj.ref_num); uuid userid; send_wait(0, top_object(), "call_attr", "cr", "current_user_id"); userid = msg[0]; //get Target Tenant UUID uuid tenantid; string cr_type, cr_tenant; // Check for Target Tenant if (cr_obj.z_tenant_xfer == 'AMT') { cr_type="R"; cr_tenant="OPS_AMT"; } else if (cr_obj.z_tenant_xfer == 'Procurement') { cr_type="R"; cr_tenant="PROC"; } else if (cr_obj.z_tenant_xfer == 'Facilities') { cr_type="R"; cr_tenant="FCS_CS_Facilities"; } else if (cr_obj.z_tenant_xfer == 'NFS Logistics') { cr_type="R"; cr_tenant="NFS_Logistics"; } else if (cr_obj.z_tenant_xfer == 'NFS Secondary Systems') { cr_type="R"; cr_tenant="NFS_SS"; } else if (cr_obj.z_tenant_xfer == 'Health and Safety') { cr_type="R"; cr_tenant="HRD_HSS"; } else if (cr_obj.z_tenant_xfer == 'NMS') { cr_type=cr_obj.type; cr_tenant="OPS_NMS"; } else if (cr_obj.z_tenant_xfer == 'TNOC') { cr_type=cr_obj.type; cr_tenant="OPS_TNOC"; } else if (cr_obj.z_tenant_xfer == 'IT Services') { cr_type=cr_obj.type; cr_tenant="OPS_ITS"; } else { cr_type=cr_obj.type; cr_tenant="UNKNOWN_TENANT"; } send_wait(0, top_object(), "call_attr", "tenant", "val_by_key", "name", cr_tenant, (int) 1, "id"); if (msg_error()) { logf(SIGNIFICANT, "Tenant not found: '%s'",msg[0]); return; } else { // The tenant was found. tenantid=msg[1]; //logf(SIGNIFICANT, "Transferring to Tenant UUID: %s \n", tenantid); } // get a group leader so we can change things object group_leader; send_wait(0, top_object(), "get_co_group"); if (msg_error()) { logf(SIGNIFICANT, "Error in get_co_group: '%s'",msg[0]); return; } group_leader = msg[0]; //printf("got group leader\n"); // Create the Request object cr; uuid agt_id, asg_id; string activity_log, from_external_ticket, to_external_ticket, alg_desc; activity_log=format("Initial creation of %s. Transferred from Tenant %s - %s \n", cr_obj.type, cr_obj.tenant.name, cr_obj.ref_num); from_external_ticket=format("%s - %s", cr_obj.tenant.name, cr_obj.ref_num); agt_id=cr_obj.log_agent; send_wait( 0, top_object(), "call_attr", "cr", "get_new_dob", NULL, NULL, group_leader); if (msg_error()) { logf(SIGNIFICANT, "Error in cr get_new_dob: '%s'",msg[0]); return; } cr = msg[0]; //printf("got new cr dob\n"); //logf(SIGNIFICANT, "New record ID %s \n", cr.id); send_wait( 0, cr, "init_call_request", agt_id, asg_id, activity_log); if (msg_error()) { logf(SIGNIFICANT, "Error in init_call_request: '%s'",msg[0]); return; } //printf("init_call_request ok\n"); cr.summary=cr_obj.summary; cr.description=cr_obj.description; cr.customer=cr_obj.customer; cr.impact=cr_obj.impact; cr.urgency=cr_obj.urgency; //cr.priority=cr_obj.priority; //cr.log_agent=cr_obj.log_agent; cr.external_system_ticket=from_external_ticket; cr.status="OPNXFERTNT"; cr.type=cr_type; //Setting the tenant value at this stage will cause tenancy violation //so we will create an activity log and update the external_system_ticket instead //cr.tenant=tenantid; logf(SIGNIFICANT, "Creating record in %s \n", cr_obj.z_tenant_xfer); send_wait(0, group_leader, "checkin"); if (msg_error()) { logf(SIGNIFICANT, "Error in checkin: '%s'",msg[1]); send_wait(0, group_leader, "uncheck"); return; } else { //printf("checkin ok\n"); logf(SIGNIFICANT, "Checked-In record is %s \n", cr.ref_num); } // Update source record with reference to the target record ID to_external_ticket=format("%s - %s", cr_obj.z_tenant_xfer, cr.ref_num); alg_desc=format("Transferred to Tenant %s - %s", cr_obj.z_tenant_xfer, cr.ref_num); send_wait(0, group_leader, "checkout", cr_obj); if (msg_error()) { logf(SIGNIFICANT, "Error in checkout: '%s'",msg[1]); } cr_obj.external_system_ticket = to_external_ticket; send_wait(0, group_leader, "checkin"); if (msg_error()) { logf(SIGNIFICANT, "Error in checkin: '%s'",msg[1]); } //Create Log Activity for Source Record object gl; send_wait(0, top_object(), "get_co_group"); if (msg_error()) { logf(SIGNIFICANT, format("get_co_group error '%s'", msg[0])); return; } gl = msg[0]; send_wait(0, top_object(), "call_attr", "alg","get_new_dob", NULL, NULL, gl); if(msg_error()) { logf(SIGNIFICANT, format("alg get_new_dob error '%s'", msg[0])); return; } object new_alg; new_alg = msg[0]; send_wait(0, new_alg, "call_attr", "description", "set_val", alg_desc,"SUPPRESS_TRIGGERS"); send_wait(0, new_alg, "call_attr", "analyst", "set_val", userid,"SUPPRESS_TRIGGERS"); send_wait(0, new_alg, "call_attr", "type", "set_val", "LOG","SUPPRESS_TRIGGERS"); send_wait(0, new_alg, "call_attr", "time_spent", "set_val", 0); send_wait(0, new_alg, "call_attr", "call_req_id", "set_val",format("cr:%s", cr_obj.id),"SUPPRESS_TRIGGERS" ); //logf(SIGNIFICANT, "call_req_id set to : '%s' \n", new_alg.call_req_id); send_wait(0, gl, "checkin"); if (msg_error()) { logf(SIGNIFICANT, format("alg checkin error '%s'", msg[0])); logf(SIGNIFICANT, format("alg checkin error1 '%s'", msg[1])); send_wait(0, gl, "uncheck"); } //logf(SIGNIFICANT, "New Request Alg %s check in \n", new_alg.id); // Update target record with the target Tenant ID send_wait(0, group_leader, "checkout", cr); if (msg_error()) { logf(SIGNIFICANT, "Error in Tenant Update checkout: '%s'",msg[1]); } cr.tenant=tenantid; send_wait(0, group_leader, "checkin"); if (msg_error()) { logf(SIGNIFICANT, "Error in Tenant Update checkin: '%s'",msg[1]); } //Create Log Activity for Target Record object glt; send_wait(0, top_object(), "get_co_group"); if (msg_error()) { logf(SIGNIFICANT, format("get_co_group error '%s'", msg[0])); return; } glt = msg[0]; send_wait(0, top_object(), "call_attr", "alg","get_new_dob", NULL, NULL, glt); if(msg_error()) { logf(SIGNIFICANT, format("alg get_new_dob error '%s'", msg[0])); return; } object tgt_alg; tgt_alg = msg[0]; send_wait(0, tgt_alg, "call_attr", "description", "set_val", activity_log,"SUPPRESS_TRIGGERS"); send_wait(0, tgt_alg, "call_attr", "analyst", "set_val", userid,"SUPPRESS_TRIGGERS"); send_wait(0, tgt_alg, "call_attr", "type", "set_val", "LOG","SUPPRESS_TRIGGERS"); send_wait(0, tgt_alg, "call_attr", "time_spent", "set_val", 0); send_wait(0, tgt_alg, "call_attr", "call_req_id", "set_val",format("cr:%s", cr.id),"SUPPRESS_TRIGGERS" ); send_wait(0, tgt_alg, "call_attr", "tenant", "set_val", tenantid,"SUPPRESS_TRIGGERS"); //logf(SIGNIFICANT, "call_req_id set to : '%s' \n", tgt_alg.call_req_id); send_wait(0, glt, "checkin"); if (msg_error()) { logf(SIGNIFICANT, format("alg checkin error '%s'", msg[0])); logf(SIGNIFICANT, format("alg checkin error1 '%s'", msg[1])); send_wait(0, glt, "uncheck"); } } object zGetObject(string objectType, string persid) { string where_clause; object obj; object obj_list; int count; where_clause = format("persistent_id = \'%s\'", persid); send_wait(0, top_object(), "call_attr", objectType, "sync_fetch", "STATIC", where_clause, -1, 0); obj_list = msg[0]; count = msg[1]; if (count > 0) { send_wait(0, obj_list, "dob_by_index", "DEFAULT", 0, 0); obj = msg[0]; } else { logf(SIGNIFICANT, "No %s records found for persid %s!", objectType, persid); } return obj; } The addition to the menu bar is as follows: var query_str = w.cfgCgi + "?SID=" + w.cfgSID + "+FID=" + w.fid_generator() + "+FACTORY=" + factory + "+PERSID=" + w.argPersistentID; var query_str1 = query_str + "+OP=UPDATE+ACTIVITY_LOG_TYPE="; <PDM_OBJECT> if ("$env.NX_EDIT_INACTIVE" != "No" || (typeof main_frame.argActive != "undefined" && main_frame.argActive == "1")) { htmpl_str = "+HTMPL=" htmpl_str += "z_transfer_tenant.htmpl"; <PDM_MACRO name=menuItemLocal label="Xfer Tenant..." function="java script: popupActivityWithURL('\" + query_str1 + \"ST\" + htmpl_str + \"')"> } </PDM_OBJECT>
  8. I figured a way to create a problem based on the given condition above. Please see the code below: cr::z_create_problem(...) { string errmsg; // Check if Incident and OPS_ITS tenant if ((type == 'I') && (tenant == (uuid) "154859ba7370784dbe0b94f4ec03e249" )) { logf(SIGNIFICANT, "Start z_create_problem.spl\n"); object cr_obj; cr_obj = zGetObject("cr", argv[2]); logf(SIGNIFICANT, "Got cr record for %s \n", cr_obj.ref_num); // get a group leader so we can change things object group_leader; send_wait(0, top_object(), "get_co_group"); if (msg_error()) { errmsg=format("Error in get_co_group: '%s'",msg[0]); _errmsg(errmsg); return; } group_leader = msg[0]; //printf("got group leader\n"); // Create the Request object cr; uuid agt_id; string activity_log; activity_log="Problem Created from High Priority Incident"; agt_id=cr_obj.log_agent; send_wait( 0, top_object(), "call_attr", "cr", "get_new_dob", NULL, NULL, group_leader); if (msg_error()) { errmsg=format("Error in cr get_new_dob: '%s'",msg[0]); _errmsg(errmsg); return; } cr = msg[0]; //printf("got new cr dob\n"); logf(SIGNIFICANT, "New Problem record ID %s \n", cr.id); send_wait( 0, cr, "init_call_request", agt_id, agt_id, activity_log); if (msg_error()) { errmsg=format("Error in init_call_request: '%s'",msg[0]); _errmsg(errmsg); return; } //printf("init_call_request ok\n"); cr.description=cr_obj.description; cr.customer=cr_obj.customer; cr.impact=cr_obj.impact; cr.urgency=cr_obj.urgency; cr.priority=cr_obj.priority; cr.log_agent=cr_obj.log_agent; cr.type="P"; cr.tenant=cr_obj.tenant; cr.outage_start_time=cr_obj.outage_start_time; cr.outage_end_time=cr_obj.outage_end_time; cr.pct_service_restored=cr_obj.pct_service_restored; cr.outage_type=cr_obj.outage_type; cr.z_outage_reason=cr_obj.z_outage_reason; cr.z_outage_duration=cr_obj.z_outage_duration; cr.outage_reason_desc=cr_obj.outage_reason_desc; cr.outage_detail_who=cr_obj.outage_detail_who; cr.outage_detail_what=cr_obj.outage_detail_what; cr.outage_detail_why=cr_obj.outage_detail_why; send_wait(0, group_leader, "checkin"); if (msg_error()) { errmsg=format("Error in checkin: '%s'",msg[1]); _errmsg(errmsg); send_wait(0, group_leader, "uncheck"); return; } else { //printf("checkin ok\n"); logf(SIGNIFICANT, "Checked-In Problem record is %s \n", cr.ref_num); } } } object zGetObject(string objectType, string persid) { string where_clause; object obj; object obj_list; int count; where_clause = format("persistent_id = \'%s\'", persid); send_wait(0, top_object(), "call_attr", objectType, "sync_fetch", "STATIC", where_clause, -1, 0); obj_list = msg[0]; count = msg[1]; if (count > 0) { send_wait(0, obj_list, "dob_by_index", "DEFAULT", 0, 0); obj = msg[0]; } else { logf(SIGNIFICANT, "No %s records found for persid %s!", objectType, persid); } return obj; }
  9. Hello Folks, I have a requirement to auto copy incident details including custom fields to a problem when a HIGH priority incident gets resolved. I want to use SPEL and noticed the COPY_CR function, but I have not seen any examples in the forum on how to use it. It would be greatly appreciated if anyone can share their ideas or their SPEL codes that would achieve the objective. Cheers, Erwin
  10. Hi Hakan, I am attempting to achieve the same results by copying some incident attributes to a problem when the "Create Problem" button is pressed. The attributes we wanted to copy are in the "Outage" tab and is on a different form. Should I modify the xx_service_outage_tab.htmpl to include the "hidden" lines? I initially added those lines in the detail_pr.htmpl, but it didn't work (none of the outage tab attributes were copied in the problem). We are on r12.5...any input would definitely be appreciated Thanks, Erwin
  11. I updated the INDEX_DOC_LINKS to link the DOC ID to the new category.
  12. Hi Erik, It's been more than a year and was wondering if you manage to have some success with this? I am attempting to do the same, and have manage to transfer SKELETONS, O_INDEXES, INDEX_DOC_LINKS. I am using r12.5, and am trying to update the RESOLUTION field, but even if I updated the SKELETONS table, the new resolution data isn't showing. I was told it is in LONG_TEXTS table too, so I will explore that later on. In the meantime, any suggestions from you would be greatly appreciated.
  13. Hi Lynette, We have set-up a couple of multi-tenant service desks on r12.5. We started with two new business groups who wanted to have their own "service desk". Those 2 are in production now. We are now mid-way on migrating the IT Service Desk to r12.5, so they will be the third tenant. By the end of this exercise, we will have 6 tenants including facilities, HR, Procurement, etc... We designed our tenancy to be hierarchical and reflect the Business unit structure, so we can align the tenancy whenever a restructure occurs. We have 3 groups with their own service desk in one Business Unit called Operations, so in the multi-tenancy hierarchy we defined Operations tenant to have 3 child tenants. Shared data can then be defined on the appropriate level. If a data object is unique for a tenant, then that is defined within that tenancy only. All users are defined in the main or Root tenant, because we assume all users might have to interact with all the tenancies. We made use of roles also to enable the user to select which tenancy they want to submit incidents or requests. When the user logs in, they will have a default role, but they can change it and select the appropriate tenancy they want to be in. For example, an analyst in the "Facilities" service desk is not an analyst in the IT Service desk. When that analyst needs to submit a request to IT Service Desk, he selects the role from the home page Role drop-down list to IT Services. Upon selection of that role, the web interface shows an "Employee" interface instead to the IT Service desk. So most of our end-users have multiple roles to submit to the appropriate Service Desk (6 of them). A few of them will be analyst in a specific Service Desk tenancy only. The constraint that the tool has is the inability to transfer an incident/request from one tenancy to another. I think it was done that way for a reason so as to maintain ownership and the ability to report on that record within that tenancy where it was first submitted to.... but there has been a lot of request to have that ability to transfer the incident/request from one tenant to another. With some spel code, it probably could be done or even create a copy and link them together... Cheers, Erwin
  14. I have a form where I want to save the value of a custom field called z_checked_by to another field (let's say requested_by). I want to keep both fields to have the same value. I tried using: <INPUT TYPE=hidden NAME=SET.requested_by VALUE="$args.z_check_by"> but it didn't work. I am surely missing something... any suggestions would be a big help to this novice. Thanks! Erwin
×
×
  • Create New...