Buy Now
Sign in

Read table in database and go to end of record and email it

junfpurba , July 12 2018
J
junfpurba 21
July 12 2018 #378973
Hi, could you please help me, how to read table in database and go to end of record and email it ?
Regards.
healyhatman 5.0
July 12 2018 #378976
Well it depends - how are they stored? Is there a created field? Or a sequential automatic id field? Because you could sort by that field in ascending order and return first matching.
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman

You can now copy+paste code from forums
J
junfpurba 21
July 12 2018 #378980
They stored from registration form. I want to put increment number as invoice number to my customer.
healyhatman 5.0
July 12 2018 #378981
OK so if I were you I would very much NOT simply read whatever the last record is and email it to the customer because inevitably you'll end up sending someone else's data.
What you want to do is use a save data action to save your record, and then use {var:save_data_name.model.id} which will give you the automatically generated ID of the record you just saved.
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman

You can now copy+paste code from forums
J
junfpurba 21
July 12 2018 #378983
and how to put it to my email body?
healyhatman 5.0
July 12 2018 #378985
Exactly how I said to
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman

You can now copy+paste code from forums
J
junfpurba 21
July 12 2018 #379006
Hi,
I've tried writing this in body email, but cf_id is not there.
<li>No. Invoice: {var:save_data8.Data8.cf_id}</li>
do you have solution ?
healyhatman 5.0
July 12 2018 #379009
Is CF Id what your ilID field is actually called? Is it set to primary key Auto increment? Add a debug action and check there
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman

You can now copy+paste code from forums
J
junfpurba 21
July 13 2018 #379010
 Answer
Hi,
its SOLVED.
<li>No. Invoice: {var:save_data8.cf_id}</li>
Thanks healyhatman.