Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

Extend canSubmitToWorkflow method which does not exist in table

Posted on by Microsoft Employee

Hi All guys,

I want to enable table workflow, but I don't know how to extend the canSubmitToWorkflow method in my extension class, who has this experience to share with me? thanks.

*This post is locked for comments

  • Suggested answer
    Satish kakileti Profile Picture
    Satish kakileti 185 on at
    RE: Extend canSubmitToWorkflow method which does not exist in table

    Check this...

    community.dynamics.com/.../844485

  • Suggested answer
    Satish kakileti Profile Picture
    Satish kakileti 185 on at
    RE: Extend canSubmitToWorkflow method which does not exist in table

    Hi Guys,

    Please go through the below link, I have provided solution for the same with out any overlayering.

    community.dynamics.com/.../288826

    Thanks,

    Satish Kakileti.

  • Sheikh Sohail Profile Picture
    Sheikh Sohail 6,125 on at
    RE: Extend canSubmitToWorkflow method which does not exist in table

    As we all knows that in D365 there is limitation to create workflow on existing table because in Extension we couldn't write canSubmitWorkflow method, You have to over-layer the table and than override the canSubmitWorkflow Method....

    But there is an alternate way I found to avoid over layering on systems table.

    d365technext.blogspot.com/.../avoid-over-layering-in-development-of.html

    community.dynamics.com/.../avoid-over-layering-in-development-of-workflows-on-existing-form

    Please mark this Answer as suggested if above blog is use full for you.

    Thank you

    Sheikh Sohail Hussain

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Extend canSubmitToWorkflow method which does not exist in table

    Hi all guys,

    I extends form method

    [FormDataSourceEventHandler(formDataSourceStr(MyForm, ProjInvoiceTable), FormDataSourceEventType::Initialized)]

       public static void ProjInvoiceTable_OnInitialized(FormDataSource sender, FormDataSourceEventArgs e)

       {

           sender.formRun().design().workflowEnabled(true);

           sender.formRun().design().workflowDatasource(formDataSourceStr(MyForm, ProjInvoiceTable));

           sender.formRun().design().workflowType("workFlowType");

       }

    I open form after building, an error message always pop up saying 'Object reference not set to an instance of an object' when I set property workflowEnabled to true. same error displayed if I override the form to modify this property, I really don't know how to give value to this property for now, who have this solution to share with me? my verison is PU12.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Extend canSubmitToWorkflow method which does not exist in table

    sarah guan,

    You can not achieve this without overlayering until now. Maybe MS provides some way in future releases.

  • Verified answer
    Satish kakileti Profile Picture
    Satish kakileti 185 on at
    RE: Extend canSubmitToWorkflow method which does not exist in table

    Hi Sarah,

    I want to mention one thing here,

    We can use COC only for the table methods which are already overridden.  If the method, CanSubmitToWorkflow is not overridden, we have to customize the table and proceed with over-layering this method.

    Thanks,

    Satish K.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Extend canSubmitToWorkflow method which does not exist in table

    Error message: The next method cannot be invoked in method 'canSubmitToWorkflow' because it's not a chain of Command method.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Extend canSubmitToWorkflow method which does not exist in table

    Hi Satish,

    please have a look at error below,  need I overlay this method in table?

  • Verified answer
    Satish kakileti Profile Picture
    Satish kakileti 185 on at
    RE: Extend canSubmitToWorkflow method which does not exist in table

    Hi Sarah,

    This can be achieved through COC,

    I hope following code would help you,

    [ExtensionOf(tableStr(<YourTableName>))]

    final class <YourTableName>_Extension

    {

      public boolean canSubmitToWorkflow()

      {

          boolean ret;

          ret = next canSubmitToWorkflow();

         if(this.recID && (this.WorkflowState == WorkflowState::notSubmitted))

          {

                 ret = true;

          }

          return ret;

       }

    }

    Thanks,

    Satish K.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Extend canSubmitToWorkflow method which does not exist in table

    same question, How do i extend canSubmitToWorkflow  method in form, I try to add this method to my extension class, It seems as if added method is unuseful.

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,056 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans