Here is my problem
dim tset as p
dim tbl as p
tset = set.open("invoice")
tbl = table.current()
tset.fetch_first()
? tbl.invno
= 10276270
tset.fetch_next()
? tbl.invno
= 10276270
There is no change even if this is done repeatedly.
tset.fetch_last()
? tbl.invno
= 10276497
it changes
tset.fetch_prev()
? tbl.invno
= 10276496
it changes here too
tset.fetch_first()
? tbl.invno
= 10276270
this also works
Am I missing something here?
I'm in the process of creating my first Alpha5 mini application.This application should do the following:
a) Append data from Alpha4 tables into Alpha5 tables
b) Open a set named �invoice� and email all records to customers with email addresses
So far I have been able to attach the script below to a button on the Invoice form that performs this task one record at a time. My goal, however, is to execute this task as a batch operation. I was hoping to use portions of the script below in this batch operation.
--------------------------------------------------------------------------------
Dim tbl as P
Dim current_record_number as N
current_record_number = current_record_number()
tbl = table.current()
cinvno = tbl.invno
cto = rtrim(CUST->EMAIL)
cfrom = "[email protected]"
csubject = "Invoice Number "+ltrim(str(cinvno))
cmessage = "Invoice Number "+ltrim(str(cinvno))+" Attatched."
reportpath = "C:\Alpha4\MyFiles\Invoice"+ltrim(str(cinvno))+".pdf"
:Report.saveas("Invoice","PDF","recno() = " + current_record_number,"",reportpath)
email_send(cto,csubject,cmessage,reportpath,"","",.F.)
file.remove(reportpath)
--------------------------------------------------------------------------------
The email option below did not work, but is the one I would like to use. I am not sure if the previous option can be use with the runtime version?
dim pm as P
dim ps as P
if (email_smtp_open(ps, "mymail.xyz.com", 25, "username", "password")) then
pm.to = cto
pm.from = cfrom
pm.subject = csubject
pm.message = cmessage
pm.attachments = reportpath
pm.xmailer = "Alpha Mailer"
pm.lRelated = .F.
pm.html_message = "<HTML><B>"+cmessage+"</B></HTML>"
email_smtp_send(ps, pm)
end if
email_smtp_close(ps)
dim tset as p
dim tbl as p
tset = set.open("invoice")
tbl = table.current()
tset.fetch_first()
? tbl.invno
= 10276270
tset.fetch_next()
? tbl.invno
= 10276270
There is no change even if this is done repeatedly.
tset.fetch_last()
? tbl.invno
= 10276497
it changes
tset.fetch_prev()
? tbl.invno
= 10276496
it changes here too
tset.fetch_first()
? tbl.invno
= 10276270
this also works
Am I missing something here?
I'm in the process of creating my first Alpha5 mini application.This application should do the following:
a) Append data from Alpha4 tables into Alpha5 tables
b) Open a set named �invoice� and email all records to customers with email addresses
So far I have been able to attach the script below to a button on the Invoice form that performs this task one record at a time. My goal, however, is to execute this task as a batch operation. I was hoping to use portions of the script below in this batch operation.
--------------------------------------------------------------------------------
Dim tbl as P
Dim current_record_number as N
current_record_number = current_record_number()
tbl = table.current()
cinvno = tbl.invno
cto = rtrim(CUST->EMAIL)
cfrom = "[email protected]"
csubject = "Invoice Number "+ltrim(str(cinvno))
cmessage = "Invoice Number "+ltrim(str(cinvno))+" Attatched."
reportpath = "C:\Alpha4\MyFiles\Invoice"+ltrim(str(cinvno))+".pdf"
:Report.saveas("Invoice","PDF","recno() = " + current_record_number,"",reportpath)
email_send(cto,csubject,cmessage,reportpath,"","",.F.)
file.remove(reportpath)
--------------------------------------------------------------------------------
The email option below did not work, but is the one I would like to use. I am not sure if the previous option can be use with the runtime version?
dim pm as P
dim ps as P
if (email_smtp_open(ps, "mymail.xyz.com", 25, "username", "password")) then
pm.to = cto
pm.from = cfrom
pm.subject = csubject
pm.message = cmessage
pm.attachments = reportpath
pm.xmailer = "Alpha Mailer"
pm.lRelated = .F.
pm.html_message = "<HTML><B>"+cmessage+"</B></HTML>"
email_smtp_send(ps, pm)
end if
email_smtp_close(ps)
Comment