final class DTPackingSlipNotInvoicedBatchService extends SysOperationServiceBase
{
public void processoperation(DTPackingSlipNotInvoicedBatchContract _contract)
{
HcmWorker hcmWorker;
Query query;
QueryBuildDataSource qbdshcmWorker;
str PersonnelNumber;
//to get the filtered query from records to include
query = _contract.getQuery();
//to get the datasource table with the records to include range
qbdshcmWorker = query.dataSourceTable(tableNum(HcmWorker));
PersonnelNumber = qbdshcmWorker.findRange(fieldnum(HcmWorker, PersonnelNumber)).value();
}
}
final class DTPackingSlipNotInvoicedBatchController extends SysOperationServiceController
{
protected void new()
{
super(classStr(DTPackingSlipNotInvoicedBatchService), methodStr(DTPackingSlipNotInvoicedBatchService,processoperation ), SysOperationExecutionMode::Synchronous);
}
public ClassDescription defaultCaption()
{
return "Process Job";
}
public static DTPackingSlipNotInvoicedBatchController construct(SysOperationExecutionMode _executionMode = SysOperationExecutionMode::Synchronous)
{
DTPackingSlipNotInvoicedBatchController controller;
controller = new DTPackingSlipNotInvoicedBatchController();
//controller.parmExecutionMode(_executionMode);
return controller;
}
public static void main(Args _args)
{
DTPackingSlipNotInvoicedBatchController controller;
controller = DTPackingSlipNotInvoicedBatchController::construct();
controller.parmArgs(_args);
controller.startOperation();
}
}
[DataContractAttribute,
SysOperationContractProcessing
(classStr(DTPackingSlipNotInvoicedBatchUIBuilder))
]
final class DTPackingSlipNotInvoicedBatchContract implements SysOperationValidatable
{
smmBusRelMemo subject,body;
str packedQuery;
Email to;
boolean displayAmount;
DTPackingSlipNotInvoiceType type;
[
DataMemberAttribute('Type'),
SysOperationLabelAttribute(literalstr("Type")),
SysOperationHelpTextAttribute(literalstr("Type")),
SysOperationDisplayOrderAttribute('0')
]
public DTPackingSlipNotInvoiceType parmtype(DTPackingSlipNotInvoiceType _type = type)
{
type = _type;
return type;
}
[
DataMemberAttribute('Display Amount'),
SysOperationLabelAttribute(literalstr("Display Amount")),
SysOperationHelpTextAttribute(literalstr("Display Amount")),
SysOperationDisplayOrderAttribute('1')
]
public boolean parmdisplayAmount(boolean _displayAmount = displayAmount)
{
displayAmount = _displayAmount;
return displayAmount;
}
[
DataMemberAttribute('To'),
SysOperationLabelAttribute(literalstr("To")),
SysOperationHelpTextAttribute(literalstr("To")),
SysOperationDisplayOrderAttribute('2')
]
public Email parmTo(Email _to = to)
{
to = _to;
return to;
}
[
DataMemberAttribute('subject'),
SysOperationLabelAttribute(literalstr("Subject")),
SysOperationHelpTextAttribute(literalstr("Subject")),
SysOperationDisplayOrderAttribute('3')
]
public smmBusRelMemo parmsubject(smmBusRelMemo _subject = subject)
{
subject = _subject;
return subject;
}
[
DataMemberAttribute('body'),
SysOperationLabelAttribute(literalstr("Body")),
SysOperationHelpTextAttribute(literalstr("Body")),
SysOperationDisplayOrderAttribute('4')
]
public smmBusRelMemo parmbody(smmBusRelMemo _body = body)
{
body = _body;
return body;
}
[ DataMemberAttribute,
AifQueryTypeAttribute('_packedQuery', queryStr(DTHcmWorker))
]
public str parmPackedQuery(str _packedQuery = packedQuery)
{
packedQuery = _packedQuery;
return packedQuery;
}
public Query getQuery()
{
Query q = new Query(SysOperationHelper::base64Decode(packedQuery));
return q;
}
public void setQuery(Query _query)
{
packedQuery = SysOperationHelper::base64Encode(_query.pack());
}
public boolean validate()
{
boolean ret = true;
if (this.parmtype() == DTPackingSlipNotInvoiceType::AuditTeam)
{
if(this.parmTo() == "")
{
ret = checkFailed(strFmt("The 'To' field must not be left blank"));
}
}
return ret;
}
}
final class DTPackingSlipNotInvoicedBatchUIBuilder extends SysOperationAutomaticUIBuilder
{
DialogField typeField;
DialogField toField;
public void postBuild()
{
super();
// get references to dialog controls after creation
typeField = this.bindInfo().getDialogField(this.dataContractObject(),
methodStr(DTPackingSlipNotInvoicedBatchContract, parmtype));
toField = this.bindInfo().getDialogField(this.dataContractObject(),
methodStr(DTPackingSlipNotInvoicedBatchContract, parmTo));
if(typeField.Value() == DTPackingSlipNotInvoiceType::AuditTeam)
{
toField.enabled(true);
}
else if(typeField.Value() == DTPackingSlipNotInvoiceType::SalesPerson)
{
toField.enabled(false);
}
}
public void postRun()
{
super();
///register overrides for form control events
typeField.registerOverrideMethod(methodstr(FormComboBoxControl, modified),
methodstr(DTPackingSlipNotInvoicedBatchUIBuilder, modified), this);
}
public void modified(FormComboBoxControl _selection)
{
DTPackingSlipNotInvoicedBatchContract cTPackingSlipNotInvoicedBatchContract = this.dataContractObject() as DTPackingSlipNotInvoicedBatchContract;
if(typeField.Value() == DTPackingSlipNotInvoiceType::AuditTeam)
{
toField.enabled(true);
}
else if(_selection.selection() == DTPackingSlipNotInvoiceType::SalesPerson)
{
toField.enabled(false);
}
}
}
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,269 Super User 2024 Season 2
Martin Dráb 230,198 Most Valuable Professional
nmaenpaa 101,156