function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
gaganSFDCgaganSFDC 

how to fetch previous record's picklist status in new record

hello,
i have a situation that i want to use previous record's picklist status in new record
SonamSonam (Salesforce Developers) 
When you say last record, are you maintaining the record count using an autonumber? If yes - what you can do is use a after update trigger and get the record which was last created using the current value in the auto number -(minus) 1 - you can fetch this record and the value of the field you wish to have in the current record.
gaganSFDCgaganSFDC
Thank you Sonam
gaganSFDCgaganSFDC
I have another query that how can i update field on mater object on the basis of the value of a field on detail object using trigger only (i.e. when i change the value of a field on detail objet then the status should change on master object). I have just started using salesforce few week ago. So plz help
SonamSonam (Salesforce Developers) 
Hi Gagan,

The following thread has a code sample of a trigger where contact(detail) trigger updates the account(master)
https://developer.salesforce.com/forums/ForumsMain?id=906F000000090cFIAQ

Please mark this as an answer if this resolves your issue so as to help others.