Hi,
I have written a SysOperationServiceController class and getting the following error whenever i run it.
HU_DataContract object not initialized.
Stack trace
(C)\Classes\HU_CustTesterServiceController\newFromArgs - line 25
(C)\Classes\HU_CustTesterServiceController\main - line 6
I am not sure what is missing, following is the code for the class
class HU_CustTesterServiceController extends SysOperationServiceController
{
}
public static void main(Args _args)
{
HU_CustTesterServiceController hu_CustTesterServiceController;
;
hu_CustTesterServiceController = HU_CustTesterServiceController::newFromArgs(_args);
hu_CustTesterServiceController.startOperation();
}
public static HU_CustTesterServiceController newFromArgs(Args _args)
{
HU_CustTesterServiceController HU_CustTesterServiceController;
HU_DataContract _HU_DataContract;
CustTable custTable;
Query query;
IdentifierName className, methodName;
SysOperationExecutionMode executionMode;
[className, methodName, executionMode] = SysOperationServiceController::parseServiceInfo(_args );
// create a new instance of the controller
HU_CustTesterServiceController = new HU_CustTesterServiceController( className, methodName, executionMode);
// initialize from args
// one of the things this will do is read the "parameters" property from the menu item
HU_CustTesterServiceController.initializeFromArgs(_args);
// get datacontract
// the string should be the same as the parameter name!
_HU_DataContract = HU_CustTesterServiceController.getDataContractObject('_HU_DataContract');
// default current date
_HU_DataContract.parmDate(systemDateGet());
// check if the record is of type CustTable
if(_args && _args.dataset() == tableNum(CustTable))
{
// cast record
custTable = _args.record();
// create new query
query = new query(queryStr(HU_ForCustomers));
// add range
query.dataSourceTable(tableNum(CustTable)).addRange(fieldNum(CustTable, AccountNum)).value(queryValue(custTable.AccountNum));
// set query on datacontract
_HU_DataContract.setQuery(query);
}
// return a new instance of this controller
return HU_CustTesterServiceController;
}
Many thanks,
*This post is locked for comments
I have the same question (0)