Buy Now
Sign in

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

junfpurba , July 12 at 03:16
Answered
J
junfpurba
Hi, could you please help me, how to read table in database and go to end of record and email it ?
Regards.
H
healyhatman
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
J
junfpurba
They stored from registration form. I want to put increment number as invoice number to my customer.​
H
healyhatman
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
J
junfpurba
and how to put it to my email body?
H
healyhatman
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
J
junfpurba
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 ?
H
healyhatman
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
J
junfpurba
Hi,​
​its SOLVED.
<li>No. Invoice: {var:save_data8.cf_id}</li>
Thanks healyhatman.