Hello folks,
I have a requirement shared below in code snippets comments beginning with "Aim"
As this is custom requirement ISV as expected has turned down the request to develop custom fix for us. So we are on our own and need to tackle this via COC.
Can you please suggest how can we modify the switch case logic using COC or any other approach.
//ISV Code public ISVClass1 { Common common; // Some ISV code and in contruct and new which basically populates common as & when used public void isvMethodContainingSwitchCase() { switch (common.TableID) { case tablenum(Table1): this.isvMethod1(); case tablenum(Table2): this.isvMethod2(); case tablenum(Table3): this.isvMethod3(); case tablenum(TableN): this.isvMethodN(); } public void isvMethod1() { //Do something } public void isvMethod2() { //Do something } public void isvMethod3() { //Do something } public void isvMethodN() { //Do something } } // END of ISV class //Begin my COC of above class //Objective is to not call ISVMethod1() and ISVMethod3() for certain values in table1.customcolumn1 & table3.customcolumn1 [ExtensionOf(classStr(ISVClass1))] final class myExtensionOfISVClass { //Coc of isvMethodContainingSwitchCase() public void isvMethodContainingSwitchCase() { switch (common.TableID) { case tablenum(Table1): Table1 table1 = common; if(table1.customcololmn1 == '') // Aim to call this.ISVMethod1() only when there is no value in customColumn1 of table1 { this.isvMethod1(); } case tablenum(Table3): Table3 table3 = common; if(table3.customcololmn1 == '') // Aim to call this.ISVMethod3() only when there is no value in customColumn1 of { this.isvMethod3(); } } next isvMethodContainingSwitchCase(); // Aim is to call all other switch case condition apart from one above }
Thanks
Mav
Looks like I should be able to use Idispose in meeting the above requirement
What you want isn't possible - extensions don't allow you to change code inside methods. You'll need to look for another design.
For example, maybe you can somehow influence the bahavior by extending isvMethod1() and isvMethod3(). Maybe you shouldn't call isvMethodContainingSwitchCase() at all if customcololmn1 isn't empty. Maybe you need to ask the ISV to add an extension point.
A hack may be providing a record of a different table if customcololmn1 isn't empty, but it could easily lead to errors at other places.
André Arnaud de Cal...
291,996
Super User 2025 Season 1
Martin Dráb
230,853
Most Valuable Professional
nmaenpaa
101,156