Hi Raja, You can do it with javascript and without relationship in these two entities ; however you have to have a field value in both of these entities which are similar and on the entity A you have create that field as an alternate key.
now you have to retrieve the below :
var entitybvalue = Xrm.Page.getAttribute(“entitybvalue”).getValue();
var similarvalue = Xrm.Page.getAttribute(“similarvalue”).getValue();
now do an webapi call :
var req = new XMLHttpRequest();
req.open("GET", Xrm.Page.context.getClientUrl() + "/api/data/v8.1/entityA(alternatekeyonentityA='12345')?$select=valuefromentityA", true);
req.setRequestHeader("OData-MaxVersion", "4.0");
req.setRequestHeader("OData-Version", "4.0");
req.setRequestHeader("Accept", "application/json");
req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
req.setRequestHeader("Prefer", "odata.include-annotations=\"*\"");
req.onreadystatechange = function() {
if (this.readyState === 4) {
req.onreadystatechange = null;
if (this.status === 200) {
var result = JSON.parse(this.response);
var mobilephone = result["valuefromentityA"];
//do your comparison here and set the value to current entityB.
} else {
Xrm.Utility.alertDialog(this.statusText);
}
}
};
req.send();
mark my suggestion as verified if helpful