Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Suggested answer

Service class not hitting on ok button in sysoperation framework

Posted on by 1,457
hi ,
I have made batch job where i have enum parameter , based on its selection another parameter get disabled but , but the enum parameter shows warning like symbol and on click of ok button the service class is not hitting , please guide me on this so i can resolve the issue . 
thanks,
Regards,
Dinesh
  • Layan Jwei Profile Picture
    Layan Jwei 7,347 Super User 2024 Season 2 on at
    Service class not hitting on ok button in sysoperation framework
    Hi Dinesh,
     
    Can you share your new code please?
     
    Also are there any customizations related to this enum? or did u try to build the model?

    Thanks,
    Layan Jweihan
  • Dineshkarlekar Profile Picture
    Dineshkarlekar 1,457 on at
    Service class not hitting on ok button in sysoperation framework
    hi , 
    i am still having that error i have rename the method as you say , i am not getting what to do now .
  • Suggested answer
    Layan Jwei Profile Picture
    Layan Jwei 7,347 Super User 2024 Season 2 on at
    Service class not hitting on ok button in sysoperation framework
    Hi Dinesh,
     
    I'm not sure why are you getting this error.
     
    Could it be because of the modified method in UI builder? Try to rename the method to sth else like typeFieldModified and change also the name when calling it in registierOverrideMethod

    And inside put
    boolean ret = _selection.modified();
    If(ret)
    {
       // do logic
    }

    Thanks,
    Layan Jweihan
  • Dineshkarlekar Profile Picture
    Dineshkarlekar 1,457 on at
    Service class not hitting on ok button in sysoperation framework
    hi ,
    thanks for reply ,  i am trying to debug the code , here is my service class code , i have put debugger on all classes but nothing hits whin i click ok button and this error come directly .
    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();
        }
    }
    it should hit this process operation class i need to get personal number from the dailog , so i can proceed further, 
    please try to reply fast if you can help me on this .
    thanks ,
    regards,
    Dinesh
  • Layan Jwei Profile Picture
    Layan Jwei 7,347 Super User 2024 Season 2 on at
    Service class not hitting on ok button in sysoperation framework
    Hi Dinesh,
     
    Did you debug and see where it fails exactly? At what line of code? 

    Also You didn't share the service class code?
     
    In addition to that, can you take a screenshot of all the values you filled in the dialog before you clicked ok?
     
    Thanks,
    Layan Jweihan
  • Dineshkarlekar Profile Picture
    Dineshkarlekar 1,457 on at
    Service class not hitting on ok button in sysoperation framework
    hi , 
    Thanks For reply , this error appars when i click on ok button .
    my code is below 
    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);
            }
        }
    
    }
    here are the classes 
    thanks ,
    regards,
    Dinesh
  • Layan Jwei Profile Picture
    Layan Jwei 7,347 Super User 2024 Season 2 on at
    Service class not hitting on ok button in sysoperation framework
    Hi Dinesh,
     
    Can you please share your code with us. Contract, Controller and Service classes please. So that we understand what the issue is.

    Also, when does this warning appear? Is it when you first open the dialog? Or what?

     
    Thanks,
    Layan Jweihan

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans