CA Service Management

  • 1.  Customization Change order Form

    Posted May 04, 2019 04:43 PM

    Hi ,

    I have couples of question.

    1. I need to make a field required based on some condition and not required based on some condition

    Like this,

    <PDM_IF "$args.zischgexist" == "NO">
    <PDM_MACRO name=dtlDropdown hdr="Urgency" attr=zurgency evt="onChange=\\\"setCOType()\\\"" lookup=no make_required="yes" whereclause="enum in (2, 1)">
    <PDM_ELSE>
    <PDM_MACRO name=dtlDropdown hdr="Urgency" attr=zurgency evt="onChange=\\\"setCOType()\\\"" lookup=no whereclause="enum in (0)">
    </PDM_IF>

    But it is not working as expected 

     

    2.I want to set field to invisible based on some condition. At the same time its required field for some condition

    So at some condition i have set like ,

    el.elements["SET.zurgency"].value = 0;

    el.elements["SET.zurgency"].style.display = "none";

    From above condition  have tried to disable the field after setting value . However the field is disabled but the value is not set .

    So change order is throwing error since its required field 

     

    3. This is something with limitation of words

    Below is working 

    <PDM_MACRO name=dtlTextbox hdr="Task Description" attr="" value="Change">

    Below is not working

    <PDM_MACRO name=dtlTextbox hdr="Task Description" attr="" value="Change Manager Approval">

    If it is less chars the value is displaying . But 2nd one value is not displaying

     

    Can anyone please help me on this?

    Any help me would be grateful 

     

     

    Thanks,

    Lakshmi



  • 2.  Re: Customization Change order Form

    Posted May 06, 2019 12:39 PM
    1. You say that it is not working as expected but do not say what you expect and what is actually happening. I assume zurgency is defined as an SREL to the urg object. The only thing I can suggest is to add the parameter factory=urg to your two PDM_MACROs.
    2. You may have to add el.elements["KEY.zurgency"].value = "Low";
    3. Try changing attr="" to attr="n/a"


  • 3.  Re: Customization Change order Form

    Posted May 06, 2019 03:11 PM

    Lindsay_Estabrooks

    Thanks for the reply

    Let me try to explain more clear.

    1.My requirement is the field Urgency should be a mandatory field when $args.zischgexist" == "NO"

    and it should not be a mandatory field when  zischgexist is yes

    But now what is happening , the field is showing as a mandatory field always or it is showing as Non-Mandatory field always.

    I have tried adding factory but no luck

     

    2. I have added el.elements["KEY.zurgency"].value = "Low";

    But the field is not hiding 

    My expectation is ,

    It should show like this and value should also be assigned at backend

    now that is not happening .So am getting 'Urgency' required while saving change order 

     

    3. No luck after adding attr="n/a"

    Here i have noticed one interesting behavior

    value ="ChangeManagerApproval"  is working fine 

    value ="Change Manager Approval"  is not working 

    It seems it is not accepting space in value 



  • 4.  Re: Customization Change order Form
    Best Answer

    Posted May 06, 2019 04:09 PM

    This is the challenge when looking at snippets of code instead of the whole form file.

    1. Let's examine when the value of $args.zischgexist is set. This value is set by the form pre-processor before the html is sent to your browser. So that when you are creating a new ticket the value of $args.zischgexist will be empty unless a default value has been specified in the attribute definition or by a data partition. When you are updating an existing ticket it will get the value from the zischgexist attribute stored in the database for the existing ticket. I'm guessing that zischgexist is the attribute behind the field with heading "change done before?" and that you are expecting the value of $args.zischgexist will be changed dynamically when the user changes the field value (that will not happen).
    2. I'm unsure where you have placed your code that is meant to set the value of zurgency and how you are invoking it.
    3. Since this is for display purposes only try:

      <PDM_MACRO name=dtlReadOnly hdr="Task Description" attr="n/a" value="Change Manager Approval">

     

     



  • 5.  Re: Customization Change order Form

    Posted May 07, 2019 02:45 PM

    Lindsay_Estabrooks

    1. Yes correct.That is what my requirement .By reading your comment i understood this is not possible. 

    Thinking about alternate way 

    2. Let me show code how i have implemented

    function toggleCOType()
    {
    var el = document.main_form;
    var toggle = el.elements["SET.zischgexist"].value;
    if ( toggle == 0) {
    el.elements["SET.zurgency"].value= 1;
    el.elements["SET.chgtype"].value = 400051;
    }
    else {
    el.elements["SET.zurgency"].value= 0;
    el.elements["SET.zurgency"].style.display = "none";
    el.elements["SET.chgtype"].value = 100;
    }
    }

    <PDM_MACRO name=dtlDropdown hdr="change done before?" attr="zischgexist" evt="onChange=\\\"toggleCOType()\\\""> 

    I did confirm conditions are satisfying 

     

    3.Thanks..This one worked !!