Zoeken in deze blog
maandag 29 november 2010
maandag 8 november 2010
Importing two or more entities from a Single File (2011)
http://blogs.msdn.com/b/crm/archive/2010/11/04/importing-two-or-more-entities-from-a-single-file.aspx
donderdag 21 oktober 2010
Uitvragen aantal veld (2011)
{
var locAttr = Xrm.Page.data.entity.attributes.get("numberofemployees");
alert(locAttr.getValue());
}
dinsdag 19 oktober 2010
Eigenschappen van een Lookup uitvragen (2011)
{
var LookupItem = Xrm.Page.data.entity.attributes.get("primarycontactid");
if (LookupItem.getValue() != null)
{
// The GUID of the lookup
alert(LookupItem.getValue()[0].id);
// The text value of the lookup
alert(LookupItem.getValue()[0].name);
// The entity type name
alert(LookupItem.getValue()[0].typename;
// The entity type code of the lookup 1=account, 2=contact
alert(LookupItem.getValue()[0].type);
}
}
maandag 4 oktober 2010
2011 – Hide Areas of a Form
// Hide the Ribbon Toolbar and move the form Content area to the top of the window.
window.top.document.getElementById(“crmTopBar”).style.display = “none”;
window.top.document.getElementById(“crmContentPanel”).style.top = “0px”; // Move Form Content area up to top of window, initial style.top is 135px
// Hide Left Hand Nav bar / pane
document.getElementById(“crmNavBar”).parentElement.style.display = “none”;
document.getElementById(“tdAreas”).parentElement.parentElement.parentElement.parentElement.colSpan = 2;
// Hide the Breadcrumb and Record Set Toolbar
document.getElementById(“recordSetToolBar”).parentElement.style.display = “none”;
// Hide the Form Footer Bar
document.getElementById(“crmFormFooter”).parentElement.style.display = “none”;
Original Post by Rhett Clinton
donderdag 9 september 2010
Collapsable Form Sections
function getElementsByCondition(condition, container) {
container = container || document;
var all = container.all || container.getElementsByTagName('*');
var arr = [];
for (var k = 0; k < all.length; k++) {
var elm = all[k];
if (condition(elm, k))
arr[arr.length] = elm;
}
return arr;
}
function attachCollapsableToSections() {
var sections = getElementsByCondition(function (elm) { if (elm.className.indexOf("ms-crm-Form-Section") != -1) return true; }, null);
for (var i = 0; i < sections.length; i++) {
sections[i].innerHTML = '<img alt="Expanded, click to collapse" src="/_imgs/navup.gif" style="cursor:hand;"/>' + sections[i].innerHTML;
sections[i].childNodes[0].attachEvent('onclick', toggleVisibility);
}
}
function toggleVisibility(e) {
var sectionContainer = e.srcElement.parentNode.parentNode.parentNode;
var elements = getElementsByCondition(function (elm) { if (elm.vAlign == "top") return true; }, sectionContainer);
for (var i = 0; i < elements.length; i++) {
if (elements[i].style.display == "none") {
elements[i].style.display = "";
e.srcElement.src = e.srcElement.src.replace("navdown", "navup");
}
else {
elements[i].style.display = "none";
e.srcElement.src = e.srcElement.src.replace("navup", "navdown");
}
}
}
attachCollapsableToSections();
dinsdag 7 september 2010
Custom Warning
/*============== addNotification function =============
Adds a warning message on the top of the entity form using
the same visual style as Microsoft CRM
Params: message to be shown to the user
=======================================================*/
addNotification = function(message) {
var notificationHTML = '<DIV class="Notification"><TABLE cellSpacing="0" cellPadding="0"><TBODY><TR><TD vAlign="top"><IMG class="ms-crm-Lookup-Item" alt="" src="/_imgs/error/notif_icn_crit16.png" /></TD><TD><SPAN>' + message + '</SPAN></TD></TR></TBODY></TABLE></DIV>';
var notificationsArea = document.getElementById('Notifications');
if (notificationsArea == null) return;
notificationsArea.innerHTML += notificationHTML;
notificationsArea.style.display = 'block';
}
/*============= END addNotification function ===========*/
//Example of utilizations
addNotification('Some warning message that you want to show to the user ');