CA Service Management

  • 1.  Replace Function Use For Spell Code

    Posted Apr 20, 2017 09:57 AM

    Hi,
    In the description field  "  if it exists, I want to change it.
    The following code is getting syntax error. I want to use this code in spell.
    Is it possible use to replace function in spell code?
    How can I do it?

     

    Thanks

    Ozge

     

    ***

    string command2;

    var res;
    res = description.replace(/\"/g, "");

    command2 = format('launchit C:\\ODYAFiles\\Odya_ResolvedDesc\\SDFieldUpdate.exe %s %s "%s" ', call_req_id, 'zODYA_ResolvedAciklama' , res );
    logf (ERROR, format("zODYA_ResolvedAciklama alani guncellendi222 %s %s %s ", call_req_id,'zODYA_ResolvedAciklama', res ));
    exec(command2);
    ***



  • 2.  Re: Replace Function Use For Spell Code
    Best Answer

    Posted Apr 20, 2017 10:20 AM

    Hi,

    you can use gsub, here is quick description: CA SDM::.SPEL::. Gsub 

    Regards,

    cdtj



  • 3.  Re: Replace Function Use For Spell Code

    Posted Apr 21, 2017 08:55 AM

    Thanks for your help CDTJ

    We used the following code and found a solution.

     

    ***

    if(type == "RE")
    {
    string command2;
    string a;
    a = gsub(description, "\"", "");

    command2 = format('launchit C:\\ODYAFiles\\Odya_ResolvedDesc\\SDFieldUpdate.exe %s %s "%s" ', call_req_id, 'zODYA_ResolvedAciklama' , a );
    logf (ERROR, format("zODYA_ResolvedAciklama alani guncellendi %s %s %s ", call_req_id,'zODYA_ResolvedAciklama', a ));
    exec(command2);

    }

    ***

     

    Thanks & Regards 

    Ozge Ozturk