web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

WorkFlow Submit Button

(0) ShareShare
ReportReport
Posted on by

Hi,

     Created a WorkFlow in Sales Order (SalesTableListPage), when i click the submit button it works perfectly what i expected.. but i want to activate that submit button from some where else in the form (For eg :-  if i click some action pane button , it should trigger the submit button too) 

How can i achieve that??

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    I also called that     WorkFlowSubmitManager (class) separately , but i dont know what to pass in that args ??

  • Community Member Profile Picture
    on at

    If i use that , i can't get that workflow submit dialog box

  • Community Member Profile Picture
    on at

    Can you tell me what's in that args that we pass to the WorkFlowSubmitManager Class(after clicking the submit button) , can't we pass that args from somewhere else and activate that method

  • Community Member Profile Picture
    on at

    This is the Code for the Submit Button , when i run this from the WorkFlow Created Button (Submit) it works....

    but if i call this method from the Job , it says Object object not initialized at the line of

    workflowSubmitDialog =  WorkflowSubmitDialog::construct(args.caller().getActiveWorkflowConfiguration());

    I called that submit Method like this from the Job

    SalesCreditLimitApprSubmitManager salesCreditLimitApprSubmitManager = new SalesCreditLimitApprSubmitManager();

       Args args = new Args();

       SalesTable SalesTable;

       select SalesTable where SalesTable.RecId == this.RecId;

       args.record(SalesTable);

       salesCreditLimitApprSubmitManager.submit(args);

    void submit(Args args)

    {

       //Variable declaration.

       RecId recId = args.record().RecId;

       WorkflowCorrelationId workflowCorrelationId;

       // Hardcoded type name

       WorkflowTypeName workflowTypeName = workFlowTypeStr(SalesCreditLimitAppr);

       //Initial note is the information that users enter when they

       //submit the document for workflow.

       WorkflowComment note ="";

       WorkflowSubmitDialog workflowSubmitDialog;

       SalesTable SalesTable;

       //Opens the submit to workflow dialog.

       workflowSubmitDialog =  WorkflowSubmitDialog::construct(args.caller().getActiveWorkflowConfiguration());

       workflowSubmitDialog.run();

          if (workflowSubmitDialog.parmIsClosedOK())

       {

           recId = args.record().RecId;

           SalesTable = args.record();

           // Get comments from the submit to workflow dialog.

           note = workflowSubmitDialog.parmWorkflowComment();

           try

               {

                 ttsbegin;

                   workflowCorrelationId = Workflow::activateFromWorkflowType(workflowTypeName, recId,note,NoYes::No);

                   SalesTable.CreditLimitApprovalStatus = SalesCreditLimitApprovalStatus::Submitted;

                   // Send an Infolog message.

                   info("Submitted to workflow.");

                 ttscommit;

                }

            catch(exception::Error)

                {

                info("Error on workflow activation.");

                }

        }

       args.caller().updateWorkFlowControls();

    }

  • Community Member Profile Picture
    on at

    In short    I want to call this Submit method from a Job , How can achieve that??

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans