You need to sign in to do that
Don't have an account?
vasu takasi
how to get recently inserted record id, i inserted using (controller.save())
hi
i have inserted a record like,
ApexPages.StandardController order;
public next_order(ApexPages.StandardController controller)
{
order=controller;
}
public pagereference next_order()
{
order.save();
}
}
"now i want to get that newly inserted record id"
you can try order.getId(); after you've performed insert
All Answers
i think u need to re query on the object using createddate field ...
select id from objectname orderby createddate desc limit 1; this will give recently created record
you can try order.getId(); after you've performed insert
you can go with order.getId().. but if any other process may use the order object and may insert order record from any other process too.. then u wont get the recent record ....thats y i opted the query