Solved

Mobile Sync Rule - Initial Query

  • 17 June 2020
  • 1 reply
  • 219 views

Userlevel 3
Badge +8

The below XML gives an error 

 

EXCEPTION Message: String was not recognized as a valid DateTime. ... Stack Trace:    at Metrix.BusinessServer.BusinessPolicies.SharedTablesComponent.MobileManager.PerformReplicationForTableAndPerson(String tableNameIn, String personIdIn, Boolean truncateTableIn, String deviceSequenceIn, SQLiteCommand sqliteCommandIn, mm_process_defRow syncRuleIn, Dictionary`2 tableColumnsDictionaryIn)
   at Metrix.BusinessServer.BusinessPolicies.SharedTablesComponent.MobileManager.PerformInitializeMobileDevice(String personId, String deviceSequence, String message, SQLiteConnection theSQLiteDB, Dictionary`2 theSyncRuleTableColumnsDictionary)

 

<hierarchy_select return_only_requested_attrs="true" max_rows='50000'>
 <primary_table>PERSON_CAL_EXCEPT</primary_table>
 <from>
  <table>PERSON_CAL_EXCEPT</table>
 </from>
 <attrs>
  <attr>PERSON_CAL_EXCEPT.*</attr>
 </attrs>
 <where>
  <data_constraint>
   <constraint>
    <left_operand>PERSON_CAL_EXCEPT.PERSON_ID</left_operand>
    <operator>eq</operator>
    <right_operand>{PERSON_ID}</right_operand>
   </constraint>
   <constraint>
    <left_operand>PERSON_CAL_EXCEPT.END_DTTM</left_operand>
    <operator>gt</operator>
    <right_operand>@expression[now()+days(-30)]</right_operand>
   </constraint>
  </data_constraint>
 </where>
</hierarchy_select>

icon

Best answer by anmise 12 August 2020, 15:45

View original

1 reply

Userlevel 7

The below XML gives an error 

 

EXCEPTION Message: String was not recognized as a valid DateTime. ... Stack Trace:    at Metrix.BusinessServer.BusinessPolicies.SharedTablesComponent.MobileManager.PerformReplicationForTableAndPerson(String tableNameIn, String personIdIn, Boolean truncateTableIn, String deviceSequenceIn, SQLiteCommand sqliteCommandIn, mm_process_defRow syncRuleIn, Dictionary`2 tableColumnsDictionaryIn)
   at Metrix.BusinessServer.BusinessPolicies.SharedTablesComponent.MobileManager.PerformInitializeMobileDevice(String personId, String deviceSequence, String message, SQLiteConnection theSQLiteDB, Dictionary`2 theSyncRuleTableColumnsDictionary)

 

<hierarchy_select return_only_requested_attrs="true" max_rows='50000'>
 <primary_table>PERSON_CAL_EXCEPT</primary_table>
 <from>
  <table>PERSON_CAL_EXCEPT</table>
 </from>
 <attrs>
  <attr>PERSON_CAL_EXCEPT.*</attr>
 </attrs>
 <where>
  <data_constraint>
   <constraint>
    <left_operand>PERSON_CAL_EXCEPT.PERSON_ID</left_operand>
    <operator>eq</operator>
    <right_operand>{PERSON_ID}</right_operand>
   </constraint>
   <constraint>
    <left_operand>PERSON_CAL_EXCEPT.END_DTTM</left_operand>
    <operator>gt</operator>
    <right_operand>@expression[now()+days(-30)]</right_operand>
   </constraint>
  </data_constraint>
 </where>
</hierarchy_select>

Not sure if you can use that type of expression in the xml. One idea is to create a user_def field in the person_cal_except view with that expression and then refer to that e.g.

 <constraint>
    <left_operand>PERSON_CAL_EXCEPT.END_DTTM</left_operand>
    <operator>gt</operator>
    <right_operand>user_def_dttm1</right_operand>
   </constraint>

Reply