You need to sign in to do that
Don't have an account?
VarunC
Does sObject IsClone() only works in Classic Aloha interface but not in Lightning Experience?
I've created an Apex trigger on CustomObject_A__c, it is working fine when I clone a record in Classic Aloha interface, but the trigger does not return True for isClone() sObject function call, when I try to clone record in Lightning Experience.
Debug output in Lightning Experience:
10:01:02.0 (26981116)|USER_DEBUG|[11]|DEBUG|@@ (isCloned): false
10:01:02.0 (27065138)|USER_DEBUG|[12]|DEBUG|@@ (clonedFrom): null
Debug output in Classic Aloha:
10:06:54.0 (7464346)|USER_DEBUG|[11]|DEBUG|@@ (isCloned): true
10:06:54.0 (7542087)|USER_DEBUG|[12]|DEBUG|@@ (clonedFrom): a0b9000000FxSYMAA3
As you can see, the bug validates my cause that trigger was able to identify properly a Cloned record in Classic interface but not in Lightning Experience. Is this a Known Bug/Issue?
I've found that this isClone() function was introduced in Winter '16 - isClone function added to apex code in Release Notes also, when we scroll down to Bottom of these release notes, we can find this Idea mentioned as Delivered - Idea - Detect isClone() within Trigger
trigger CustomObjectTrigger on CustomObject_A__c (before insert, before update) { if (trigger.isBefore) { for (CustomObject_A__c a : trigger.new) { system.debug('@@ (isCloned): '+a.isClone()); system.debug('@@ (clonedFrom): '+a.getCloneSourceId()); } } }
Debug output in Lightning Experience:
10:01:02.0 (26981116)|USER_DEBUG|[11]|DEBUG|@@ (isCloned): false
10:01:02.0 (27065138)|USER_DEBUG|[12]|DEBUG|@@ (clonedFrom): null
Debug output in Classic Aloha:
10:06:54.0 (7464346)|USER_DEBUG|[11]|DEBUG|@@ (isCloned): true
10:06:54.0 (7542087)|USER_DEBUG|[12]|DEBUG|@@ (clonedFrom): a0b9000000FxSYMAA3
As you can see, the bug validates my cause that trigger was able to identify properly a Cloned record in Classic interface but not in Lightning Experience. Is this a Known Bug/Issue?
I've found that this isClone() function was introduced in Winter '16 - isClone function added to apex code in Release Notes also, when we scroll down to Bottom of these release notes, we can find this Idea mentioned as Delivered - Idea - Detect isClone() within Trigger
I just found this that might be related: https://success.salesforce.com/issues_view?id=a1p3A000000IYveQAG