Global functions in MS CRM Form.
The way CRM adds the javascript to the page, any function defined in the onload event will only have a local scope and can only be called from within the same onload event. However, if you put the function on the window object, then it should have global scope:
window.MyCustomFunction = function() { ... }
And then you should be able to call the function from an onchange event.
Ex:
// function name = MyCustomFunction
window.MyCustomFunction = function() {
alert("My Global Level Function");
}
1. Go to MS CRM -> Customisations -> Customise Entity -> Choose Entity -> Form and View
2. Go to OnLoad()
3. Put the above fucntion onLoad() // Should be first statment.
4. Go to OnSave()
5. Call this function, MyCustomFunction();
6. When you try to save the entity record this fucntion will get executed.
Hope you enjoy this tip.
Thursday, August 26, 2010
Wednesday, August 11, 2010
A simple definition of Windows Azure
Here is an interesting video that’s informative as well. It’s Friday evening after all , so chill out and enjoy this really nice & simple video that Steve Marx created to explain “What is Windows Azure?” with simple terms and hand drawn sketches.
Now that was a great, wasn’t it. Hope you like this video.
Now that was a great, wasn’t it. Hope you like this video.
Monday, July 19, 2010
Sunday, July 18, 2010
MS CRM Social Networking Workflow DateTime Format Error.
The accelerator code as supplied does not correctly parse Twitter timestamps. DateTime.ParseExact breaks on the odd time zone value, which in (GMT/UK) comes from twitter with the value "+0000".
DateTime.ParseExact can use a format string of "z", "zz", or "zzz", corresponding to "+0", "+00" or "+00:00" respectively, none of which match the Twitter format.
You need to change the code in teh BuildDynEntity() method, in msa_datapump.cs, as follows:
case "CrmDateTimeProperty":
//Twitter timestamps contain odd timezone specifier "+0000" that doesn;t work
// well with DateTime.ParseExact().
CrmDateTimeProperty crmDateTimeProperty = new CrmDateTimeProperty();
CrmDateTime crmDateTimeValue = new CrmDateTime();
DateTimeOffset parsedDateTime = DateTimeOffset.ParseExact(CRMAttrValue, "ddd MMM dd HH:mm:ss zzz yyyy", null);
DateTime localDateTime = new DateTime(parsedDateTime.Ticks, DateTimeKind.Local);
crmDateTimeProperty.Value = CrmDateTime.FromUser(localDateTime);
crmDateTimeProperty.Name = CRMAttrName;
crmEntity.Properties.Add(crmDateTimeProperty);
break;
Save / Complile / Build the assembly.
Register the assembly using plug-in registration tool.
Restart the Microsoft Crm Async Service.
Start Creating the Twitter User. Now the workflow won't failed (i mean it will not be on the Waiting state anymore !!!).
Hope this will resolves the issue.
MS CRM Social Networking Workflow Error (Twitter-Get External Updates / Missing Attributes)
Recently I've installed MS Social Networking Accelerator for MS CRM 4. The installation is very simple, it will get installed very easily. Once you installed and run you will encounter the Workflow errors:
Basically the MSA_snStatus Entity Customisation has some bugs. It does not include the below three attributes: You need to manually create those three attributes.
Open MS CRM App -> Go to Settings -> Go to Customisations -> Customise Entity -> Open MSA_snStatus entity -> Go to Attributes (left hand navigation panel)
Step 1. Add new attribute
Step 2. Specify attribute Display name = Contributors
Step 3. Specify attribute name = msa_snContributors [make sure your application default prefix is msa]
Step 4: datatype = nVarChar
Step 5: specify length = 200
Step 6: Save and clsoe
Repeat the same steps for below attributes:
2. MSA_snCoordinates attribute [Display name = Coordinates / nVarchar / 200]
3. MSA_snPlace attribute [Display name = Place / nVarchar / 200]
Save and Publish the entity.
Reload the MS CRM Application.
Start Creating the Twitter User. Now the workflow won't failed (i mean it will not be on the Waiting state anymore !!!).
Hope this will resolve the issue.
Basically the MSA_snStatus Entity Customisation has some bugs. It does not include the below three attributes: You need to manually create those three attributes.
Open MS CRM App -> Go to Settings -> Go to Customisations -> Customise Entity -> Open MSA_snStatus entity -> Go to Attributes (left hand navigation panel)
Step 1. Add new attribute
Step 2. Specify attribute Display name = Contributors
Step 3. Specify attribute name = msa_snContributors [make sure your application default prefix is msa]
Step 4: datatype = nVarChar
Step 5: specify length = 200
Step 6: Save and clsoe
Repeat the same steps for below attributes:
2. MSA_snCoordinates attribute [Display name = Coordinates / nVarchar / 200]
3. MSA_snPlace attribute [Display name = Place / nVarchar / 200]
Save and Publish the entity.
Reload the MS CRM Application.
Start Creating the Twitter User. Now the workflow won't failed (i mean it will not be on the Waiting state anymore !!!).
Hope this will resolve the issue.
Subscribe to:
Posts (Atom)