Monday, June 7, 2010

Adding Many to many Data

//Links (relates) an account record to a lead record in a manyToMany relationship
Moniker moniker1 = new Moniker();
moniker1.Name = "opportunity";
moniker1.Id = new Guid("0D50E716-2757-DF11-AF09-000C29A10E7B");
Moniker moniker2 = new Moniker();

moniker2.Name = "contact";
moniker2.Id = new Guid("0D6BF93F-9D94-4EC1-970B-5E1B1BFBADA2");
AssociateEntitiesRequest request = new AssociateEntitiesRequest();
request.Moniker1 = moniker1;
request.Moniker2 = moniker2;
request.RelationshipName = "ppp_opportunity_contact";
service.Execute(request);

Source : http://blogs.msdn.com/b/crm/archive/2008/02/14/crm-4-0-relationships-explained.aspx

Sunday, June 6, 2010

Call a function when a CTRL + key is pressed

Trigger a function when a key is pressed.

function filterKeys()
{
if (window.event)
{
// captures the key combination of Ctrl and Shift keys
if(window.event.ctrlKey && window.event.shiftKey)
{
var key = window.event.keyCode;
// captures the key for upper and lower case F
if (key == 70 || key == 102)
//window.event.keyCode = 0; - do nothing
write a custom function here

}
}
}