learner
11th March 2004, 20:23
Hi,

We r running BaaN IV c4 on Win NT 4.0.

I have created a session, where by as soon as the user clicks on the button , a file specified on the form gets trasnfered to the server using function clienttoserver().

As soon as file gets transfered my temp. table also gets 1 record filling the details such a sr. no., , file name etc etc.

Now if my user deletes this records from the session, i want that the file should also be deleted physically from the server , how to do it ???


We r on win NT, and not on UNIX, i tried the below mentioned code

string comm(60)

comm = "DEL C:\serverfolder\test.txt"

and execued it using shell function, but after a minute or so it said "no more PTY's avalable"

how do i do it in Win NT ?


Regards

Learner

en@frrom
11th March 2004, 20:56
Hmmm.. I have never tried this, but from the Baan manual on Baan 5.0b (our version), it seems like this is not possible with the standard functions. To remove a file from the local client you can use remove.local.file(), and when copying from client to server using client2server() you can specify a parameter so that the file will be removed from local client after copied to server, but the other way around by server2client() that argument is not available...

NPRao
11th March 2004, 21:11
Learner,
and execued it using shell function, but after a minute or so it said "no more PTY's avalable"
You cannot use shell() on Windows OS.
This starts the vt200 compatible terminal emulator to execute the command specified in the command argument. The shell (for example, UNIX, VMS, or MPE) process is connected with the bshell by means of a pseudo tty. Running a shell does not block the bshell. You can switch to another window and perform other tasks.
Since you know the server file path, you can use the commands - file.rm() or seq.unlink() to remove the files.

dorleta
12th March 2004, 11:01
long file.rm(cons string path)

returns 1 when success a negative value when fail

learner
12th March 2004, 19:58
Hi,

yaah seq.unlink() worked for me, I executed this from server only, which means i used seq.unlink() to delete a file from a pc on LAN,

i will try from pc to pc, since i suppose from server i was able to do it because i was logged in as Adminsitrator....just a guess.

anyway, one more issue is that once the user clicks DELETE option standard baan throws a message "Do you want to Delete Yes/No" , now how do i capture yes/no options in this case, because if i use function ask.enum and relevant question code , then i asks 2 times , first time because of standard functionality and second time because i inserted ask.enum in after.choice of delete.

how to handle this situation ? how to cpature the yes/no situation thrown by standard baan ???


Regards

Learner

Hitesh Shah
13th March 2004, 07:47
Standard baan question 'Delete yes/no' can not be avoided . It's generated by standard program whenever delete button is triggerred .

U may try a custom delete button which deletes the record from main table without asking question. In that case , refreshing multi-occ records correctly without changing the respective position could be a problem.

learner
13th March 2004, 09:15
Hello,

Ok, agreed that we cannot stop that message, but can we some how detect whether user selected Yes or No from that message box, after the message box came due to standard functionality.

Regards

Learner

Hitesh Shah
13th March 2004, 10:08
Only if the user selects yes , it proceeds to the choice.mark.delete sections code (all subsections) . If user chooses 'no' , these choice.mark.delete sections are not at all executed.

learner
13th March 2004, 12:51
Hi,

Well i checked it as u said but it's not behaving like that.


choice.mark.delete:
before.choice:
message("Before.choice")

after.choice:
message("After.choice")



so once i click on the DELETE choice, it gives me :

First message comes as "Before.choice"
Second message comes as "after.choice"

and Third standard message comes as "Delete Record Yes/No "

which means these sub-sections executes without getting the Third message box i.e. standard message box

any comments .... ???

see basic requirement is when the executes the DELETE choice, he is presented with a yes/no message box, if he selects Yes , then only i want that the file should be deleted from the server.


Regards

Learner

Hitesh Shah
13th March 2004, 14:03
In nutshell, standard delete message can not be stopped or tracked . Now I recollect my earlier tests in this regard. Ur latest tests are right in this respect.