Skip to main content

I have always struggled to get Sync Rules working correctly so have largely avoided modifiying them.  However, i need to modify the Task one as we have an issue whereby when a person gets tasked to a new Task, they only see Request Notes added after they have been Tasked.  We need them to get ALL the Previous Notes for that Request.

How i understand Sync Rules is that:

1.The Ownership Query decides who gets the data

2.The Initial Query is the one that runs when a device is initialised

3.The Related Query is the one that runs once data in the Table (Task in our case) gets updated.

The problem i have had before is when modifying the Related Query it sent too much data and clogged up the system for a week.  I had checked all the joins etc and they were all correct. I cant post it here as i undid it a long time ago.

Anyone have any pointers or tips for using and modifying these?

Hi @MartinF 

You understanding about sync rules is correct.

Specifically for the problem that you are trying to solve, there may be different ways. But, I would like to pay your attention on configuring 2 App Params. They are self explained. In simple terms, what they would do is, copying REQUEST notes to TASK notes, when new tasks are created. When you receive the task in your mobile, you will receive all those copied notes with as-is TASK sync rule.

Check if this helps you. Let us know otherwise.

/Sanjeewa


Hi @SanjeewaJ 

Thanks for the response, it was very useful. We tried this, however, there is an issue…

When a new Task is created, indeed all the Request Notes get copied to the new Task.  The problem arises because, these ‘new’ Task Notes, then get copied straight back to the request!  I believe that this functionality (of the Task Note getting copied back to Request) is standard internal FSM Functionality as i cant see any buiness rule or Client Scipt that does this?  if so, how would we stop these notes getting copied back to Request, but not stop any new Notes added directly to a Task getting copied back to Request?

Regards,

Martin


Hi @MartinF 

I am not aware of any baseline functionality, copying task notes to parent request. Did you check custom business rules associated with TASK_TEXT table? I will check further if I can figure out and get back to you. 

/Sanjeewa


Hi @SanjeewaJ 

 

We did initially think it was a business rule functionality however, however upon checking there is only one rule that runs from TASK_TEXT and that is just to send out Notifications upon certain types of notes.  I also turned the server log up to see what rules ran when a Task note was added, and nothing ran that would copy the note up to Request.


Hi @SanjeewaJ 

 

We have decided that the best way to solve our original issue is to Modify the TASK Sync Rule related query.  I have now done this in our Dev environment, but have noticed that some of the extra constraints that were in ‘SYNC Rules’ for TASK were causing some of the issues that we experienced before.  I also noticed that the TASK sync rule in ‘FSM Sync Rules’ does not have these.  Am i correct in assuming that when FSM conmes straight out of the box, there are no Sync rules set up in ‘Sync Rules’? just the factory ones in ‘FSM Sync Rules’? and that someone in our organisation (before me) must have set up all of the sync rules in ‘Sync Rules’?

 

Martin 


Hi @SanjeewaJ 

 

We have decided that the best way to solve our original issue is to Modify the TASK Sync Rule related query.  I have now done this in our Dev environment, but have noticed that some of the extra constraints that were in ‘SYNC Rules’ for TASK were causing some of the issues that we experienced before.  I also noticed that the TASK sync rule in ‘FSM Sync Rules’ does not have these.  Am i correct in assuming that when FSM conmes straight out of the box, there are no Sync rules set up in ‘Sync Rules’? just the factory ones in ‘FSM Sync Rules’? and that someone in our organisation (before me) must have set up all of the sync rules in ‘Sync Rules’?

 

Martin 

 

Hi @MartinF 

Dont think your understanding is correct.

Initially you get “FSM Sync rules” and exactly same duplicated in “Sync rules”. In other words, you get 2 set of identical sync rules in both.

Only difference is, you cannot modify “FSM Sync rules”. But you can modify “Sync rules”. Ultimately the “Sync rule” is the one applied in syncing data to mobile. If someone has modified “Sync rules” before your, “FSM Sync rules” may not be identical right now.

Additionally, if someone has introduce new tables to the system, they can create new “Sync rules” for those tables. Which you do not find in “FSM Sync rules”.

/Sanjeewa


Hi @SanjeewaJ 

 

I understand now, what i was trying to establish is that the reason that the TASK sync rule in ‘Sync Rules’ is different from the TASK Sync Rule in ‘FSM Sync Rules’ is that someone in our organisation must have previously modified it.

 

Martin


Hi @SanjeewaJ 

 

I understand now, what i was trying to establish is that the reason that the TASK sync rule in ‘Sync Rules’ is different from the TASK Sync Rule in ‘FSM Sync Rules’ is that someone in our organisation must have previously modified it.

 

Martin

Yes that is correct. It could some one who implemented the solution first.