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
@rp@n, you have an example in the blog post that you linked at the very beginning.
It's not very complex. Think of any CoC method. You just don't have to put the "next ..()" line.
Of course, if you don't type Next, the standard logic will not work.
There is an example in the link you provided. If you pay attention, according to the result of the "if" line, custom logic is running,(not next).
thanks Ergun, little bit understsnd
can you pls provide me the example of codes with used replacable.
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.
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.
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?
Yes Martin clear now.
Let me check, will update you
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.
Sorry not understand
Kindly elaborate please
If the developer of the method you're extending didn't use Replacable, you must call next(). There is no choice.
André Arnaud de Cal...
291,965
Super User 2025 Season 1
Martin Dráb
230,817
Most Valuable Professional
nmaenpaa
101,156