Hi @arjunmusuvathy ,
In this Scenario we are assuming Contact as parent Lookup and jobs are the child lookup in Dynamics 365 CRM,
Hence below steps are accordingly contact as Parent and Job as Child.
The codes will read the Contact on load and on change and work respectively.
Please follow the steps given below,
1. Navigate to the in-Portal Management app look for Basic Form and choose the right form where you wish to achieve the functionality,
2. Click on ‘Additional Setting’ Tab,
3. Look for the Custom Script JavaScript,

Please update the code with parent and child and Paste it in custom JavaScript,
$(document).ready(() => {
$("form").ready(() => {
//On the load if the parentLookup has value then enabling the editing in the child lookup or else disable
lookupValue = $("#gh_candidate_name").val() == '' || $("#gh_candidate_name").val() == undefined || $("#gh_candidate_name").val() == null ? null : $("#gh_candidate_name").val();
lookupValue == null ? disableChild() : enableChild();
//onchange of parent Lookup: Lookup has three inputs, copy the id where id is stored of the record

$("#gh_candidate").change(() => {
lookupValue = $("#gh_candidate_name").val() == '' || $("#gh_candidate_name").val() == undefined || $("#gh_candidate_name").val() == null ? null : $("#gh_candidate_name").val();
lookupValue == null ? disableChild() : enableChild();
})
})
//functions to show hide
function disableChild() {
$("#gh_job").parent().parent().find(".btn.btn-default.launchentitylookup").attr("disabled", "disabled");
$("#gh_job").parent().parent().find("input").attr("disabled", "disabled");
}
function enableChild() {
$("#gh_job").parent().parent().find(".btn.btn-default.launchentitylookup").removeAttr("disabled");
$("#gh_job").parent().parent().find("input").removeAttr("disabled");
}
})
Thanks!
Inogic Professional Services Division
Power Platform and Microsoft Dynamics 365 CRM Development – All under one roof!
Drop an email at crm@inogic.com
Services: http://www.inogic.com/services/
Power Platform/Dynamics 365 CRM Tips and Tricks: http://www.inogic.com/blog/