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