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 :
Customer experience | Sales, Customer Insights,...
Answered

How to access a field in another entity from current entity?

(0) ShareShare
ReportReport
Posted on by 10

Hello everyone,

I am new to Dynamics I have a task to do but due to my insufficient experience, I am finding it hard to do. Here is the situation.

I have 2 entities -> Contact and Invoice. On the Invoice entity, I have a field named 'Payment Terms' -> this field must be 'read-only' and the value must be taken from another field, this time in the Contract entity.

How can I take the value for 'Payment Terms' from the Contract entity, while I am currently customizing the Invoice entity?

My Team Leader suggested using a plugin to do that and I've tried to come up with something for days, but I am facing the same problem in Visual Studio as well. I am clueless how to get access to Contract from the current entity context.

I've also thought of a Business rule, however I read it is impossible to do.

Any suggestion is much appreciated. Thank you for your time.

I have the same question (0)
  • Mahendar Pal Profile Picture
    45,095 on at

    Hi,

    First can you confirm you want to get it from Contact or Contract

    "I have 2 entities -> Contact and Invoice. On the Invoice entity, I have a field named 'Payment Terms' -> this field must be 'read-only' and the value must be taken from another field, this time in the Contract entity."

    As first you have mentioned Contact and then later you are using contract.

    Can you provide details how these entities are related and what is the use case, so that we can suggest you on this.

    Let me know.

  • IvoKostov Profile Picture
    10 on at

    Hello Mehender,

    I apologize for this silly mistake. I want to get it from ContRact.

    The relationship between Contract and Invoice is 1:N and also invoices are sent to the contract owner once a month.

    I hope I answered your question.

  • Verified answer
    Mahendar Pal Profile Picture
    45,095 on at

    Ok, thank for provide more details.

    As Contract and Invoice is having 1:N relationship, so when invoice is created you will be having contract lookup set on invoice form, so some possible options are

    If user creates invoice from the Contract, you can add system mapping from the contract and invoice relationship to copy this field value from Contract to invoice.

    You can refer from here

    docs.microsoft.com/.../map-entity-fields

    When user creates invoice directly (not from contract), you can using following options

    1. Write a pre create/update plugin on the invoice where you can check if contract id is present (means contract lookup is filled), get contract id from there query paymentterms and set the same in the invoice payment term field.

    2. You can have this using workflow as well, run workflow on create and on change of the contract, set payment term field from the contract based on the lookup.

    3. Write js onchange of the contract lookup, and onsave of the entity form to get payment term field from contract and set it in the inovice.

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 > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 144 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 59

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 52 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans