Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Linq query and early bound

Posted on by 35

4380.Untitled.jpg

hello guys 

hope you are fine !

id like to write a code that retrieve data from two entities (vacancy , employee) -im now in the employee entity- so i can find if these fields are equal (using linq query) to create a new record .. Im working in a crm 2016 on-premises .

As a new crm developer i dont know how to retrieve data and how to write this linq query ..

lets suppose that the fields i want to retrieve data from are :

1-Position(emp) == Requested position (vacancy) ?

2-Employement (emp) == Vacancy Type (vacancy) ?

3-Age(emp) == RequiredAge (vacancy) ? 

and do i have to use early bound in my code , if yes how do i write it?

Thank u in advance !

*This post is locked for comments

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Linq query and early bound

    There are several sample available in the SDK which you can refer to understand and write code for your CRM.

    msdn.microsoft.com/.../gg309721.aspx

    SDK can be downloaded from here-

    www.microsoft.com/.../details.aspx

    You don't *have* to use early bound. Its up to you which style you prefer. I personaly prefer late bound.

    Check these link for this for comparison-

    carldesouza.com/dynamics-crm-early-bound-vs-late-bound

    woodsworkblog.wordpress.com/.../crm-2011-early-binding-vs-late-binding-performance

    develop1.net/.../Early-Binding-vs-Late-Binding-Performance-Revisited.aspx

    For this specific requirement, you don't even have to write code. You can check the field values even with the workflows (but it depends upon how you have structured you entity)

    Also with respect to code, you again have various options like JavaScript, Plugins, Cusotm Workflow activity.

    These options depend upon what you want to achieve and based on your requirements.

    High level, you need to use retrieve or retrievemultiple to retrieve the records. Agaon with this also you have different options (QueryExpression, fetchXMl & Querybyattribute)

    msdn.microsoft.com/.../gg328149.aspx

    msdn.microsoft.com/.../gg334708.aspx

    msdn.microsoft.com/.../gg328117.aspx

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,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans