Solved

[FSM Mobile 5.6.3] Updating Travel/Work times on task status change

  • 10 December 2019
  • 2 replies
  • 209 views

Userlevel 2
Badge +4

I am attempting to get the Mobile app to update the TASK.ACTUAL_TRAVEL_START_DTTM field with the current time when the task status is changed from Assigned to En-route via the mobile app.

I can update the value via client scripting, however I cannot figure out how to trigger it ONLY when the task status changes from  Assigned to En-route.

I had thought about updating via a business rule however I would not catch the exact time of when the status is changed on mobile, only when it is synced.

Thanks in advance for advice!

icon

Best answer by Chandima Athukorala 11 December 2019, 14:07

View original

2 replies

Userlevel 3
Badge +6

Hi Ethan M        

I think you should  try with XML business rule on TASK_EVENT table by considering EVENT_TYPE(old and new values) , and EVENT_DTTM or AUDIT_DTTM  columns. That's is,

If  EVENT_TYPE  value changed to ENROUTE Then perform Update XML messages like

<update_task>
        <task>
          <update>
            <original_task>
              <task_id>@task_id</task_id>
            </original_task>
          </update>
          <task_id>@task_id</task_id>
          <actual_travel_start_dttm>@event_dttm</actual_travel_start_dttm> 
        </task>
      </update_task>

Userlevel 2
Badge +4

Hi Ethan M        

I think you should  try with XML business rule on TASK_EVENT table by considering EVENT_TYPE(old and new values) , and EVENT_DTTM or AUDIT_DTTM  columns. That's is,

If  EVENT_TYPE  value changed to ENROUTE Then perform Update XML messages like

<update_task>
        <task>
          <update>
            <original_task>
              <task_id>@task_id</task_id>
            </original_task>
          </update>
          <task_id>@task_id</task_id>
          <actual_travel_start_dttm>@event_dttm</actual_travel_start_dttm> 
        </task>
      </update_task>

I’ll have to toy around with that but that should work - I was thinking that the event_dttm would be the time it syncs rather than when the event happened, but it does actually do the correct time.

Thanks!

 

Reply