CA Service Management

 View Only
  • 1.  Replace Function Use For Spell Code

    Posted Apr 20, 2017 09:57 AM

    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?






    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 ));

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

    Posted Apr 20, 2017 10:20 AM


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



  • 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 ));




    Thanks & Regards 

    Ozge Ozturk