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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Calculated field between two entities

(0) ShareShare
ReportReport
Posted on by 62

I have two different entities in CRM and have to find a difference between date present in one entity and date present in another entity.

I tried using calculated column but the field's schema name from another entity is not showing up in formula.

Can anyone help me out how to achieve this?

FYI

Entity 1: Rebate & Approvals, Field - Sales Delivery Committed Date

Entity 2: OFG Data, Field - NWC Invoice Date

Calculated Field: Diff b/w committed and Invoice date

pastedimage1667969996802v1.png

I have the same question (0)
  • Suggested answer
    Bipin D365 Profile Picture
    28,985 Moderator on at

    Hi,

    You can use data from Lookup records within your Action. You first have to select the Lookup field and then type a period. After that, you can select one of the fields available on the related entity. For example, in the case of <LookupFieldName>.<RelatedFieldName>, you can select: ParentAccountId.AccountNumber.

    Note that field level security will be ignored on the related entity, so if there is sensitive data in the accessed field we suggest securing your calculated field as well.

    learn.microsoft.com/.../define-calculated-fields

    This will only work when you have relationship defined between two entities.

  • Rajath Krishna S Profile Picture
    62 on at

    I have used jScript to find number of days between two dates. But I am getting error as "Web resource method does not exist". 

    I have tried all the ways to fix. Can anyone help?

    function datediff(){
    var d1=crmForm.all.FirstDate.DataValue;
    var d2=crmForm.all.SecondDate.DataValue;
    var DayValue=1000*60*60*24;
    alert(Math.ceil((d2.getTime()-d1.getTime())/DayValue));
    var d1=Xrm.Page.getAttribute(“new_salesdeliverycommitteddate").getValue();
    var i= Xrm.Page.getAttribute(“new_numberofdocumentsofnwc").getValue();
    var d2=Xrm.Page.getAttribute(“new_nwcinvoicedate”+i).getValue();
    var DayValue=1000*60*60*24;
    var diff = Math.ceil((d2.getTime()-d1.getTime())/DayValue);
    Xrm.Page.getAttribute(“new_diffbwcustomerdelivery_invoicedate").setValue(diff);
    }

  • Suggested answer
    Bipin D365 Profile Picture
    28,985 Moderator on at

    Hi,

    Please validate of javascript syntax is correct.

    esprima.org/.../validate.html

    Please share screenshot of your event handler

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
11manish Profile Picture

11manish 165

#2
ManoVerse Profile Picture

ManoVerse 156 Super User 2026 Season 1

#3
Zhilan Profile Picture

Zhilan 49

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans