You need to sign in to do that
Don't have an account?
JAMBERT JESUDASAN
Getting one record(by lastmodifieddate) from existing Accounts
Hi,
My scenario, While uploading a bulk accounts records, If the email or phone matched with Existing account means, I need to update(most recent lastmodified) account record.
i having 6 existing accounts with an email 'test@abc.com'. now i am inserting bulk accounts and in the sheet one record have an email 'test@abc.com. So how to retrive the most recent modified record to update?
My scenario, While uploading a bulk accounts records, If the email or phone matched with Existing account means, I need to update(most recent lastmodified) account record.
i having 6 existing accounts with an email 'test@abc.com'. now i am inserting bulk accounts and in the sheet one record have an email 'test@abc.com. So how to retrive the most recent modified record to update?
Use ORDER BY clause in your SOQL to get the latest account record.
Let us know if this helps :)
Thanks,
Amit
If i use LIMIT as 1, Then the query result will be 1 record. But I am inserting bulk records, So what happens in the sheet having more than 1 records?
example,
for test@abc.com --> Existing 5 Accounts, test1@abc.com --> existing 3 accounts, test2@abc.com ---> existing 4 accounts, etc.. For this, If i use LIMIT as 1, I guess the logic work for test@abc.com (or any one), and Remaining will be skipped right?
Thanks!
Thanks,
I tried. If i removed the Limit, It will updates all the exisiting accounts
test@abc.com -- It updates All existing 5 accounts.(need to update 1st record by desc modifieddate)
test1@abc.com -- It updates All exisitng 3 Accounts.(need to update 1st record by desc modifieddate)
test2@abc.com -- It updates All exisitng 4 Accounts. (need to update 1st record by desc modifieddate)
Thanks