How to detect the first modification in a form?

hazemhazem Member Posts: 187
Hello everybody,

I have a form with a header and a subform. I want to display an error message only once; the first time the user modify any field in the form. What is the best solution to do this?

Comments

  • kinekine Member Posts: 12,562
    And why you do not change the form to non-editable. Than you do not need such an error...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • hazemhazem Member Posts: 187
    I HAVE to show the error message only once. The user must be able to modify fields and the first time he modify a field he got the error message "it's better to not modify the field!"). After that the user can choose to continue modification of fields and the message will not be displayed again.

    Please how to do this?
  • babbab Member Posts: 65
    why don't You ask a confirmation message in the OnModifyRecord trigger (Do You really want to modify? It's highly recommended to not...)
  • kinekine Member Posts: 12,562
    You can do it in another way - have non-editable form, add one buton. This button must be pressed, warning is showed and the form is enabled for editing... :-) there are many ways how to solve one task...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • hazemhazem Member Posts: 187
    The OnModifyTrigger is not activated when the user modify a field but only after going to another recordor colosing the foirm... and that's not what i need. What i need is that: when the user start modifying the value of any field in the form he got the warning message. The idea of adding a button is good but is there other solution with which we don't have to modify the structure of the form? The solution i found is to add this message in the trigger OnInputChange of all the fields but that takes a lot of time!!!! Is there other solution?
  • Miklos_HollenderMiklos_Hollender Member Posts: 1,598
    No, there is no such thing like the IsDirty attribute in MSCRM. I suggest just go by the button solution.
  • kinekine Member Posts: 12,562
    You need to look at this from correct point of view:

    Navision is DB applications driven by Events (triggers). If you want to do something and you cannot find correct trigger for that, you need to create your "own" trigger and make the user to use this trigger in correct time.

    For this example it is " creating new button which will trigger what you want, and by disabling editing make user to press this button when he want to edit the form". For example, it can be some rectangular button in left bottom corner of the form with some icon... :-)

    I can not see another simple solution for that... Because there is no simple event for "beginning of modifications"...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • hazemhazem Member Posts: 187
    Sorry but that doesn't work like i want. I think there's no solution to detect the first modification in a form rather than adding the code displaying the message in the trigger PnInputChange of all the fields!! That's boring to do but that's the only solution i found and that doesn't modify the apparence of the form :?
Sign In or Register to comment.