ZUP-file Management

AdministratorAdministrator Member, Moderator, Administrator Posts: 2,500
edited 2007-09-18 in Download section
ZUP-file Management
Have you ever spend minutes trying to explain a user how to delete his/her zup-file??

These functions can be used to 'clear' the zup-file if problems have occurred. All done by the user him-/herself by selecting a menuitem!
The zup-file will be re-initialized to a default state determined by the programmer implementing the codeunit.

Feel free to use my code as you will.
If you have the time it is farely simple to save the zup-file as a blob or as values in a table, so you can store several zup-files to choose from instead of just an empty one.

http://www.mibuso.com/dlinfo.asp?FileID=892

Discuss this download here.

Comments

  • Miklos_HollenderMiklos_Hollender Member Posts: 1,598
    Interesting, although instead of trying to explain anything I've always solved it by putting a BAT file on their desktops saying del "C:\Documents and Settings\%USERNAME%\Application Data\fin.zup"

    (Don't remember the correct path off the top of my head but the main point is the %USERNAME% trick)

    Anyway, this solution is way more elegant, so thanks a lot!
  • PrebenRasmussenPrebenRasmussen Member Posts: 137
    edited 2007-09-17
    Miklos, Thank you for the nice words.

    I am normally only using the ID parameter, so I missed managing the use of other parameters.

    An update has just been uploaded. (Thanks to AVP for 'correcting' my code)
    loctxtFilename := COMMANDLINE;
    IF STRPOS(UPPERCASE(loctxtFilename), 'ID=') = 0 THEN
      loctxtFilename := 'fin.zup'
    ELSE BEGIN
      loctxtFilename := COPYSTR(loctxtFilename, STRPOS(UPPERCASE(loctxtFilename), 'ID=') + 3);
      IF STRPOS(loctxtFilename, ',') > 0 THEN
        loctxtFilename := COPYSTR(loctxtFilename, 1, STRPOS(UPPERCASE(loctxtFilename), ',') - 1);
      IF STRPOS(UPPERCASE(loctxtFilename), '.ZUP') = 0 THEN
        loctxtFilename := loctxtFilename + '.zup';
    END;
    IF STRPOS(loctxtFilename, ':') = 0 THEN BEGIN
      loctxtPath := ENVIRON('USERPROFILE');
      IF COPYSTR(loctxtPath, STRLEN(loctxtPath), 1) <> '\' THEN
        loctxtPath := loctxtPath + '\';
      loctxtPath := loctxtPath + 'Application Data\' + loctxtFilename;
    END ELSE
      loctxtPath := loctxtFilename;
    
  • AdministratorAdministrator Member, Moderator, Administrator Posts: 2,500
    ZUP-file Management
    Have you ever spend minutes trying to explain a user how to delete his/her zup-file??

    These functions can be used to 'clear' the zup-file if problems have occurred. All done by the user him-/herself by selecting a menuitem!
    The zup-file will be re-initialized to a default state determined by the programmer implementing the codeunit.

    Feel free to use my code as you will.
    If you have the time it is farely simple to save the zup-file as a blob or as values in a table, so you can store several zup-files to choose from instead of just an empty one.

    UPDATE 2007-09-17:
    Update to allow for other parameters. Thanks to AVP.

    http://www.mibuso.com/dlinfo.asp?FileID=892

    Discuss this download here.
  • Timo_LässerTimo_Lässer Member Posts: 481
    Great Tool!
    (I added the procedures to my private Tools DB with credits for you and a link to this topic.)

    Please note that the path name for 'Application Data' can change from country to country.
    In a german Windows installation it is named 'Anwendungsdaten', so you should use a TextConst or use 'APPDATA' instead of 'USERPROFILE'.

    Furthermore you check the path for ':' which means that the zup file must be stored on a local HDD.
    It doesn't make sense but it is possible that there is entered an UNC path like \\Server\Share\Folder\Fin.zup
    I suggest that you check for '\' instead of ':'
    IF STRPOS(loctxtFilename, '\') = 0 THEN BEGIN
      loctxtPath := ENVIRON(APPDATA);
      IF COPYSTR(loctxtPath, STRLEN(loctxtPath), 1) <> '\' THEN
        loctxtPath := loctxtPath + '\';
      loctxtPath := loctxtPath + loctxtFilename;
    END ELSE
      loctxtPath := loctxtFilename;
    
    Timo Lässer
    Microsoft Dynamics NAV Developer since 1997
    MSDynamics.de - German Microsoft Dynamics Community - member of [clip]
  • PrebenRasmussenPrebenRasmussen Member Posts: 137
    Thanks Timo - changed that too!

    New file uploaded.
  • AdministratorAdministrator Member, Moderator, Administrator Posts: 2,500
    ZUP-file Management
    Have you ever spend minutes trying to explain a user how to delete his/her zup-file??

    These functions can be used to 'clear' the zup-file if problems have occurred. All done by the user him-/herself by selecting a menuitem!
    The zup-file will be re-initialized to a default state determined by the programmer implementing the codeunit.

    Feel free to use my code as you will.
    If you have the time it is farely simple to save the zup-file as a blob or as values in a table, so you can store several zup-files to choose from instead of just an empty one.

    UPDATE 2007-09-18:
    Update to use APPDATA instead of USERDATA and search for '\' instead of ':'. Thanks to Timo.

    UPDATE 2007-09-17:
    Update to allow for other parameters. Thanks to AVP.

    http://www.mibuso.com/dlinfo.asp?FileID=892

    Discuss this download here.
Sign In or Register to comment.