Hello All,
I have one lookup field on CRM form which is mandatory, I am setting the value for it using javascript even after that it shows mandatory error message. I tried setting the focus on the field but no luck. Please find below screenshot.
*This post is locked for comments
I had the same issue. I have done the following to fix it.
Xrm.Page.getControl("seda_lead").setNotification("CR Number Does not Exist, Create New Lead", "101")
Xrm.Page.getControl("seda_lead").clearNotification("101");
Add the Notification and then remove it the error goes.
No in that case its working fine only when I select the record with no name.
Hi,
Are you facing the same issue in case when the lookup is set with record having primaryfield value instead "." ?
walkthrough the link....hope it helps: garethtuckercrm.com/.../crm-2013-new-features-javascript-notifications
But, its a required field on form. I can not remove the required level.
please try to add it in your code
Xrm.Page.getAttribute("customerid").setRequiredLevel("none");
1. Default Contact Entity.
2. Yes its lookup field from Contact Entity.
3. In Contact entity Full Name is primary key, but there are some records wherein value for Full Name is not present for those records, while selecting in lookup we are assigning default name to it as '.' after selecting its not clearing error message.
can you elobrate more
1. are you using custom entity or default.
2. is customer id is a lookup field .
3. from were you are fetching the customid id, is it correct that you fetch from same field and set it to same
No luck. :(
hi'
can you try with this code below
function onChange_Customer()
{
if(Xrm.Page.getAttribute("customerid").getValue() != null)
{
if(Xrm.Page.getAttribute("customerid").getValue()[0].name == '')
{
var id = Xrm.Page.getAttribute("customerid").getValue()[0].id;
var firstEntityType = "contact";
var lookup = new Array();
lookup[0] = new Object();
lookup[0].id = id;
lookup[0].name = '.';
lookup[0].entityType = firstEntityType;
Xrm.Page.getAttribute("customerid").setValue(lookup);
Xrm.Page.getControl("customerid").clearNotification();
}
}
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156