Refresh form

geri79geri79 Member Posts: 105
Hello,

in the "OnModify" of Job Budget Entry I call a Codeunit wich sums some fields in the Job Table. Something like Budget(Flowfield)-Usage(Flowfield)=Remaining Budget(Normal field) (simplified).

User often call the Job Budget with button Planning in the Job Card.
When they change the Budget, they Code Unit is called but the form is not refreshed. When the change the record and change back, the correct info is shown.

Any good ideas how refresh the form? I tried OnTimer CurrForm.Update, but this causes problems when user want to enter data in other fields.

Is there maybe a possibility to call OnTimer only if the page of the form is "mypage"?

My work around is an "update" - Button on the form which calls the CU again. But that is not very nice...

Thx for any help

geri79
geri

Comments

  • kinekine Member Posts: 12,562
    All can be done through CurrForm.UPDATE(True/False). If you call it in correct trigger on correct spot with correct parameter, it will form. But of course, if you e.g. open non-modal form where you are changing the data, and you have some value calculated over this data on the original form, the value will be not automatically updated (the form do not know when to update the data).
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • KYDutchieKYDutchie Member Posts: 345
    Hi,

    Just for my understanding, you have a field on the job card, that does not update when you change something in the Job Budget?

    If that is the case, you can go to your planning menubutton, click menuitems.
    Then replace the runobject with a trigger that calls the Job Budget form and make the last statement of your trigger CurrForm.Update.

    Hope this helps,

    Willy
    Fostering a homeless, abused child is the hardest yet most rewarding thing I have ever done.
  • geri79geri79 Member Posts: 105
    Thanks for your help. Unfortunately it is like Kriki described. The form is called modally.

    KYDutchie's hint is good, but the problem is not solved, because users can also change the budget using the drill down of the flow field.

    2 new questions:

    Instead of currform.update can i do s.th. like: Jobcard.update(rec."job no.") ... i don't think so...

    Would it be could to change the "DrillDown-Form" of the Budget to a non editable form and then follow KYDutchie's idea? What do you think?
    geri
Sign In or Register to comment.