Ax Number Sequence:
ClassDeclaration:
NumberSeqFormHandler numberSeqFormHandler;
Close:
void close()
{
if (numberSeqFormHandler)
{
numberSeqFormHandler.formMethodClose();
}
super();
}
numberSeqFormHandler:
NumberSeqFormHandler numberSeqFormHandler()
{
if (!numberSeqFormHandler)
{
numberSeqFormHandler = numberSeqFormHandler::newForm(HPRPARAMETERS::numRefLeaveId().NumberSequence,
element,
HPRLEAVEAPPLTABLE_ds,
fieldnum(HPRLEAVEAPPLTABLE,LeaveId));
}
return numberSeqFormHandler;
}
ValidateWrite: At DataSource Level
public boolean validateWrite()
{
Boolean ret;
ret = super();
if (ret && !element.numberSeqFormHandler().formMethodDataSourceValidateWrite())
{
ret = false;
}
return ret;
}
LinkActive: At DataSource Level
public void linkActive()
{
element.numberSeqFormHandler().formMethodDataSourceLinkActive();
super();
}
Write: At DataSource Level
void write()
{
;
ttsbegin;
element.numberSeqFormHandler().formMethodDataSourceWrite();
super();
ttscommit;
}
Delete: : At DataSource Level
void delete()
{
ttsbegin;
element.numberSeqFormHandler().formMethodDataSourceDelete();
super();
ttscommit;
}
Create: At DataSource Level
void create(boolean append = false,
boolean extern = false) // If created externally
{;
super(append);
if (!extern)
{
element.numberSeqFormHandler().formMethodDataSourceCreate();
}
}
Open NumberSeqReference_Production class and go to load module
numRef.dataTypeId = typeId2ExtendedTypeId(typeid(ProdId));
numRef.referenceHelp = literalstr("@SYS53760");
numRef.wizardContinuous = true;
numRef.wizardManual = NoYes::No;
numRef.wizardAllowChangeDown = NoYes::No;
numRef.wizardAllowChangeUp = NoYes::No;
numRef.sortField = 1;
this.create(numRef);
Go to ProdParameters and add following method
static client server NumberSequenceReference numRefNum()
{
return NumberSeqReference::findReference(typeId2ExtendedTypeId(typeid(ProdId)));
}
No comments:
Post a Comment