SBX - Search With Button

SBX - Forum Post Title

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

Dynamics 365 Business Central Forum

Manikanta Adabala asked a question on 11 Jun 2019 4:05 AM

Question Status

Verified

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.

Reply
Suggested Answer

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.

Reply
Manikanta Adabala responded on 11 Jun 2019 4:49 AM

#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.

Reply
Verified Answer

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

Reply
Verified Answer

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

Reply
Suggested Answer

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.

Reply

SBX - Two Col Forum

SBX - Migrated JS