Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Answered

When Declaring function with return Value in event , it Showing error.!

Posted on by 245

8030.Capture.PNG

When I am Declaring return Value in Procedure it's showing an Error "The event 'GetLastShipmentNo' must not have a return value.".  Can any one Suggest me What is Wrong with code.

  • Suggested answer
    Stefano Demiliani Profile Picture
    Stefano Demiliani 37,160 on at
    RE: When Declaring function with return Value in event , it Showing error.!

    Exit returns a value. You cannot use it with Exit(xxx). Your event subscriber function must not return any values.

  • Manikanta_501 Profile Picture
    Manikanta_501 245 on at
    RE: When Declaring function with return Value in event , it Showing error.!

    Capture_5F00_1.PNG

    #Stefano Demiliani

    If I remove the return Value , it's Showing another error : "Since 'GetLastShipmentNo' doesn't have a return value, EXIT cannot be called with a value" at Exit() function.

  • Suggested answer
    Stefano Demiliani Profile Picture
    Stefano Demiliani 37,160 on at
    RE: When Declaring function with return Value in event , it Showing error.!

    This is an event subscriber, you cannot have a return value. In the event subscriber you write code that is executed attached to the standard event.

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

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

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,252 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,089 Super User 2024 Season 2

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans