Skip to content

Instantly share code, notes, and snippets.

@noakesey
Last active December 15, 2018 20:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noakesey/eb706821f6b93e04eed806a3a435812e to your computer and use it in GitHub Desktop.
Save noakesey/eb706821f6b93e04eed806a3a435812e to your computer and use it in GitHub Desktop.
/// <summary>
/// Class extensions should have an Extension suffix, and should include the name
/// of the extending model as an infix to maintain uniqueness. The extension class
/// must be marked as final as it would make no logical sense to subclass
/// or extend an extension.
/// </summary>
[ExtensionOf(classStr(CustTransSettlement))]
final class CustTransSettlement_MyNewModel_Extension
{
protected boolean isTransTypeValidForInsertSettlementLines(CustTrans _custTrans)
{
//We must always call the next handler in the Chain of Command (CoC) even if
//we really don't wan't or need to.
//The only guarantee about sequence is that the standard version will run last.
next isTransTypeValidForInsertSettlementLines(_custTrans);
//Override the standard result with our own logic, but put the logic somewhere else
//to keep this method assimple as possible to protect against future
//framework changes.
return MyOtherClass::SomeOtherMethod(_custTrans);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment