Tag Archives: Application

CRM 2011: Did you know that…

The last couple of weeks have been like a roller coaster. I was lucky enough to visit the Microsoft road show on CRM 2011 in Amsterdam ánd attend the extreme 2010 conference in Las Vegas. Both were very interesting and inspired me to take a look at some of the new features.

One nifty feature is the use of field level security (FLS). As you all may know this functionality is only available for custom attributes, for now. If you really want to apply it on out of the box attributes, you might want to check this blog post (unsupported of course).

As described in the SDK it is rather easy to set up and use field security. It also tells us how such fields behave in the application.

“When you call Retrieve or RetrieveMultiple, the system evaluates if the caller or impersonated user has access to each retrieved record (normal security process) and each secured field. The call does not throw an exception if the criteria contains secured fields for which the caller does not have access, instead, null values are returned for secured fields if they are part of the output Columnset.”

Unfortunately I found out that fields which have field security enabled can’t be accessed during bulk edit. In the example below I selected five contacts and clicked the edit button. In this case I can’t select the Yearly Income field, but it does not show read only like the Parent Customer field.

More “did you knows” are on their way.

Tagged as: , ,

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars (2 votes, average: 4.50 out of 7)
Loading ... Loading ...

Improving GUI (static) information on forms

In MS CRM most of the data is stored in regular changeable text boxes. For data that needs to be changed often this is useful. For data that hardly changes the boxes take up a lot of valuable space on the form. When we thought of this we came to the conclusion that it would be nice to have the information shown on the form as regular text, with the ability to change it in the regular way. The information takes a lot less space of the form. The space that is left can be used to show other information.
We have come up with a solution as shown below. The solution is not finished yet. The lay-out can be improved, but more important some of the links are lost, because they are shown as plain text. I’m working on these improvements.

The first picture shows a filled account form. I have used the standard account form with 4 extra fields: 2 check boxes and 2 text fields. And some script. Technical description follows below the pictures.

To change the fields on the form, use the check boxes to make the sections shown. Change the regular fields and save the changes.

It is also possible to change only the contents of one of the two boxes.

This is just an example of the possibilities. Hope it helps improving the user experience of MS CRM.

For this example I have created 4 extra field on the account form:

2 text boxes: new_details and new_addressdetails.
2 check boxes:  new_changeaccountinformation and new_changeaddress.

For this example I just made it work, I haven’t build in al the business logic regarding changes in the regular boxes. In the script on the onLoad the text is written and overwritten. But to make clear what does what, I have placed the scripts on the onChange of the specific field it influences.

The Script

Account onLoad script to trigger the onChange scripts:

crmForm.all.new_addressdetails.FireOnChange();
crmForm.all.new_changeaddress.FireOnChange();
crmForm.all.new_details.FireOnChange();
crmForm.all.new_changeaccountinformation.FireOnChange();

new_details onChange script:

/*
copy values to variables
*/
if (crmForm.all.name.DataValue!=null)
{
var name = 'Account Name:\t' + crmForm.all.name.DataValue + '\n';
}
else
{
var name = "";
} 

if (crmForm.all.accountnumber.DataValue!=null)
{
var accountnumber = 'Account Number:\t' + crmForm.all.accountnumber.DataValue + '\n';
}
else
{
var accountnumber = "";
} 

if (crmForm.all.customertypecode.DataValue!=null)
{
var customertypecode = 'Relationship Type:\t' + crmForm.all.customertypecode.SelectedText + '\n';
}
else
{
var customertypecode = "";
} 

if (crmForm.all.telephone1.DataValue!=null)
{
var telephone1 = 'Main Phone:\t' + crmForm.all.telephone1.DataValue + '\n';
}
else
{
var telephone1 = "";
} 

if (crmForm.all.telephone2.DataValue!=null)
{
var telephone2 = 'Other Phone:\t' + crmForm.all.telephone2.DataValue + '\n';
}
else
{
var telephone2 = "";
} 

if (crmForm.all.fax.DataValue!=null)
{
var fax = 'Fax:\t\t' + crmForm.all.fax.DataValue + '\n';
}
else
{
var fax = "";
} 

if (crmForm.all.websiteurl.DataValue!=null)
{ 

var websiteurl = 'Website:\t\t' + crmForm.all.websiteurl.DataValue + '\n';
}
else
{
var websiteurl = "";
} 

if (crmForm.all.emailaddress1.DataValue!=null)
{
var emailaddress1 = 'E-mail:\t\t' + crmForm.all.emailaddress1.DataValue + '\n';
}
else
{
var emailaddress1 = "";
} 

if (crmForm.all.parentaccountid.DataValue!=null)
{
var lookup = crmForm.all.parentaccountid.DataValue;
if (lookup[0] != null)
{
var parentaccountid = 'Parent Account:\t' + lookup[0].name + '\n';
}
}
else
{
var parentaccountid = "";
} 

if (crmForm.all.primarycontactid.DataValue!=null)
{
var lookup = crmForm.all.primarycontactid.DataValue;
if (lookup[0] != null)
{
var primarycontactid = 'Primary Contact:\t' + lookup[0].name + '\n';
}
}
else
{
var primarycontactid = "";
} 

/*
create contents of text box
*/
crmForm.all.new_details.DataValue =
name.toString() +
accountnumber.toString() +
customertypecode.toString() + '\n' +
telephone1.toString() +
telephone2.toString() +
fax.toString() +
websiteurl.toString() +
emailaddress1.toString() +
parentaccountid.toString() +
primarycontactid.toString();
crmForm.all.new_details.ForceSubmit = true; 

/*
Change properties of the text box
*/
/*
make field readonly
*/
crmForm.all.new_details.readOnly = true;
/*
make background transparant
*/
crmForm.all.new_details.style.backgroundColor='transparent';
/*
hide scrollbar
*/
document.all.new_details.style.overflow='hidden';
/*
make font bold
*/
document.all.new_details.style.fontWeight='bold';
/*
change left padding
*/
document.all.new_details.style.paddingLeft='10px';
/*
make borders invisible
document.all.new_details.style.border='none';
*/

new_addressdetails onChange script:

/*
copy values to variables
*/
if (crmForm.all.name.DataValue!=null)
{
var name = crmForm.all.name.DataValue + '\n \n';
}
else
{
var name = "";
} 

if (crmForm.all.address1_name.DataValue!=null)
{
var addressname = crmForm.all.address1_name.DataValue + ' ';
}
else
{
var addressname = "";
} 

if (crmForm.all.address1_addresstypecode.DataValue!=null)
{
var addresstypecode = '('+crmForm.all.address1_addresstypecode.SelectedText +')'+ '\n';
}
else
{
var addresstypecode = "";
} 

if (crmForm.all.address1_line1.DataValue!=null)
{
var line1 = crmForm.all.address1_line1.DataValue + '\n';
}
else
{
var line1 = "";
} 

if (crmForm.all.address1_line2.DataValue!=null)
{
var line2 = crmForm.all.address1_line2.DataValue + '\n';
}
else
{
var line2 = "";
} 

if (crmForm.all.address1_line3.DataValue!=null)
{
var line3 = crmForm.all.address1_line3.DataValue + '\n';
}
else
{
var line3 = "";
} 

if (crmForm.all.address1_city.DataValue!=null)
{
var city = crmForm.all.address1_city.DataValue + '\n';
}
else
{
var city = "";
} 

if (crmForm.all.address1_stateorprovince.DataValue!=null)
{
var stateorprovince = crmForm.all.address1_stateorprovince.DataValue + ' ';
}
else
{
var stateorprovince = "";
} 

if (crmForm.all.address1_postalcode.DataValue!=null)
{
var postalcode = crmForm.all.address1_postalcode.DataValue + ' ';
}
else
{
var postalcode = "";
} 

if (crmForm.all.address1_country.DataValue!=null)
{
var country = crmForm.all.address1_country.DataValue + '\n';
}
else
{
var country = "";
} 

/*
create contents of text box
*/
crmForm.all.new_addressdetails.DataValue =
name.toString() +
addressname.toString() +
addresstypecode.toString() +
line1.toString() +
line2.toString() +
line3.toString() +
postalcode.toString() +
city.toString() +
stateorprovince.toString() +
country.toString();
crmForm.all.new_addressdetails.ForceSubmit = true; 

/*
Change properties of the text box
*/
/*
make field readonly
*/
crmForm.all.new_addressdetails.readOnly = true;
/*
make background transparant
*/
crmForm.all.new_addressdetails.style.backgroundColor='transparent';
/*
hide scrollbar
*/
document.all.new_addressdetails.style.overflow='hidden';
/*
make font bold
*/
document.all.new_addressdetails.style.fontWeight='bold';
/*
change left padding
*/
document.all.new_addressdetails.style.paddingLeft='10px';
/*
make borders invisible
document.all.new_addressdetails.style.border='none';
*/

new_changeaccountinformation onChange script to hide and show the Account Information section:

if (crmForm.all.new_changeaccountinformation.DataValue == "1")
{
crmForm.all.name_c.parentElement.parentElement.parentElement.style.display ='block'
}
else
{
crmForm.all.name_c.parentElement.parentElement.parentElement.style.display ='none'
}

new_changeaddress onChange script to hide and show the Address Details section:

if (crmForm.all.new_changeaddress.DataValue == "1")
{
crmForm.all.address1_name_c.parentElement.parentElement.parentElement.style.display='block'
}
else
{
crmForm.all.address1_name_c.parentElement.parentElement.parentElement.style.display='none'
}
Tagged as: , , ,

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars (1 votes, average: 6.00 out of 7)
Loading ... Loading ...

(Disabled) Business Required Fields

If you disable a Business Required field, it is no longer Business Required. So the field can be empty if you save the Form. An easy way to solve this is to manually check the Required condition on the onSave of the form.
If the field is empty the onSave is stopped.

if (crmForm.all.new_requiredfield.DataValue == null)
{
alert ("Please fill the required field");
event.returnValue = false;
return false;
}
Tagged as: , ,

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars (No Ratings Yet)
Loading ... Loading ...
Page 1 of 3123
  • Recent Posts

  • Ratings

  • Archive

  • Admin

  • Cloud

  • Microsoft Certified Professional

  • About & Contact