Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

How to get a record related to a lookup value and another attribute

Posted on by

I have the following scenario:

  1. A Payment (custom entity) has a lookup to a Cost Code (custom entity).
  2. A Cost Code record can be related to 1:N General Ledger (custom entity) records.
  3. General Ledger has an Item attribute.
  4. Payment has an Item attribute.

When creating the payment I need to get the associated General Ledger record based on the Cost Code selected and the Item value on the payment.

I'm suspecting the only way to do this is with custom code.  I really need to expand my knowledge and learn how to move outside of the box. 

I have spent the last year learning Dynamics CRM and have built a relatively complex social services case tracking system for our local government, which includes welfare payments and accounting entities (with MUCH help from this community).  I have squeezed every ounce of juice out of the lemon that I know exists -- there may be more I don't know -- but I'm sure I've hit the ceiling.

Where do I go now?  I want to expand my capabilities and be able to do what I mention above.  I'm a self-taught person, so don't shy from the challenge.

Thanks for any guidance!

*This post is locked for comments

  • Suggested answer
    Nick.Doelman Profile Picture
    Nick.Doelman 1,947 Most Valuable Professional on at
    RE: How to get a record related to a lookup value and another attribute

    This would require some form of custom code.  Ideally a plug-in that when you assign the cost code it will assign the related GL item attribute to the payment entity.  The issue I see right away is how to determine which GL record (since the relationship between cost code and GL is 1:N) to use unless there is only ever one GL record associated to the Cost code.

    Writing plug-ins does require a bit of technical knowledge of C# and Visual Studio, and understanding of the CRM SDK, definitely more than an afternoon's reading.

    A tool (that can handle this requirement) that might be in more alignment to your skill set is an CRM ISV add-on called "North 52"  http://www.north52.com/

    This is a tool where you can write "Excel-like" formula's to essentially implement "plug-in" type features.

    A few of my customers have bought a license to this and have achieved amazing results without having to write a plug-in.  While there is a cost, the amount of productivity would cover the cost of a developer many times over.  North52's support is also extremely good.

    I don't get any kick-backs from these endorsements.  Hope this helps.

    Cheers

    Nick

  • Suggested answer
    Mahadeo Matre Profile Picture
    Mahadeo Matre 17,021 on at
    RE: How to get a record related to a lookup value and another attribute

    Hi,

    If you want this from CRM form, then you have to write some JavaScript in Payment custom entity, on Cost Code lookup event (OnChange).

    When Cost Code selected for payment, then using JavaScript and WEB API you will need to do query on Cost Code entity and get all general ledger associated, and again do query on General Ledger entity to get Item Value.

    Then put this Item value into Payment Item attribute.

    This is more lengthy process.

    I will suggest you to use  CRM REST builder to do query on different entity.

    here is the tool

    crmrestbuilder.codeplex.com

    and also check in CRM SDK for more details.

    www.microsoft.com/.../details.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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans