Thursday, January 20, 2011

Set Status Inactive in CRM - Entity Using C#

// Create the Request Object
          SetStateAccountRequest state = new SetStateAccountRequest();
           //// Set the Request Object's Properties
          state.AccountState = AccountState.Inactive;
           state.AccountStatus = 2;
           state.EntityId = account.accountid.Value;

            service.ExecuteCompleted += new EventHandler(service_UpdateMemberStatus);
          service.ExecuteAsync(state);

Tuesday, January 11, 2011

CRM and jQuery

o1.Add JQuery to crmForm Load Event.
function IncludeExternalScript(scriptFile)
{
var netRequest = new ActiveXObject("Msxml2.XMLHTTP");
netRequest.open("GET", scriptFile, false);
netRequest.send(null);
eval(netRequest.responseText);
}

IncludeExternalScript('http://"Your Link"/_common/styles/test/jquery-1.4.1.js');

$(document).ready(function () {
alert('test');
});


02.Create Dynamic Elements
var body=document.getElementById("tab0");
var boxes = document.createElement("<div id='boxes'/>");
body.appendChild(boxes);

03.Add css in Jquery
$(' #boxes .window').css({ 'width': '440px', 'height': '220px', 'position': 'absolute', 'left': '0', 'top': '0', 'z-index': '9999', 'padding': '20px', 'display': 'none' });

Monday, January 3, 2011

Error : Unable to update the EntitySet. because it has a DefiningQuery and no element exists in the element to support the current operation admin under Entity Framework

Table doesn’t have a primary key defined.
01.Add primary Key in to the Table.
02.Delete and Re Create Entity Class(.edmx)