Wednesday 24 September 2014

Ribbon button display issue

I was involved in the issue of finding why one of the ribbon button R1 was not shown when deployed at client environment, after checking the entity ribbon diff xml everything looked fine, I started investigating into the database side of it.

After investigation I found that there was an old solution1 which used to refer the same entity but at that time the ribbon button which should be shown was not included in it.
Later on it was decided the correct place for the entity is solution2 and a new ribbon button R1was added on it afterward and entity was removed from solution1.

Theory says the ribbon xml should be merged instead of overwritten, but actually what's happening is the last one wins, so I updated installation instruction document to re-import soution2 when solution1 is deployed to make sure ribbon button appears correctly. This could be due to same publisher is in use for both solution1 and solution2.

Other option.
As any managed change deployed can not be removed from the system unless the managed solution which installed it is uninstalled but doing this would cause the import data to be deleted. one option we could use is to create a new solution3 with the same publisher for solution1 with the changes we like to keep in the system and then after installation of the solution3 uninstall solution1 doing this will keep the entities, records in the system as referred by solution3, but will take any change no longer required i.e. entity with R1, this would cause the deletion of any layers/records defined in the database due to solution1 initial import.

but the reason we didn't got with this option and stick for the installation instruction to re-import is the level of risk involved in uninstallation.

Thursday 4 September 2014

Permission denied - javascript prompt

In development environment when trying to make ajax call using the ActiveX object post request was getting following error

Permission denied.


Resolution

Add the website the request is made to trusted site along with the one the site is making the request.

if the dialog is disabled due to enforced policies, use the following register key and delete it and then reopen the browser, this will let you add site to trusted area


HKLM\Software\Policies\Microsoft\Windows\CurrentVersion\Internet Settings

Reduce the trust security to low

(before making any change to register please take a backup, and to reduce the trusted security level you should know the implication).

This is not in any shape the desired solution and should be avoided if possible.

Monday 1 September 2014

getting the related view values from the lookup field

 
 
 

returns the  schema name of the field1
Xrm.Page.getAttribute("new_customAttribute").getValue[0].values[0].name

returns the  value of the field1
Xrm.Page.getAttribute("new_customAttribute").getValue[0].values[0].value


 returns the schema name of field2
Xrm.Page.getAttribute("new_customAttribute").getValue[0].values[1].name

returns the value of the field2
Xrm.Page.getAttribute("new_customAttribute").getValue[0].values[1].value