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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Business Central forum

how to return a value from control add-in procedure?

(0) ShareShare
ReportReport
Posted on by 505

How can I return a value from control add-in?

If it is not possible then what is the workaround?

Categories:
I have the same question (0)
  • Priyank Bhavsar Profile Picture
    505 on at

    I have used the same approach but I need to return a value from my javascript function to business central.

    I'm using a javascript control add-in. I have created a 'controladdin' in business central which calls a javascript funcion. I need to return a value from javascript to controladdin. I have used this 'controladdin' in one of my page extensions as usercontrol. The problem is that I cannot return a value from my controladdin to my page extension.

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

    A control add-in can raise events and from that events you can have a value.

    For example, when you declare your controladdin object, add an event to the declaration:

    controladdin demo

    {

      event MyAddinEvent;

    }

    Then in your D365BC page, when you declare the addin object, handle that event:

    usercontrol(MyAddin;MyAddin)

    {

      trigger MyAddinEvent

      begin

         //Your code here

      end;

    }

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

News and Announcements

Season of Giving Solutions is Here!

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