Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Commenting out xml code for a UI macro

Cupcake
Mega Guru

Good morning to you all,

        I have a question about commenting out .xml code for a UI macro. I saw this information that was provided and I was trying to follow it but not really that familiar with .xml code

        My name is Karen and I am having the same issue with the Delivery time. I am trying to follow your instructions of commenting out the .xml code but I am not familiar with .xml. Can you tell me exactly which line(s) need to be commented out and can you show me exactly how to comment it out. I know that you use the < !--   for the commenting, but am I commenting just one line of code or start it at one line and close it at another. I guess what I am asking is does every line that have DeliveryTime need to be commented out. See your instructions below (line 3, 5, 7, and 9):

  1. Navigate to UI Macros
  2. Locate the sc_cart_main UI macro
  3. Review the XML.   Towards the bottom of the script is the delivery_time variable definition
  4. Delete or use REM marks (<!-- blahblah -->) to exclude this bit:
  1. <j:set var="jvar_wf" value="${sc_cat_item.workflow}"/>  
  2.       <j:if test="${!empty(jvar_wf)}">  
  3.               <g:evaluate var="jvar_wf_delivery_time" jelly="true" expression="new Workflow().getEstimatedDeliveryTime(jelly.jvar_wf);" />  
  4.               <tr>  
  5.                       <j:if test="${jvar_wf_delivery_time != ''}">  
  6.                               <td>  
  7.                                     <strong>${gs.getMessage('catalog_delivery_time')}</strong>  
  8.                                     </td>                                
  9.                               <td>${jvar_wf_delivery_time}</td>  
  10.                       </j:if>  
  11.               </tr>  
  12.       </j:if>  
  13.  
  14.       <j:if test="${empty(jvar_wf)}">  
  15.               <j:if test="${sc_cat_item.delivery_plan.total_delivery_time.getDisplayValue().length > 0}">  
  16.                       <tr>  
  17.                               <td>  
  18.                                       <strong>${gs.getMessage('catalog_delivery_time')}</strong>                                                
  19.                               </td>                                
  20.                               <td>  
  21.                                       ${sc_cat_item.delivery_plan.total_delivery_time.getDisplayValue()}                                          
  22.                               </td>  
  23.                       </tr>  
  24.               </j:if>  
  25.       </j:if>        

Save your changes and your delivery time should now be

1 REPLY 1

Brad Tilton
ServiceNow Employee

I think you could do <!-- on line 13 and --> on line 26.