I have tried the following to get the lookup rendered as a drop down to hide other fields based on its value
function hideShowSections(executionContext) {
formContext = executionContext.getFormContext();
RequestTypeLookupName = formContext.getAttribute("requesttype").getValue()[0].id;
var FieldToSHow = formContext.getAttribute("fundingofficial");
if (formContext.getAttribute("requesttype").getValue()[0].name == "Parking")
{
FieldToSHow.setVisible(true);
} else
{
FieldToSHow.setVisible(false);
}
}
Here is another set of code I tried also unsuccessful
//# field with the conditional logic
$(document).ready(function () {
$("#inspectselectionid").change(onDisplaySectionChange);
onDisplaySectionChange();
});
function onDisplaySectionChange() {
var varSubject = $('#inspectselectionid').find("setIsDirty(this.id)").text();
// if lookup rendered as dropdown is Parking show justification field else hide
if (varSubject === "Parking") {
$('#logicalfieldtoshow').parent().parent().show();
}
else {
$('#logicalfieldtohide').parent().parent().hide();
}}