Jump to content

Recommended Posts

Dears,

I am trying to update cr ref_num in sdm version 17 to be as catalog request id using external_system_ticket ( CASC-0000-0000)

I wrote a post_validate trigger on cr when insert,

When trying to use strinh split () function then my spell server down.

 

Is there any way to update the ref_num ?

 

Link to post
Share on other sites

/////////////////

MOD FILE

/////////////

OBJECT cr{
  TRIGGERS {
  POST_VALIDATE z_update_usm_values() 100 FILTER( ( EVENT("INSERT")));

  };

};

 

//////////////

SPL FILE

/////////////

O

cr::z_update_usm_values(...) {

if( ! is_null(external_system_ticket))
{  string dest[];
split(dest,external_system_ticket,"-"); 
send_wait(0, this, "call_attr", "ref_num", "set_val", dest[2], "SURE_SET");}

return;

}

Link to post
Share on other sites

split () and extract () not allowed on object attributes: dest
02/21 14:47:24.16 Demo           spelsrvr             2640 ERROR        script.y              3882 C:/PROGRA~2/CA/SERVIC~1/site/mods/majic/z_update_usm_values.spl at (8) Variable type mismatch
02/21 14:47:24.16 Demo           spelsrvr             2640 ERROR        script.y              3882 C:/PROGRA~2/CA/SERVIC~1/site/mods/majic/z_update_usm_values.spl at (11) Object attribute "dest" can't be an array
02/21 14:47:24.16 Demo           spelsrvr             2640 ERROR        intpnoex.c             640 Error 3 processing Spell file C:/PROGRA~2/CA/SERVIC~1/site/mods/majic/z_update_usm_values.spl

Link to post
Share on other sites

I solved the issue 

here is the code 

cr::z_update_usm_values(...) {

if( ! is_null(external_system_ticket))
{

string arr[3];
split(arr,(string)external_system_ticket,"-");
  

send_wait(0, this, "call_attr", "zusmrequestid", "set_val", (int)arr[2], "SURE_SET");
send_wait(0, this, "call_attr", "zusmrequestitemid", "set_val", (int)arr[1], "SURE_SET");
send_wait(0, this, "call_attr", "ref_num", "set_val", arr[2], "SURE_SET");

}

return;

}

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...