Solved

Trigger Sync Rule from mobile on demand

  • 19 August 2023
  • 5 replies
  • 60 views

Badge +3

Hi,

How I can create button as ‘sync now’ in mobile which technician can call the ‘PART’ sync rule. 

‘Part’ sync rule having ‘sync now’ button in FSM Smart client. Same functionality I want to achieve in Mobile via client script. 

 

Best Regards,

icon

Best answer by Shneor Cheshin 21 August 2023, 01:24

View original

5 replies

Userlevel 6
Badge +26

Hey @Akifscommunity 

I did not try this myself. But:

  1. Create an XML BR.
  2. When the rule is triggered an XML runs
      <perform_replication_for_table>
    <parameters>
    <table_name>PART</table_name>
    </parameters>
    </perform_replication_for_table>
    That should do the trick.

Cheers!

Badge +3

Hey @Shneor Cheshin 

 

But how we can trigger this from mobile app whenever required??

Userlevel 6
Badge +26

Hey @Akifscommunity 

Update a value on any table you wish and that update will trigger the BR.

I would create a custom table for that purpose.

Cheers!

Badge +3

Hi @Shneor Cheshin 

All good!!

Can we try this by another way just like using executePerform function with perform_replication_for_table into client script??

 

If Yes, then how (please provide code for understanding)?? 

Userlevel 6
Badge +26

Hey @Akifscommunity 

executePerform is not supported by the mobile client.

You will need your action to reach the FSM Server. So the options I can think of are:

  • Update a field on a screen
  • Use setDBValue ← Edit. Not relevant, according to documentation: This updated value is not synced back to the application server. If you need the value synced back to the application server, use the saveDataTransaction function
  • Use generateDataTransaction/saveDataTransaction

Cheers!

Reply