set Batch id in contract if batch isInBatch check is true
in run method we will update the contract and set the batch id.
class BrFunctionalLocationRecordsController extends SysOperationServiceController
{
protected void new()
{
super(classStr(BrFunctionalLocationRecordsService), methodStr(BrFunctionalLocationRecordsService, functionalLocationRecordsService), SysOperationExecutionMode::Synchronous);
}
public static BrFunctionalLocationRecordsController construct(SysOperationExecutionMode _executionMode = SysOperationExecutionMode::Synchronous)
{
BrFunctionalLocationRecordsController controller;
controller = new BrFunctionalLocationRecordsController();
controller.parmExecutionMode(_executionMode);
return controller;
}
public static void main(Args _args)
{
BrFunctionalLocationRecordsController controller;
// to update contract value at main we can initialize contract here.
//BrFunctionalLocationRecordsContract brFunctionalLocationRecordsContract;
controller = BrFunctionalLocationRecordsController::construct();
//and can set contract values here
//brFunctionalLocationRecordsContract = controller.getDataContractObject();
controller.parmArgs(_args);
controller.startOperation();
}
public ClassDescription defaultCaption()
{
return "@Br:FunctionalLocationRecords";
}
public void run()
{
BrFunctionalLocationRecordsContract brFunctionalLocationRecordsContract;
//getting batch contract.
brFunctionalLocationRecordsContract = this.getDataContractObject();
Batch batch;
if (this.isInBatch())
{
//getting batch information;
batch = this.currentBatch;
//setting batch id in contract
brFunctionalLocationRecordsContract.parmBatchHeader(batch.BatchJobId);
}
super();
}
}
in run method we will update the contract and set the batch id.
class BrFunctionalLocationRecordsController extends SysOperationServiceController
{
protected void new()
{
super(classStr(BrFunctionalLocationRecordsService), methodStr(BrFunctionalLocationRecordsService, functionalLocationRecordsService), SysOperationExecutionMode::Synchronous);
}
public static BrFunctionalLocationRecordsController construct(SysOperationExecutionMode _executionMode = SysOperationExecutionMode::Synchronous)
{
BrFunctionalLocationRecordsController controller;
controller = new BrFunctionalLocationRecordsController();
controller.parmExecutionMode(_executionMode);
return controller;
}
public static void main(Args _args)
{
BrFunctionalLocationRecordsController controller;
// to update contract value at main we can initialize contract here.
//BrFunctionalLocationRecordsContract brFunctionalLocationRecordsContract;
controller = BrFunctionalLocationRecordsController::construct();
//and can set contract values here
//brFunctionalLocationRecordsContract = controller.getDataContractObject();
controller.parmArgs(_args);
controller.startOperation();
}
public ClassDescription defaultCaption()
{
return "@Br:FunctionalLocationRecords";
}
public void run()
{
BrFunctionalLocationRecordsContract brFunctionalLocationRecordsContract;
//getting batch contract.
brFunctionalLocationRecordsContract = this.getDataContractObject();
Batch batch;
if (this.isInBatch())
{
//getting batch information;
batch = this.currentBatch;
//setting batch id in contract
brFunctionalLocationRecordsContract.parmBatchHeader(batch.BatchJobId);
}
super();
}
}
Thanks for sharing the valuable information. Keep on sharing.
ReplyDeleteD365 Finance and Operations Training
D365 Finance and Operations Training in Hyderabad
D365 Finance Training
Thank you for writing this informative post. Looking forward to read more.
ReplyDeleteGroovy Certification Online Training from Hyderabad
SAP BOBJ Admin Online Training
Best SAP Enterprise portal (EP) Training from South Africa
SAP BPC Training from UK
SAP Integrated Business Planning for Supply Chain Online Course from India
SAP EHS Training Classes
SAP CPQ Configurtaion Online Coaching In Australia
Best SAP Cloud for Customer (C4C) Online Training
SAP CRM Functional Training Course In Hyderabad
OCI Online Course from Malaysia