Hi all,
I go through below link for replaceable features
https://kashperuk.blogspot.com/2017/10/development-tutorial-extensibility_7.html
Not understand properly, kindly give me difference between CoC & Replacable.
Kindly elaborate me pls with one example for replaceable
Pls give me more shed on this
Hi Arpan,
CoC and Replicable cannot be compared. Replaceble gives you a variation for the CoC extension method. Usually, you must call the next() statement in a CoC method which will then execute the standard logic before or after your extension coding (depending on the position in your method).
When the original method is decorated with the attribute Replaceable, you can skip the next() method which will result that you fully replace the standard business logic with your own logic.
Thanks Andre
Kindly let me know which option is more reliable to use?
I mean replacable attributes to bypass next keyword or
Next keyword to use?
Kindly elaborate please
If the developer of the method you're extending didn't use Replacable, you must call next(). There is no choice.
Sorry not understand
If you're using CoC to extend a method, whether you can skip next() depends on whether the developer of the method (usually Microsoft) decorated it with the Replaceable attribute. If not, the method isn't replaceable and you must call next.
If the method is decorated with the replaceable attribute, then you can decide whether you want to extend it (running both the stadard logic and yours) or replace it (not calling the standard logic).
Is it clear now? If not, go and try it to see it for yourself.
Yes Martin clear now.
Let me check, will update you
Yes, that means if the method is decorated with replacable attributes than only we can use replacable. Else never.
we needs to go for CoC only.
If we use replacable, than we can only run our logic and bypass absolutely standard logic . But depends upon our requirements whether we use CoC or replacable.
Am I correct?
No, there is no decision whther to use CoC or replaceable. You'll use CoC in all cases. Whether you can replace the method depends on whether the other developer decorated with replaceable. You can't use Replaceable attribute when extending a method; you could use it when defining a method that others can replace.
It's not rocket science, you just need to think about it a little.
In 2012, when we added a button to the form, we overwrite the clicked method, super didn't have a function because we had the code do the work.
Similarly, if the developer of the function you will write COC has written this method to be overwrited or if he does not see any harm in overwrited it, he states this on the method and gives you the authority to overwrite the super (next) in CoC.
They are not exactly the same as the button example, but I used them to help you understand the logic of the topic.
thanks Ergun, little bit understsnd
can you pls provide me the example of codes with used replacable.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
CA Neeraj Kumar 1,771
André Arnaud de Cal... 806 Super User 2025 Season 2
Sohaib Cheema 542 User Group Leader