SBX - Search With Button

SBX - Forum Post Title

Adding Code to Standard Codeunits in Business Central.

Dynamics 365 Business Central Forum

Manikanta Adabala asked a question on 11 Jun 2019 1:16 AM

Question Status

Verified

Hello All , I need to add my custom code in standard codeunits in Business Central , can any one suggest me how can i add code to standard codeunits in Business central.

Reply

This is not possible in the SaaS environment, you need to subscribe to standard events (with EventSubscriber definitions) for customizing code.

On-premise you can still modify standard objects as before.

Reply
Manikanta Adabala responded on 11 Jun 2019 2:00 AM

Actually I am working on Upgradation from NAV 2017 to Business Central , in NAV 2017 i have custom functions in Standard Codeunit (Sales-post) now i want to add that custom(functions) code to Business Central.

Reply
Manikanta Adabala responded on 11 Jun 2019 2:10 AM

I have custom functions in " Sales-Post Codeunit(80) " NAV 2017 ,And now I need to add them in Business Central Sales-Post Codeunit.

Reply
Suggested Answer

Are you talking about Business Central on-premise or SaaS?

If on-premise, you can still modify the standard object via CSIDE and add your code in the standard codeunits. In a SaaS environment you can't do that, you cannot modify standard code. You need to check your standard codeunit and detect where you have placed custom code, then use standard events raised by D365BC on that codeunit and subscribe to them.

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

I am Working with Saas , Can I add my Custom function after last Integration Event provided by D365BC.

Reply
Verified Answer

If this is the right point for you, the answer is yes. You need to subscribe the right event where you want to place your custom code.

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

I got it.

Thank you.

Reply
Verified Answer

If this is the right point for you, the answer is yes. You need to subscribe the right event where you want to place your custom code.

Reply
Suggested Answer

Are you talking about Business Central on-premise or SaaS?

If on-premise, you can still modify the standard object via CSIDE and add your code in the standard codeunits. In a SaaS environment you can't do that, you cannot modify standard code. You need to check your standard codeunit and detect where you have placed custom code, then use standard events raised by D365BC on that codeunit and subscribe to them.

Reply

SBX - Two Col Forum

SBX - Migrated JS