Clarity Service Management

Expand all | Collapse all

customize SET.OEMAIL and SET.OPHONE

  • 1.  customize SET.OEMAIL and SET.OPHONE

    Posted 02-09-2018 08:38 AM

    Hi 

     

    There is a requirement to capture the Set.OEMAIL and SET.OPHONE from the Incident/Request form ( Employee) which is a variable and pushing data in Description of Initial Activity Logs.

     

    Is there any way to capture these values if customer changes or what ever is available in the form in custom fields in Call_Req. We want this data to be populated at form level (either javascript) as we have to do manupulations at POST_VALIDATE later on.


    I have tried below things but the output is partial

    1. I have changed the out of the box function but result is 0

     

    function check_and_save() {
    if ( window.document.forms["main_form"].elements["SET.SET.OPHONE"].value.length > 0 ||
    window.document.forms["main_form"].elements["SET.SET.OEMAIL"].value.length > 0 )
    {
    sap_category=window.document.forms["main_form"].elements["SET.SET.OEMAIL"].value;
    call_save();}

     

    2. I have added below lines but it does not populating updated values (customer typing at the time of loggin)

    <input type=hidden name=SET.zcuemailid value="$arg.SET.OPHONE"> 

     

    3. I have also changed the fields like below instead of SET.OPHONE then two issues are coming. One Email id is showing as abc$acd.com. It's replacing the @ value with $ in at the time of logging.

     

    <PDM_IF "$args.sap_category" == "">
    <PDM_SET args.sap_category="$cst.phone_number">

    </PDM_IF>
    <PDM_MACRO name=dtlTextbox hdr="Phone Number" attr=sap_category size=30>

     

    <PDM_IF "$args.zcuemailid" == "">
    <PDM_SET args.zcuemailid ="$cst.email_address">

    </PDM_IF>
    <PDM_MACRO name=dtlTextbox hdr="Email Address" attr=zcuemailid  size=30>

     

    Second issue with this code, actual phone number and email id is showing in Activity logs. I have removed fields like OPHONE and OEMAIL, still it's showing values but original one which are available in Database for that employee.

     

    Any idea to get the newly entered values of Ophone and OEmail in 2 different custom columns.

     

    Thanks

    Mayur



  • 2.  Re: customize SET.OEMAIL and SET.OPHONE

    Posted 03-05-2018 03:46 AM

    Hi Mayur.

     

    Unfortunately, the value processing of OPHONE and OEMAIL is completely capsulated in the webengine

     

    So , your approach to submit these values to some additional attributes is the only way to be able to handle these values on your own.

     

    If you want to store the OPHONE value into your sap_category Attribute and the OEMAIL into zcuemailid  attribute, you are almost there.

     

    First you need some html input fields fpr sap_category and zcuemailid in the html form which gets submitted from the GUI.You already have that by your lines:

     

    <PDM_MACRO name=dtlTextbox hdr="Phone Number" attr=sap_category size=30>
    <PDM_MACRO name=dtlTextbox hdr="Email Address" attr=zcuemailid  size=30>

     

    Second before submitting the form to the server you need to copy the actual values of OPHONE and OEMAIL into these input fields.
    This can be done in your check_and_save function

     

    function check_and_save() {
      if ( window.document.forms["main_form"].elements["SET.SET.OPHONE"].value.length > 0 )
      window.document.forms["main_form"].elements["SET.sap_category"].value=window.document.forms["main_form"].elements["SET.SET.OPHONE"].value;
     
      if ( window.document.forms["main_form"].elements["SET.SET.OEMAIL"].value.length > 0 )
      window.document.forms["main_form"].elements["SET.zcuemailid"].value=window.document.forms["main_form"].elements["SET.SET.OEMAIL"].value;

      call_save();}
    }

     

    I did not test this code in my environment, so no warranty
     
    In general you might think about to remove the OPHONE and OEMAIL input fields from you employee form, and just substitute them by the attributes you really need.

     

    Hope that helps.
    Kind regards
    ..........Michael



  • 3.  Re: customize SET.OEMAIL and SET.OPHONE

    Posted 03-05-2018 04:41 AM

    I tried to update same below things are going on.

     

    1.       There are two fields one for SET.OEMAIL and other one for zcuemailid

     

    2.       SET.OEMAIL is being populated with code –   for my attribute zcuemailid then field value @ attribute for email to $.

     

    Thanks

    This communication is the property of CenturyLink and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.



  • 4.  Re: customize SET.OEMAIL and SET.OPHONE

    Posted 03-05-2018 08:02 AM

    Sorry Mayur.

    I don't understand your comments. Please ellaborate in more detail, what have you tested , and what was  working and what not.

    To1) : yes of course you've added another input field for zcuemailid  by your pdm_macro line. Your Expectations are not clear to me.

    To 2) I Don't understand your comment at at all.

     

    I just recognized a mistake in my check_and_save function example. Here is a corrected one( removed the doubled "SET.SET."):

     

    function check_and_save() {
      if ( window.document.forms["main_form"].elements["SET.OPHONE"].value.length > 0 )
      window.document.forms["main_form"].elements["SET.sap_category"].value=window.document.forms["main_form"].elements["SET.OPHONE"].value;
     
      if ( window.document.forms["main_form"].elements["SET.OEMAIL"].value.length > 0 )
      window.document.forms["main_form"].elements["SET.zcuemailid"].value=window.document.forms["main_form"].elements["SET.OEMAIL"].value;

      call_save();}
    }

     

    As said, this is not tested and based on the code you already provided.

    Thanks

    ..........Michael



  • 5.  Re: customize SET.OEMAIL and SET.OPHONE

    Posted 03-05-2018 08:14 AM

    Hi Michael,

     

    My requirement is to just fill OPHONE and OEMAIL values to custom column.

     

    If customer changes the values in Phone Number and email which is auto-populating the logged in User details in Incident/Request page of Employee then those change values to be saved in Custom columns otherwise if customer does not changes the values in Phone number and  Email Id then their system actual values to be saved in Custom columns.

     

    But we only want 2 columns in Incident / Request Page, one for Phone Number and other for Email ID.

     

    Thanks

    Mayur

    This communication is the property of CenturyLink and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.



  • 6.  Re: customize SET.OEMAIL and SET.OPHONE

    Posted 03-05-2018 08:30 AM

    Hello Michael,

     

    I have tried below things and found below results.

     

     

    1.       I have tried below code just you mentioned

     

    function check_and_save() {

      if ( window.document.forms["main_form"].elements["SET.SET.OPHONE"].value.length > 0 )

      window.document.forms["main_form"].elements["SET.sap_category"].value=window.document.forms["main_form"].elements["SET.SET.OPHONE"].value;

     

      if ( window.document.forms["main_form"].elements["SET.SET.OEMAIL"].value.length > 0 )

      window.document.forms["main_form"].elements["SET.zcuemailid"].value=window.document.forms["main_form"].elements["SET.SET.OEMAIL"].value;

     

      call_save();}

    }

     

     

     

    By using this code , SET.OEMAIL is auto-poputing but custom column is not populating default value and even changed one is also not populating.

     

    But there are two fields showing in Incident Form, one for SET.OEMAIL and other one for zcuemailid.

     

    And SET.OEMAIL is being populated with code –  converted to abc$gmail.com at the time of ticket logging.

     

    Thanks

    Mayur

    This communication is the property of CenturyLink and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.



  • 7.  Re: customize SET.OEMAIL and SET.OPHONE



  • 8.  Re: customize SET.OEMAIL and SET.OPHONE

    Posted 03-05-2018 11:41 AM

    Hi Mayur.

     

    I finally was able to get it to run on my test environment.

    Here are the changes I made to site/mods/www/htmpl/web/employee/detail_in.htmpl :

     

    I added the bold lines to the function "call_save" just before any othe Code in that function.

    ...

    function call_save()
    {  
     if ( window.document.forms["main_form"].elements["SET.SET.OPHONE"].value.length > 0 ){
         window.document.forms["main_form"].elements["SET.sap_category"].value=window.document.forms["main_form"].elements["SET.SET.OPHONE"].value;
     }
      
     if ( window.document.forms["main_form"].elements["SET.SET.OEMAIL"].value.length > 0 ) {
         window.document.forms["main_form"].elements["SET.zcuemailid"].value=window.document.forms["main_form"].elements["SET.SET.OEMAIL"].value;
     }

    ...

     

     

    I added the bold lines just after the dtlStart macro

     

    <PDM_MACRO name=dtlStart>
    </SCRIPT>
    <INPUT TYPE=HIDDEN NAME="SET.sap_category" VALUE="">
    <INPUT TYPE=HIDDEN NAME="SET.zcuemailid" VALUE="">

    ...

     

    Sorry for any inconvinience.Hope that helps

    Regards

    ...........Michael