Reading event in .NET from event in BC

MikhailCMikhailC Member Posts: 1
edited 2022-03-02 in NAV Three Tier
Hello,

To give some context regarding my issue. I currently have a codeunit set up with an event subscriber which looks out for the OnAfterInsertEvent event for a specific table. This is because I want to extract the newly added data I added to my specified table.

I also set up a web service on C# from the codeunit mentioned so as to process the data I extract from the table. I have no issues with using the methods in the code unit in the web service object in C#, however, I would like to be able to automatically process when a new entry to the table onto C# and this is where I would appreciate some assistance.

I was thinking of triggering some new event when the OnAfterInsertEvent subscriber reads an OnAfterInsertEvent. This would look something like this within the codeunit:

[EventSubscriber] CheckNewContact(VAR Rec : Record Contact;RunTrigger : Boolean)
BEGIN
MESSAGE('New Record has been added with ID %1\ID', Contact."No.");

TRIGGER NetNewContactEvent; //This part is pseudo code

END;

Then the event trigger would be picked up in the .NET side and a handler would be created to know when a new contact is created.

Would this be possible? I would also be open for more suggestions if there are any more ideas on how to go about this.

Thank you for your time.

Mikhail

Answers

  • krikikriki Member, Moderator Posts: 9,027
    [Topic moved from 'NAV Tips & Tricks' forum to 'NAV Three Tier' forum]

    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!

Sign In or Register to comment.