Achintha Gunasekara
Achintha Gunasekara

Reputation: 1165

Dynamics Online (2011) crmForm.SetFieldReqLevel issue

I'm using Dynamics Online (2011). I'm trying to make a field required based on a client selection, but to get me started I've written the below script to make the field required regardless of their selection. However when I run call this function I get the following error. any help would be highly appropriated.

 function updateProductAreaRequirement() {


    try {
        crmForm.SetFieldReqLevel("pt_productarea", 1);
    }
    catch(err) {

        alert("Error : " + err);
    }

}

enter image description here

Upvotes: 1

Views: 527

Answers (2)

James Wood
James Wood

Reputation: 17562

You're using CRM 4 JavaScript, try the newer CRM 2011 syntax.

Xrm.Page.getAttribute("pt_productarea").setRequiredLevel("required");

Xrm.Page Reference.

Upvotes: 4

Scorpion
Scorpion

Reputation: 4585

Please read this discussion discussion. Someone has suggested a workaround for the same issue. I hope it will help you.

crmForm.all.<fieldname>Select.children[1].bCached = false;

Upvotes: 1

Related Questions