Skip to main content
Solved

How to do > and < in execquery

  • September 2, 2024
  • 6 replies
  • 63 views

Forum|alt.badge.img+9

Trying to check for open service orders. 
This works, but checks for only one status. 

<root xmlns="http://astea.com.schema.bc.service_order">
<session email="" alias="">
<state bc_name="service_order">
<action name="execquery">
<attribute in_var="" out_var="" entity_name="order_locator" query_name="order_locator_scrl"
sort_column_direction="+" sort_column_alias="request_id"/>
<attribute dtype="argument" name="where_cond"
value="(serial_no = '3090R720141') and (order_stat_uniq_id = 100)" operator="="/>
</action>
</state>
</session>
</root>

I want to check for < 500, but it does not parse as valid xml.
Any ideas?

<root xmlns="http://astea.com.schema.bc.service_order">
<session email="" alias="">
<state bc_name="service_order">
<action name="execquery">
<attribute in_var="" out_var="" entity_name="order_locator" query_name="order_locator_scrl"
sort_column_direction="+" sort_column_alias="request_id"/>
<attribute dtype="argument" name="where_cond"
value="(serial_no = '3090R720141') and (order_stat_uniq_id < 500)" operator="="/>
</action>
</state>
</session>
</root>

 

Best answer by Joshua Liem

Hi Chris,

 

Try the below API

 

<root xmlns="http://astea.com.schema.bc.service_order">
  <session email="" alias="">
    <state bc_name="service_order">
      <action name="execquery">
        <attribute in_var="" out_var="" entity_name="order_locator" query_name="order_locator_scrl"
                   sort_column_direction="+" sort_column_alias="request_id"/>
        <attribute dtype="argument" name="where_cond"
                   value="(serial_no = '3090R720141') and (order_stat_uniq_id &amp;lt; 500)" operator="="/>
      </action>
    </state>
  </session>
</root>

6 replies

Forum|alt.badge.img+10

Try using the XML escape codes. &lt; for < and &gt; for >


SaaAvinak
Do Gooder (Customer)
Forum|alt.badge.img+7
  • September 2, 2024

Hello @csjohnstone ,

try using &lt; for the less-than

Hope that works. 

value="(serial_no = '3090R720141') and (order_stat_uniq_id &lt; 500)" 

Forum|alt.badge.img+9
  • Author
  • Sidekick (Customer)
  • September 2, 2024

Try using the XML escape codes. &lt; for < and &gt; for >

Hello @csjohnstone ,

try using &lt; for the less-than

Hope that works. 

value="(serial_no = '3090R720141') and (order_stat_uniq_id &lt; 500)" 

Tried that. &gt; works. &lt; doesn't 🙃

 


Forum|alt.badge.img+9
  • Author
  • Sidekick (Customer)
  • September 2, 2024

🤔🤔🤔🤔🤔🤔


Forum|alt.badge.img+12
  • Superhero (Employee)
  • Answer
  • September 2, 2024

Hi Chris,

 

Try the below API

 

<root xmlns="http://astea.com.schema.bc.service_order">
  <session email="" alias="">
    <state bc_name="service_order">
      <action name="execquery">
        <attribute in_var="" out_var="" entity_name="order_locator" query_name="order_locator_scrl"
                   sort_column_direction="+" sort_column_alias="request_id"/>
        <attribute dtype="argument" name="where_cond"
                   value="(serial_no = '3090R720141') and (order_stat_uniq_id &amp;lt; 500)" operator="="/>
      </action>
    </state>
  </session>
</root>


Forum|alt.badge.img+9
  • Author
  • Sidekick (Customer)
  • September 2, 2024

Hi Chris,

 

Try the below API

 

<root xmlns="http://astea.com.schema.bc.service_order">
  <session email="" alias="">
    <state bc_name="service_order">
      <action name="execquery">
        <attribute in_var="" out_var="" entity_name="order_locator" query_name="order_locator_scrl"
                   sort_column_direction="+" sort_column_alias="request_id"/>
        <attribute dtype="argument" name="where_cond"
                   value="(serial_no = '3090R720141') and (order_stat_uniq_id &amp;lt; 500)" operator="="/>
      </action>
    </state>
  </session>
</root>

That worked! Thanks Joshua.