Skip to main content

Posts

Showing posts from 2008

Error in importing customizations when absolute path is long

Hi, This is one strange error I have encountered, when you browse a customization file to import to dynamics CRM, it obviously gives an error when the total path is more than 100 characters long, (i.e. C:/somefolder/inside1/inside2/inside3/my_customizations_backup/year/month/customizations.zip) but, even when the path is close to 100 characters, Import may fail without any visible reasons, in that case, if you copy the file directly under drive, say C:/customizations.zip, it gets imported successfully.

Disable/Enable all fields on CRM entity form

While disabling fields from 1st method, some lookups, radio buttons and date fields may not get disabled, you have to disable them separately // This loops through all elements of CRMForm, faster and consumes less memory function disableFields(disableenable) { var CRMObjects = new Array(CF. ,CF. ,CF. ,CF. ); for (i=0;i < CRMObjects.length;i++) { CRMObjects[i].Disabled=disableenable; } /*now disable all active form elements*/ for (i=0; i<>0) { if(crmForm.elements[i].Disabled==false) { crmForm.elements[i].Disabled=disableenable;

Compare modified values on Save

Hi, What if you want know whether a field is modified when you click on Save in CRM entity record form, it is simple, check the IsDirty property of the field, as in if( crmForm.all.field.IsDirty == true) ... what if you wanted to compare the modified value with the original value that was on Load when you click on Save, a pre -update callout / plugin seems to emerge as a candidate, but you can also do it through clientscript , all you need to do it so find a way to store the value of the original value of the field on Load and use it in your On Save script. An obvious choice would be to use a hidden field, but for that we have to keep a spare attribute in the entity schema which means it will add an extra column to the entityExtensionbase table in CRM database, just to store a temporary value, doesn't sound good. What we can do as an alternative is save it in a temporary html element that can be generated on-the-fly just when the form Loads, see how it is done: O

Assign values to Readonly fields

Hi, When you set a field to be read only in entity form editor, it is not possible to set any values to it even through Javascript apart from front-end, in such cases we may consider an option not to keep it Read Only and just enable-disable it in Form Load and Form Save scripts. But going for a temporary solution has its cons, the way a field appears when it is Readonly and when it is disabled are different, disabled field looks grey, while readonly looks white, just like another editable field. But there is a way to keep it read only and still able to set value to it, just after you set value to the readonly field in your script, turn the ForceSubmit property on: crmForm.all.field .DataValue = "some value"; crmForm.all.field .ForceSubmit = true;

Timestamp for each entity custmization

Hi Friends, Is there any way by which we can find out when an entity was last custmized, yes there is... One way is to access the MS CRM database through a safe and secure way, find out the modified date of entitybase tables and display them on a custom page, this way you can keep track of when entity in customized that gives you better idea of who and when customized an entity in a shared development environment, I am still finding a way to do the same using SDK or through Javascript.