Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM forum
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.

Categories:
  • 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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

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

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,558 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,645 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans