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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Getting Customer Name populated on case form on entering Invoice ID using Mappings

(0) ShareShare
ReportReport
Posted on by 676

Let's say I am on Case form. Here in the phone to case business process, I have field which is a lookup to Invoice. As Account and Invoice have 1:N relationship. What I want is such a mapping that on entering a correct invoice ID, the associated Account should get populated in the Customer field present on the Case Form.

Any help, suggestions would be highly appreciated here. 

Context : Dynamics CRM 365 online

*This post is locked for comments

I have the same question (0)
  • Verified answer
    PS Profile Picture
    23,577 on at

    Hi Mohd Tahir

    Mapping works, when you create a new record from an existing record. In your case you are not creating a new record from an existing one instead you are associating an existing record (invoice) to a new record (case).

    An alternative could be, make invoice field mandatory and customer field non mandatory on case form. Now create a real time workflow,

    trigger on case creation

    check condition if case {invoice} contains data

    update case {customer}= invoice {customer}

    or else

    You can use a javascript to fetch value of customer on invoice and update customer of case. following URLs might help:

    stackoverflow.com/.../get-a-value-from-lookup-field-in-crm-2015-using-javascript

    mehmetgunen.com/get-set-lookup-field-value-using-javascript-in-crm

    social.microsoft.com/.../update-lookup-field-of-contact-using-soap-javascript

  • Inogic Profile Picture
    703 on at

    Mappings work only under the parent context i.e. if a new record is created from inside an existing record for example when an opportunity is created on qualifying a lead.

    In your case, you wish to set the customer on change of Invoice Id so the only approach to achieve it in real time is script.

    You can register a script on change of the invoice id and set the customer based on that.

    Plugin and real-time workflow will only work after you save the record, so if you are restricted to set the customer on change of Invoice Id then script is the only option.

    Thanks!

  • Mohd Tahir Profile Picture
    676 on at

    Hi Prashant,

    There is a field with schema name "new_InvoiceIdSearch" on the form. Is this the right way to pick the value entered by the user in this field? Please have a look on following JS code:

    InvoiceId = Xrm.Page.data.entity.attributes.get('new_InvoiceIdSearch');
    entityLabel = InvoiceId.getValue()[0].name;


    Will entityLabel catch the value entered by the user. It isn't working as of now.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans