Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Codeunit - Event Subscriber.

(0) ShareShare
ReportReport
Posted on by 223
Hello there.
I have created a codeunit to handle eventSubscribers.
I have these functions among others.
What the below does, is take a custom field and pass value from the Purchase header to the vendor ledger entry.
So 2 events (one Purchheader to GenJnl and the other event from GenJnl to Vendor ledg).
This works great in my SBX environment running locally on Docker, however does not work on the client environment.
The client is running BC365 on Premise.
This codeunit has other EventSubscibers but they use table Events and they work great.
Any idea why the code below does not work on the client's environment ?
4454.screenshot.png



*This post is locked for comments

  • Armela Kamenica Profile Picture
    223 on at
    RE: Codeunit - Event Subscriber.

    Just wanted to post an update regarding this.

    The events worked fine when we switched the license to our Developer's license. So it has smth to do with Codeunit permissions and licensing.  We can figure it from there, but wanted to post an update in case anyone else runs into the same issue.  Thank you everyone for your input.

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,162 Most Valuable Professional on at
    RE: Codeunit - Event Subscriber.

    There are no differences in codeunit. You can check them by creating a Docker sandbox and pulling Microsoft/bcsandbox image. Codebase is the same.

  • Verified answer
    Armela Kamenica Profile Picture
    223 on at
    RE: Codeunit - Event Subscriber.

    Thanks for your reply

    Unfortunately I don't have a Sandbox for them. I guess the only difference is that they are BC365 on premise so I was hoping someone had some knowledge of differences between Premise and cloud relating to codeunits. Any ideas who I can reach out in support ? I understand MS support does not provide much help with Extension development.  I will also reach out to Github.

    Thanks again.

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,162 Most Valuable Professional on at
    RE: Codeunit - Event Subscriber.

    No sorry, what I mean is that if the extension works on your local system should work also at customer’s site. If you have a sandbox (copy of the customer’s environment) maybe you could debug this sandbox and see what happens. Otherwise it’s quite difficult to understand the problem.

  • Verified answer
    Armela Kamenica Profile Picture
    223 on at
    RE: Codeunit - Event Subscriber.

    I am a little confused.

    So are you saying that I need to install Visual Studio on the customer's environment ? We don't have that there. I am trying to point my Visual Studio Folder (local PC)  for this on the Web environment for this customer via the settings in the Launch.json and it is now working. It is asking me for a user name and password and than it gives me an Internal error when "Dowload Symbols" or Publish.

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,162 Most Valuable Professional on at
    RE: Codeunit - Event Subscriber.

    There's no reason for not working on the customer environment if it works on your sandbox.

    Is the extension activated at customer site? You're on-premise, so try to debug the events from VS Code if possible.

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

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Announcing Our 2025 Season 1 Super Users!

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

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,289 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,068 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans