Jump to content


  • Content count

  • Joined

  • Last visited

  • Days Won


Everything posted by conanlam

  1. conanlam

    Change DB hostname

    Does anyone know how to update the DB configuration to connect to the new DB? I cannot find the related document since CA workflow has been EOL for so long.
  2. cdtj, Cool, good to know. I will need to try that exportFmt with customiz JS again, because last time I tried using custom JS, it did not work, maybe there were some error in my code. The CA document only shows three OOTB functions with exportFmt, and I only able to get "YesNo" (the CA document even provide the wrong syntax) to work. BTW, your latest custom web OP function is really cool. Conan
  3. Hi, You need to make two changes to cdtj's code. The factory should be alg and the IsCol should use persisitent_id. function zDrawAlg(value) { rs.data(alg_snap); } <PDM_MACRO name=lsWrite text="var alg_snap='';"> <PDM_MACRO name=lsWrite text=" <PDM_LIST ESC_STYLE=C FACTORY=alg WHERE=\"call_req_id = '@{list.persistent_id}'\" PREFIX=object>"> <PDM_MACRO name=lsWrite text=" var alg_type = '@{object.type.sym}';"> <PDM_MACRO name=lsWrite text=" var alg_time_stamp = '@{object.time_stamp}';"> <PDM_MACRO name=lsWrite text=" var alg_description = '@{object.description}';"> <PDM_MACRO name=lsWrite text=" var alg_analyst = '@{object.analyst.combo_name}';"> <PDM_MACRO name=lsWrite text=" alg_snap += alg_analyst + ' @ ' + alg_time_stamp + ' [' + alg_type + ']: ' + alg_description + '\n';"> <PDM_MACRO name=lsWrite text=" </PDM_LIST>"> <PDM_MACRO name=lsCol hdr="Activity" attr="persistent_id" fmtfunc=zDrawAlg sort=no> Conan
  4. Hi all, I am trying to use email to update the status of the change workflow task. The default maileater only support change, incident, problem, request, CI, contact, asset, and issue. Does anyone have experience with adding new OOTB object (ie. worfklow) or new custom object to the text_api.cfg and successed? The only workaround I can come up with is using spl code. For example the MailEater update some change custom fields containing wf_id, user UUID and new_status, this will trigger spl code to look up the workflow task and update it. But this indirect approach may fail to update wf, if someone is updating the change order. Best regards, Conan
  5. Hi all, I added some spell code for inserting workflow task between Group start task and Group end task, it added the task just fine, but those new tasks are in WAIT status instead of pending, even the group start task already completed. Is there a way to insert the task with pending status? I tried to insert the wf task with PEND status which return an error, set_attr on status failed: AHD05724:Not a valid transition. Best regards, Conan
  6. conanlam

    Notification rule setup

    venk@t Yes, you can create a site-defined condition macro to compare date. But you will need to write the code in the macro code field instead of using the add condition button. It should look like this: date now_dt; now_dt = now(); if (now_dt > sched_end_date && flag == 0) set_return_data(TRUE); else set_return_data(FALSE); Conan
  7. Hi all, Thanks to Cdtj, I am able to resolve this issue. send_wait(0, top_object(), "call_attr", "wf", "add_workflow_task", gl, // group leader chg_obj, // parent (change, issue) persid (string)NULL, //status must be NULL to insert (uuid)NULL, // asset (uuid)wf_obj.creator, // creator (any contact uuid) (string)"APP", // task type code NULL, // wf template (uuid)wf_obj.assignee, // assignee (any contact uuid) (duration)NULL, // est_duration (int)NULL, // est_cost (date)NULL, // est_completion_date (int)0, // unknown int, not DB attr (int)0, // another unknown int, not DB attr (int)(wf_obj.sequence + 1) // sequence ); new_wf_obj = msg[0]; new_chgalg_obj = msg[1]; Conan
  8. conanlam

    Can group membership be audited?

    Hi cdtj, Just tested your code, it works with a little bit of adjustment. It should be "cnt_id" and "type" is needed to insert comment. Thanks a lot for help out the community. grpmem::z_grpmem_insert(...) { logf(SIGNIFICANT, "Adding [%s] to [%s]", member.combo_name, group.last_name); uuid who; send_wait(0,top_object(), "call_attr", "cnt", "current_user_id"); who=msg[0]; // inserting into member's log send_wait(0, top_object(), "call_attr", "api", "insert_object", who, "cntalg", NULL, 0, "cnt_id", (uuid)member.id, "description", format("Contact added to [%s]", group.last_name), "type", "LOG"); // inserting into group's log send_wait(0, top_object(), "call_attr", "api", "insert_object", who, "cntalg", NULL, 0, "cnt_id", (uuid)group.id, "description", format("[%s] added to this group", member.combo_name), "type", "LOG"); } grpmem::z_grpmem_delete(...) { logf(SIGNIFICANT, "Deleting [%s] from [%s]", member.combo_name, group.last_name); uuid who; send_wait(0,top_object(), "call_attr", "cnt", "current_user_id"); who=msg[0]; // inserting into member's log //send_wait(0, top_object(), "call_attr", "api", "insert_object", who, "chgalg", gl, 0, "change_id", chg_obj.persistent_id, "type", "LOG", "description", now(), "time_spent", (duration)0); send_wait(0, top_object(), "call_attr", "api", "insert_object", who, "cntalg", NULL, 0, "cnt_id", (uuid)member.id, "description", format("Contact removed from [%s]", group.last_name), "type", "LOG"); // inserting into group's log send_wait(0, top_object(), "call_attr", "api", "insert_object", who, "cntalg", NULL, 0, "cnt_id", (uuid)group.id, "description", format("[%s] removed from this group", member.combo_name), "type", "LOG"); } Conan
  9. Hi all, I am trying to customize the incident list. Because there are different group of users use the same incident form, we set up different stored queries for them. The query will use the a customer field to identify and populate the list. In the additional search arguments, it will show (type = 'I' AND zformtype.code = 'ZXY'). And now due to different group requirements, they want different set of list columns and search filters. I tried to use the follow code to customize the filters and list colums, but it did not work. <PDM_IF "$args.search_sql_clause" : "type ='I' AND zformtype.code = 'ZXY'"> <PDM_MARCO name=sfLOOKup hdr="testing" attr=severity factory=crs_in> </PDM_IF> Anyone know how to get the current arguments value? Thanks, Conan