Creating records in CRM 2011 using JavaScript

Using the CRM Web Service, you can create new entity records, just using JavaScript. The following code demonstrates this: // Make Struct function MakeStruct(names) { var names = names.split(‘ ‘); var count = names.length; function constructor() { for (var i = 0; i < count; i++) { this[names[i]] = arguments[i]; } } return constructor; }… Continue reading Creating records in CRM 2011 using JavaScript

Set a lookup value in CRM 2011

// Sets the lookup value for a certain field function SetLookupValue(fieldName, id, name, entityType) { if(fieldName != null) { var lookupValue = new Array(); lookupValue[0] = new Object(); lookupValue[0].id = id; lookupValue[0].name = name; lookupValue[0].entityType = entityType; Xrm.Page.getAttribute(fieldName).setValue(lookupValue); } }

JavaScript structures

Here’s a brief example of how to create structures in JavaScript. We’ll use this function a lot from now on in our code. // Make Structfunction MakeStruct(names) { var names = names.split(‘ ‘); var count = names.length; function constructor() { for (var i = 0; i < count; i++) { this[names[i]] = arguments[i]; } }… Continue reading JavaScript structures

Published
Categorized as JavaScript

CRM Stuff – 4 years together

CRM Stuff has reached its 4th anniversary. I’d like to thank the community for all the support, comments, ideas, suggestions and thoughts. Best of luck,CornelCRM Stuff

Published
Categorized as Blog, News

Another way of loading certain CRM Views into an IFRAME on the main form

Since every CRM View has its own GUID and can be launched using the Advanced Find out-of-the-box functionality, you can follow several easy steps to load what view you want (with whatever additional filters you want) in a certain IFRAME available on the crmForm.Here’s the scenario: you wanna display your active contacts (My Active Contacts… Continue reading Another way of loading certain CRM Views into an IFRAME on the main form