Announcements
public class Parent
{
private str a,b;
public static Parent newFromAndB(str _a, str _b)
{
Parent parent = new Parent();
parent.parmA(_a);
parent.parmB(_b);
return parent ;
}
public str parmA(str _a = a)
{
a = _a;
return a;
}
public str parmB(str _b = b)
{
b = _b;
return b;
}
private static Parent construct()
{
return new Parent();
}
protected void new()
{
}
public void validate()
{
if( a == '')
{
throw error ("a should be filled");
}
}
}
public class Child extends Parent
{
public void validate()
{
//Skip parent validation
}
}
Child child = Parent::construct(a, b) as Child;
Child child = new Child();
child = Parent::construct(a, b);
public class Child extends Parent
{
public static Child newFromAndB(str _a, str _b)
{
Child child = new Child();
child.parmA(_a);
child.parmB(_b);
return child;
}
public void validate()
{
//Skip parent validation
}
}
public static SalesNonStockedValidator newFromSalesLine(SalesLine _salesLine)
{
SalesNonStockedValidator salesNonStockedValidator;
switch (_salesLine.SalesType)
{
case SalesType::Sales:
salesNonStockedValidator = SalesNonStockedValidator::construct();
break;
case SalesType::ReturnItem:
salesNonStockedValidator = SalesReturnNonStockedValidator::construct();
break;
}
salesNonStockedValidator.parmSalesLine(_salesLine);
salesNonStockedValidator.parmSalesPurchLine(_salesLine);
return salesNonStockedValidator;
}
André Arnaud de Cal... 291,359 Super User 2024 Season 2
Martin Dráb 230,370 Most Valuable Professional
nmaenpaa 101,156