0

I always update the design of the form in the active method of the data source. Updating design means enabling or disabling buttons based on the form data source cursor. However, I face the situation in which the user receive the error of simultaneously working that means should refresh the form. when user use CTRL+SHift+F5 as it is asked in the error message, the design will not be updated even the data is updated. Because active method is not called in this case.

I investigate other methods and understand that form data source refresh method is called most of the time but not when form is initialized. It means that when the form is going to open the button is not enabled or disabled based on the first record which is cursor. The question is that what is the best place for updating design of the form based on the record? Is using form data source refresh method common to update design ?

This is the error message

Nastaran Hakimi
  • 695
  • 1
  • 16
  • 36
  • The best approach is to put your logic in one method e.g. `updateDesign` and call it whenever you need in datasource `active` method, in form `init` method etc. – Aliaksandr Maksimau Oct 28 '20 at 10:30
  • @AliaksandrMaksimau it is not enough as I said in the question. in the case that user revert changes by using CTRL+Shift +F5 the active method is not called so the data is updated for example status but the buttons are not enabled or disabled. Puting logic in the update design method is clear. – Nastaran Hakimi Oct 28 '20 at 10:36
  • 1
    you can catch this event in the `task` method – Aliaksandr Maksimau Oct 28 '20 at 10:41

1 Answers1

0

I think there is not enough information to provide a good solution for this error but basically what I'd do is to debug it setting a breakpoint in the aosValidateUpdate (or similar) to check which code is updating the row twice.

Another possible fix is to call reRead before this error happens.

Clandes
  • 61
  • 2
  • 7
  • I used Task method and it really solved my problem. – Nastaran Hakimi Dec 31 '20 at 07:31
  • There is no problem using Task (if it works) but you should avoid using it... just because it looks very strange to need it. I rarely have used it in my life and never for this case (update). Anyway, it it works... then it's OK. – Clandes Jan 03 '21 at 07:17