Explore Dynamics 365 Business Central on Microsoft LearnDiscover features, benefits, and examples of Dynamics 365 Business Central in action in this short training module.
Dynamics 365 2019 release wave 2 plan Discover the latest updates to Dynamics 365.Release Plan | Weekly Deployment Notes
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants.Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements.
ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Talent TechTalks
Hello all ,
How can I define my custom function with parameters in Subscriber Event in Business Central of Cloud version(SaaS).
My function is like below(in Standard Codeunit(5763) NAV2018).
GetResultMessageWeb(VAR MesgP : Text)MessageText := Text003;IF CounterSourceDocOK > 0 THEN MessageText := MessageText + Text004;IF CounterSourceDocOK < CounterSourceDocTotal THEN MessageText := MessageText + Text005;//MESSAGE(MessageText,CounterSourceDocOK,CounterSourceDocTotal);MesgP := STRSUBSTNO(MessageText,CounterSourceDocOK,CounterSourceDocTotal);
Use the snippet teventsub and select the object that raises the event you want to subscribe and the event itself.
The parameters of your method to raise can be inherited from the subscribed event (just press CTRL + SPACE to see the parameters passed by the event).
Thanks for your reply ..
How can I write my Custom code inside a If and Else Conditions(Standard).Consider Below Standard Code in Business Central.
I Want to Add my code in END ELSE BEGIN Condition. Can You suggest me the solution.
As said before, in a SaaS environment you cannot write code where you want (you cannot modify existing base code). You need to rethink your code and attach to standard events, for example here to the OnBeforeSalesLineModify event raised by the standard code.
Can we Override the code in Business Central of Cloud Version(SaaS).
No. Only subscribe to events raised by the base code.
Actually the standard Code is like below
and I wrote Subscriber event for this , Consider below code.
Here I am using same Code again in my Event ,. Can I Write like this.
Yes you can do that. You always need to subscribe to events and here add your code.
Thank you., It's Solved my problem.
I have custom function in Standard Codeunit (Whse.-Post Shipment) and I am using this function from Custom Codeunit in NAV 2018. Now I am Upgrading this Objects to Business Central of Cloud version(SaaS) . how can I Define my function in Event Subscriber and how can I Call that function from my Custom Codeunit.
I wrote Custom function in Standard Codeunit(Whse.-Post Shipment) like below.
And I am Calling that function like below from my codeunit.
Now My question is how can I call this function from my codeunit(or any other object), if I define this under a Subscriber event.
You should have the function defined as a procedure in a custom codeunit and then call that function where you need (for example from your event subscriber and from other codeunits or triggers in your code) by referencing that codeunit: yourCodeunit.YourFunction(....)
But this function has the standard global Variables CounterSourceDocOK , CounterSourceDocTotal of standard CU. How can we get these values if we write procedure in any Custom Code unit?Even we have checked the Events in Business central standard CU 5763 and not have any Standard Event where these Two Variables are passed as Parameters.
Business Applications communities