You need to sign in to do that
Don't have an account?
VPROK
Problem with getCloneSourceId().
Hi, guys.
I have a strange problem here, which really pisses me off :(
So it is very simple, just typing in execute anonymous:
Account acc;
acc.getCloneSourceId();
Gives me an error:
"Compile error at line 2 column 1
Method does not exist or incorrect signature: [Account].getCloneSourceId()"
According to this (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_sobject.htm)article, this method should work with any SObject, but it doesn't work with any object...
Please, tell me what am I missing.
Thanks!
I have a strange problem here, which really pisses me off :(
So it is very simple, just typing in execute anonymous:
Account acc;
acc.getCloneSourceId();
Gives me an error:
"Compile error at line 2 column 1
Method does not exist or incorrect signature: [Account].getCloneSourceId()"
According to this (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_sobject.htm)article, this method should work with any SObject, but it doesn't work with any object...
Please, tell me what am I missing.
Thanks!
Does anybody used it before? :)
All Answers
Does anybody used it before? :)
It is working fine. Try this code -
YES! definitely. Just tested in lightning ready org - working fine.
Looks like I will just have to wait for a couple of days
In a Spring '17 pre-release dev org (API v39), I just tested a contact "before insert" trigger and the getCloneSourceId() is populated when cloning in Classic UI but null in Lightning Experience.
You can subscribe to the known issue here: https://success.salesforce.com/issues_view?id=a1p3A000000IYveQAG
Thanks for the input. Although this surely has to be classified as bug. A really annoying one. In my test classes I didn't perform the operation on the server directly, but used the sObject.clone() command, which basically should do the same. That's why I didn't see it immediately.
Does anybody have experience with field values getting set to null?
No. All of our Opportunities have the field SelfId__c filled with their own ID. So when I clone, technically, this field should be carried over to the cloned record. It isn't though for some of them, which makes detection literally impossible.
I would do all my necessary logic for detected clones and in the end update the clones to have their own ID in the SelfId__c field.