You need to sign in to do that
Don't have an account?
Satyananda Yeluri
Record Versioning
Greetings,
I have been struggling with achieve record version. My requirement is: system should create a new record by incrementing version number whenever a change made on record. Can anybody help me to achieve this functionlaity. Would be appreciated your help.
Thanks,
Satya
I have been struggling with achieve record version. My requirement is: system should create a new record by incrementing version number whenever a change made on record. Can anybody help me to achieve this functionlaity. Would be appreciated your help.
Thanks,
Satya
Hi Satyananda,
1) Create a field as number field to capture version
2) Create a workflow to fire every time a record is created or edited
3) In workflow criteria check if any of the field on your record is changed if you only want to version of there was a change on the record
4)Use ISCHANGED(FIELD_NAME) method on your criteria
5) Use field update action to update your version field.
Thanks,
Fahad Akhtar
Thank you. I have 200 fields on object and 30 layouts and record types. And, I need a new record whenver a change made on existing record.
Thanks,
Satya
Use below Code :
Let me know if you need more help on this.
Regards,
Abhishek.
Thank you.
But, the existing record will be upadated with new values???
Ex:
I have record X - version 0.1
I have updated version 0.1 with new value
Now, I need to see version 0.2 with new value and version 0.1 should not be effected. (above snippet, version 0.1 updated with new values ?? )
Can you please let me know if my understanding is wrong.
I appreciate your help.
Thanks,
Satya
What you are trying to achieve is not possible because we are creating a new record when an existing record is updated and your requirement suggests that you do not want to change the existing record.
So if the existing record is not allowed to update than how would we get to know that a record has been updated.
The only solution is we can create new records with the old values with the help of trigger.old which means that your existing record will update and a new record will e created with old values.
Eg : Record A - Version 0.1 => Updated To Record A - Version 0.2 than we can create a new record with vaue = Record B - Version 0.1
Please let me know if this information is helpful to you or not ?
Regards,
Abhishek.
as per your example, we are cloning Record A as Record B (Auto Id and Created Date/Time will get change) and Record A updated as 0.2 which is an issue.
My requirement is basic versioning of records.
I have created Record A with status 'Unprocessed' and version 0.0
Updated Record A with status 'In Progress'
The above action should create a new record (say Record B and version 0.1, status = 'In Progress')
The Record A should retain the old values (Status = 'Unprocessed' and version 0.0)
I am looking for any other alternative solution if the trigger does not work. I tried using clone. but, that actually saves if i don't do update and save.
The trigger will create a new record when this field is updated.
i need solution for your question .if you have solution pls upload
How did yo do the record version at the end ,
I am having same kind of requirement pls help me
I have created Record A with status 'Unprocessed' and version 0.0
Updated Record A with status 'In Progress'
The above action should create a new record (say Record B and version 0.1, status = 'In Progress')
The Record A should retain the old values (Status = 'Unprocessed' and version 0.0)
1. Lock your original record for edit
2. Add clone button on it
3. Once the clone button is hit, the record is cloned and provided in edit mode, let the users update the record before saving.
4. Coming to the versioning part, here is how you can identify if a record is cloned
https://help.salesforce.com/s/articleView?id=000382967&type=1
5. In the same workflow you can add new field for version as well, and keep incrementing it.
Thanks