web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Dynamics 365 Realtime Marketing Event integration using c# plugin

(0) ShareShare
ReportReport
Posted on by

Hello Experts,

I am trying to use c# plugin to register Realtime marketing event. But I am getting error :   Object reference not set to an instance of an object    at line where I initiate Analytics object.
Has anyone does this before?   Is there any work around apart from plugin:

Event is :   On create of Order.

Readymade Code snippet I got in the event is:
pastedimage1629876168181v1.png

Relevant microsoft documentation is here: https://docs.microsoft.com/en-us/dynamics365/marketing/real-time-marketing-custom-events 

Please let me know if anyone has done this.

Thank you in advance 

I have the same question (0)
  • Suggested answer
    Nya Profile Picture
    29,064 on at

    Hi,

    Please try to add the following layer out of your code analytics.xxx.

    if (analytics != null)
    {
    // your original operations
    }
    else
    {
    // other operations
    }

  • Community Member Profile Picture
    on at

    But the code is failing while creating an object itself. So can not go to next line.

  • Suggested answer
    Nya Profile Picture
    29,064 on at

    Hi,

    Would you please specify which version of security protocol you're using in your code?

    You may try to adjust it to TLS 1.2 if it is another version.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
11manish Profile Picture

11manish 107 Super User 2026 Season 2

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 64 Most Valuable Professional

#3
ParthPatel249 Profile Picture

ParthPatel249 62

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans