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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Business Central forum

Action not available

(0) ShareShare
ReportReport
Posted on by 911

In VSCode / AL, I have created a table called Obligation, a page called ObligationList and a codeunit called ObligationsRetriever. In the page I've created an action as below:

    actions
    {
        area(Processing)
        {
            action(RunWrapper)
            {
                Caption = 'Run Obligations';
                ApplicationArea = All;
                RunObject = codeunit ObligationsRetriever;
            }
        }
    }

When I run it, the 'Run Obligations' action is displayed, but when I click it nothing happens. It seems to be disabled?

Any thoughts?

Categories:
  • Suggested answer
    Stefano Demiliani Profile Picture
    37,172 Most Valuable Professional on at

    Do you have code in the OnRun event of this codeunit?

  • Nick Webb Profile Picture
    911 on at

    Yes, see below:

    codeunit 50112 ObligationsRetriever

    {

       trigger OnRun()

       begin

           RetrieveObligations();

       end;

       procedure RetrieveObligations()

       etc…..

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,172 Most Valuable Professional on at

    There's no other reason then. I suggest tom place a debugger in the codeunit OnRun trigger.

  • Nick Webb Profile Picture
    911 on at

    I put a breakpoint on the line below which calls the RetrieveObligations procedure and hit F5 to Start debugging:

    RetrieveObligations();

    I also put a breakpoint inside the procedure.

    But when the Sandbox loads, I click the 'Run Obligations' Action button and nothing happens. It's like the button is disabled?

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,172 Most Valuable Professional on at

    If the button is disabled, you cannot click on it. I think there's a problem somewhere on your page.

    Maybe try also this:

    action(RunWrapper)

               {

                   Caption = 'Run Obligations';

                   ApplicationArea = All;

                   trigger OnAction();

                   var

                     cuObligationsRetriever: codeunit ObligationsRetriever;

                    begin

                        cuObligationsRetriever.Run();

                    end;

               }

  • Nick Webb Profile Picture
    911 on at

    The change of syntax worked. However, I'm a little disappointed that the previous version of my code was syntactically correct in that it compiles with no errors. There were no error messages when debugging, just a seemingly disabled button? Not a very intuitive development environment.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Business Central

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans