Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Answered

Plugin Guid declaration

Posted on by Microsoft Employee

I want to know that If my code is 

Entity account=new Entity("account");

Guid  gid=account.id;

what happen  if I am not used guid .what the 2 line meanining and why it is decalare when we define entity.

  • Suggested answer
    ProdevXRM Profile Picture
    ProdevXRM 10 on at
    RE: Plugin Guid declaration

    Hi,

    If you are not using a guid in the declaration, you will receive an error on compile time, that you cannot convert the type "System.Guid" to the type that you will use.

  • Verified answer
    Johao Larios Profile Picture
    Johao Larios 1,795 on at
    RE: Plugin Guid declaration

    Hello Khan,

    Please test the code I provided, I think it should work without the guid.

    Regards,

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Plugin Guid declaration

    My question is what error will come if I am not using guide declaration.

  • Suggested answer
    Johao Larios Profile Picture
    Johao Larios 1,795 on at
    RE: Plugin Guid declaration

    Hello Khan,

    This is because the system "helps" developers to write less code, for example:

    Entity newAccount = new Entity("account");

    newAccount["name"] = "TEST";

    service.Create(newAccount);

    this should work.

    Regards!

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans