Hi @ELango ,
I have written below code and it works on my machine.
function SetProjectName(executionContext)
{
alert(1);
formContext = executionContext.getFormContext();
if(formContext.getAttribute("msft_emergencycontact").getValue()!=null)
{
alert(2);
var projectId= formContext.getAttribute("msft_emergencycontact").getValue()[0].id;
projectId=projectId.replace('{','').replace('}','');
Xrm.WebApi.online.retrieveRecord("contact", projectId, "?$select=fullname").then(
function success(result) {
var fullname = result["fullname"];
alert(fullname);
formContext.getAttribute("msft_testsolutioncomparertool").setValue(fullname);
},
function(error) {
Xrm.Utility.alertDialog(error.message);
}
);
}
}
Please replace below values -
msft_emergencycontact ->your Project ID lookup field schema name
contact -> Your Target Entity Name (Project Lookup )
fullname -> Text field schema name from Project master table
msft_testsolutioncomparertool-> Project Name schema name



Please mark my answer verified if this is helpful!
Regards,
Bipin Kumar
Follow my Blog: https://xrmdynamicscrm.wordpress.com/