no metadata class defined for data contract object in d365 using Sysoperation

I'm getting this error:

no metadata class defined for data contract object

these are my classes:


> no metadata class defined for data contract object



**CustBalanceController**

    class CustBalanceController extends
    SysOperationServiceController
    {
    
        public static void main(Args _args)
        {
            CustBalanceController controller = new CustBalanceController(classStr(CustBalanceService),methodStr(CustBalanceService,processData),SysOperationExecutionMode::Synchronous);
            controller.parmArgs(_args);
            controller.startOperation();
        }
    
    }

**CustBalanceUIBuilder**

    class CustBalanceUIBuilder extends
    SysOperationUIBuilder
    {
        public DialogField dlgCountry;
        public CustBalanceController custBalanceController;
    
        [Hookable(false)]
        public void build()
        {
            super();
    
            Dialog dialogLocal = dialog as Dialog;
    
            dlgCountry = dialogLocal.addField(extendedTypeStr(LogisticsAddressCountryRegionId));
        }
    
        [Hookable(false)]
        public void postRun()
        {
            super();
    
            
        }
    
        [Hookable(false)]
        public void getFromDialog()
        {
           
        }
    
        private CustBalanceController getContract()
        {
            if (custBalanceController == null)
            {
                custBalanceController = this.dataContractObject() as CustBalanceController;
            }
    
            return custBalanceController;
        }
    
    }

**CustBalanceDataContract** 

    class CustBalanceDataContract implements SysOperationValidatable
    {
        TransDate transDate;
        str packedQuery;
       CustBalanceUIBuilder custBalanceUIBuilder;
    
    
    
        public boolean validate()
        {
            boolean isValid  = true;
    
    
            // Perform any validation nessecary.
            if (custBalanceUIBuilder.dlgCountry.value() == "")
            {
                isValid = checkFailed("Scegli un Paese");
            }
            return isValid;
        }
    
        [DataMemberAttribute,
            AifQueryTypeAttribute
            ('_packedQuery', querystr(CustTable))
            ]
            public str parmQuery(str _packedQuery = packedQuery)
        {
            packedQuery = _packedQuery;
            return packedQuery;
        }
    
        public QueryRun getQuery()
        {
            return  new QueryRun(queryStr(QueryAccountNum));
        }
    
        public void setQuery(Query _query)
        {
            packedQuery = SysOperationHelper::base64Encode(_query.pack());
        }
    
    }

**CustBalanceService**

    class CustBalanceService
    {
        LogisticsAddressCountryRegionId countryRegionId;
        SalesTable salesTable;
        [SysEntryPointAttribute]
        public void processData(CustBalanceDataContract _custBalanceDataContract)
        {
            QueryRun queryRun;
            CustTable custTable;
            //create a new queryrun object
            queryRun = new queryRun(_custBalanceDataContract.getQuery());
            // loop all results from the query
            while (queryRun.next())
            {
                salesTable = queryRun.get(tablenum(SalesTable));
                custTable = salesTable.custTable_CustAccount();
                if(custTable.countryRegionId() == countryRegionId)
                {
                    //gli aggiornamenti e le scritture sul db varnno messe dentro ttsbegin e ttscommit
                    ttsBegin;
                    select forUpdate salesTable
                           join Custtable
                             where salesTable.CustAccount == custTable.AccountNum;
                    salesTable.IDNar = custTable.idNar;
                    salesTable.update();
                    ttscommit;
                }
            }
        }
    
    }

i'm debugging, but i can't figure out. Any helps?

i'm debugging, but i can't figure out. Any helps?

Related
Recommended