mibuso.com

Microsoft Business Solutions online community
It is currently Fri Apr 25, 2014 4:52 am

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: ZUP-file Management
PostPosted: Fri Sep 14, 2007 10:14 pm 
Offline
Site Admin

Joined: Sun Nov 07, 1999 8:01 am
Posts: 2018
Location: Wilrijk, Belgium
Country: Belgium (be)
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.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 17, 2007 10:25 am 
Offline

Joined: Tue Apr 11, 2006 10:00 pm
Posts: 1315
Location: Vienna
Country: Austria (at)
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!

_________________
Sorry, no support using PM, e-mail or MSN - please use this forum.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 17, 2007 1:58 pm 
Offline

Joined: Thu Jul 20, 2000 7:01 am
Posts: 121
Location: Vejle
Country: Denmark (dk)
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)

Code: Select all
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;


Last edited by PrebenRasmussen on Mon Sep 17, 2007 3:14 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: ZUP-file Management
PostPosted: Mon Sep 17, 2007 3:05 pm 
Offline
Site Admin

Joined: Sun Nov 07, 1999 8:01 am
Posts: 2018
Location: Wilrijk, Belgium
Country: Belgium (be)
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.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 17, 2007 4:09 pm 
Offline

Joined: Tue Oct 14, 2003 2:59 pm
Posts: 471
Location: Dortmund - Germany
Country: Germany (de)
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 ':'

Code: Select all
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
Navision Developer since 1997
MSDynamics.de - German Microsoft Dynamics Community - member of [clip]


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 17, 2007 8:02 pm 
Offline

Joined: Thu Jul 20, 2000 7:01 am
Posts: 121
Location: Vejle
Country: Denmark (dk)
Thanks Timo - changed that too!

New file uploaded.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 18, 2007 10:43 am 
Offline
Site Admin

Joined: Sun Nov 07, 1999 8:01 am
Posts: 2018
Location: Wilrijk, Belgium
Country: Belgium (be)
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum


Search for:
Jump to: