Done Event - WeOnlyDo Discussion board

Done Event (wodFtpDLX / wodFtpDLX.NET)

by S Styer, Tuesday, June 10, 2014, 18:33 (3605 days ago)

I need certain things to happen after I transmit some files to an ftp site
the user is telling me... that if you go to another application
while the program is displaying the print message.... that it seems to
continue past that point. Just because they moved to Outlook... after doing a cut and paste
I'm trying to get the Done event... to wait
until all the steps are completed (printing, etc)
is it possible that it's jumping past that point?
can I hold the event at the messagebox?


int r, save_days
long i_row
string s_file, ls_part, trans_type, save_pool, v_other, out_dir, pdf_save, folder_path
double save_net
datetime save_date
time s_time

if errorcode <> 0 then
messagebox('ERROR',errortext)
close(parent)
return
end if
if p_state = 1 then
s_file = file_name + '.asc'
move_file = s_file
out_dir = '/Inbound/Encrypted'
p_state = 5
ole_ftp.object.putfile(s_file, out_dir )
return
end if
if p_state = 5 then
nbr_in_dw = dw_3.rowcount()
for i_row = 1 to dw_3.rowcount()
ls_part = dw_3.getitemstring(i_row,'pool_part_no')
trans_type = dw_3.getitemstring(i_row,"jpmc_transmit_rec_type")
s_time = now()
do until string(s_time,"ss") <> string(now(),"ss")
loop

if trans_type = 'F' then
save_net = dw_3.getitemnumber(i_row,'jpmc_transmit_net_pay')
save_days = dw_3.getitemnumber(i_row,'jpmc_transmit_days')

v_other = 'Pay ' + string(round(save_net,2)) + ' : Batch - '
else
v_other = 'Batch - ' + string(batch_id) + ' File - ' + mid(file_name, lastpos(file_name,"\")+1,len(file_name))
end if

dw_3.setitem(i_row,"jpmc_transmit_sent_date", d_time)
dw_3.setitem(i_row,"jpmc_transmit_sent_status",'S')
dw_3.setitem(i_row,"jpmc_transmit_batch_id",batch_id)
dw_3.setitem(i_row,"jpmc_transmit_file_name",hold_file_move)
next

If dw_3.Update() = 1 Then
if dw_hist.update() = 1 then
if dw_card.update() = 1 then
Commit;
else
messagebox('Error','Failed to Commit Card Data in Export Transmit')
rollback;
end if
else
messagebox('Error','Failed to Commit History Data in Export Transmit')
rollback;
end if
else
messagebox('Error','Failed to Commit Data in Export Transmit')
rollback;
End If

if nbr_in_dw > 0 then
dw_report.settransobject(sqlca)
dw_report.retrieve(batch_id)
if dw_report.rowcount() > 0 then
if messagebox('Question','Do you want to print a report of what was just sent?',Question!, YesNo!, 1) = 1 then
dw_report.print()
end if
dw_report.Object.DataWindow.Export.PDF.Method = Distill!
dw_report.Object.DataWindow.Export.PDF.Distill.CustomPostScript="No"
folder_path = 'C:\'
getfolder('Pick Path for PDF File',folder_path)
pdf_save = folder_path + '\jpmc_sent_' + string(batch_id) +
dw_report.saveas(pdf_save,PDF!, FALSE)
end if
end if
p_state = 7
filedelete(file_name)
ole_ftp.object.disconnect(true)
end if
if p_state = 7 then
messagebox('End','File successfully Completed')
p_state = 9
pb_cancel.triggerevent(Clicked!)
return
end if


Complete thread:

 

  • Done Event - S Styer, 2014-06-10, 18:33 [*]