| Daren's profileDaren TurnerBlogLists | Help |
|
29 March Viewing a Logo in Microsoft CRMI'm always getting the question on how to view a logo or image in Microsoft CRM. Well here is a quick customization you can add to your account form and view a logo. Once you add this script on the 'OnLoad' event of the form, all you need to do is add an image called 'logo.jpg' as an attachment and everything will show up properly. This customization will even work offline. Script var Loaded = false; if(crmForm.FormType ==2 || crmForm.FormType ==3 || crmForm.FormType ==4) // attach an event so we know when the notecontrol is done loading // refresh the notecontrol function LoadLogo() var oDoc = (oNotes.contentWindow || oNotes.contentDocument); //Iterate through all the attachments. When your done, your form should look like this. If you really want to get creative you can go a little further and build a viewer to page through all images that are attached to the record.
This customization may not be supported by Microsoft and is provided as-is with no warranty. 28 March Replicating CRM Records to another CRM SystemA friend of mine called me up and asked if it was possible to create records in one CRM system when they are created in another one. Well here is a quick example of how to do it. Assumptions
If there are discrepencies with the guids in each system, there will be issues with this example. When the postImageEntityXml is Deserialized into a DynamicEntity, it has the guid of the source system. When it's created in the target system, it's created with the same guid. For this example I will show you a simple Post Callout to replicate a Create action, but I recommend sending these transactions to a Message Queue and then processing them from there. It's also not only limited to Create, the same thing can be done for other actions. Code public override void PostCreate(CalloutUserContext userContext, CalloutEntityContext entityContext, string postImageEntityXml) //build the credentials for access if the current user doesn't have access. DynamicEntity entity = (DynamicEntity)Serialization.DeserializeBusinessEntity(postImageEntityXml); TargetCreateDynamic targetCreate = new TargetCreateDynamic(); CreateRequest request = new CreateRequest(); request.Target = targetCreate; CRMSDK.CreateResponse response = (CRMSDK.CreateResponse) service.Execute(request); return entity; This code isn't entity specific so it will work for most of the entities in CRM. All the entity information is in the postImageEntityXml and is Deserialized into the DynamicEntity. Callout Registration <callout entity="account" event="PostCreate"> <callout entity="contact" event="PostCreate"> There are a lot more things you can do to improve this process. This is just a simple example. Some other things to consider adding into your solution is Message Queueing and Exception Handling. Hope this helps. A big shout out to Henry who is out in Ohio this week :).
This customization may not be supported by Microsoft and is provided as-is with no warranty. Shortcut Buttons in Microsoft CRMIf you want to try to cut down on clicks on CRM forms, one thing you can do is create a ISV button for actions they perform a lot. For example if users create appointments from the contact form, they would have to either go to Actions > Add Activity >Appointment in the top menu or click on Activities > New Activity > Appointment from the menu on the left. Here is the shortcut. Add a ISV button in the isv.config.xml file. <Entity name="contact"> The text in Red is the same function called when you click new appointment from the menu. Save the changes and refresh your contact form. Hope this helps
This customization may not be supported by Microsoft and is provided as-is with no warranty. Custom Lookups in Microsoft CRMIf you're like me and don't like having to do your own custom lookups as an ISV button, then here is a better way of doing it. This customization will allow you to implement lookup functionality and have it look like the CRM lookups. It just looks a lot cleaner. Adding the Button First you will need to determine which field you want to add the button to and get the id of the input. For this example I'll use the country text field on the Contact form which is address1_country. Then add the following code to the 'OnLoad' of the Contact Form. var beforehtml = "<TABLE class='lu' style='TABLE-LAYOUT: fixed' cellSpacing='0' cellPadding='0' width='100%'><TR><TD>" document.getElementById("address1_country").parentElement.innerHTML = beforehtml + document.getElementById("address1_country").parentElement.innerHTML + afterhtml; The form should look like this after you publish your changes and open the form. Notice the button next to the Country/Region field. This is just a text box but it has a button like a lookup. Opening the Lookup Once you have the button in place you will need to add the onclick function to the 'OnLoad' of the Form. Add the following script to the form. You can develop the custom lookup to do anything you like, you could even pass parameters to the lookup and do whatever you want. I usually try to make my custom lookups have the same look and feel as crm.
this.CustomLookup = _CustomLookup; Once the user has selected a value from you lookup, set the returnvalue of the window and then it will be assigned to your returnval variable. Then make sure it actually has a value, and then populate the text box. You're good to go. Hope this helps.
This customization may not be supported by Microsoft and is provided as-is with no warranty. |
|
|