Popup message when user apply changes in the system.

heeheelimheeheelim Member Posts: 17
edited 2005-09-20 in Navision Attain
I wish to create a popup confirmation message whenever user exit from a screen with changes applied.

For example, when a user exit from the Item form while adding a new item or modify the existing item, the system will prompt a confirmation message whether to save the changes.

If the user select ‘Yes’ the system will apply the changes but if the user choose ‘No’ the system will discard the changes.

If the user doesn’t complete all the columns in order for the system to apply the changes, the system will prompt out a message saying that the necessary column is not complete and the system will go back to the previous screen for user to complete the necessary column.

I would like to remove the Escape function to ensure that user exit from the screen properly.

Objective :
1. To minimize error while maintaining the system.
2. To make sure chnages that done by user is apply

Does anyone know how can i make it? thanks..
Regards.

Comments

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    You could make some changes to the Change Log functionality to avoid to make changes on every form where you want to add this feature:

    - Add a new field "Confirm Changes" (type Boolean) to table 403 "Change Log Setup (Table)" & form 593 "Change Log Setup (Table) List".
    - Activate Change Log for table 27 Item and place a checkmark in the new field
    - Modify function GetTableTriggerMask in codeunit 423 "Change Log Management":
    //*** 001 BEGIN
    //  IF "Log Modification" <> "Log Modification"::" " THEN
      IF ("Log Modification" <> "Log Modification"::" ") OR("Confirm Modification") THEN
    //*** 001 END
    

    - Add following code at the start of function LogModification in codeunit 423 "Change Log Management":
    //*** 001 BEGIN
    IF NOT ChangeLogSetupRead THEN BEGIN
      IF ChangeLogSetup.GET THEN;
      ChangeLogSetupRead := TRUE;
    END;
    
    IF recChangeLogSetupTable.GET(RecRef.NUMBER) THEN;
    
    IF ChangeLogSetup."Change Log Activated" THEN BEGIN
      IF recChangeLogSetupTable."Confirm Changes" THEN BEGIN
        IF NOT CONFIRM('Do you want to save changes?') THEN BEGIN
          FOR i := 1 TO RecRef.FIELDCOUNT DO BEGIN
            FldRef := RecRef.FIELDINDEX(i);
            xFldRef := xRecRef.FIELDINDEX(i);
            IF IsNormalField(RecRef.NUMBER,FldRef.NUMBER) THEN
              IF FORMAT(FldRef.VALUE) <> FORMAT(xFldRef.VALUE) THEN
                FldRef.VALUE := xFldRef.VALUE;
          END;
          EXIT;
        END;
      END;
    END;
    //*** 001 END
    
    Hope this gets you started.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
Sign In or Register to comment.