Most of the client asks for this requirement. They want to hide picklist options based on security roles. Let’s take an example for this, for example if we have picklist “Customer Status” having four option like “Request for Approve”,”Approved”,”Rejected”,”Black Listed”. Let’s say we have requirement to show only first option to all users having security roles other then “System Admin”…. Read more »
Today I found one question in MS CRM Development Forum to format Left navigation item, we can easily do this with JS. Just use below code on form load. I have tested this in contact form to form “More Addresses” var Item=document.getElementById(‘navAddresses’); if(Item!=null){ Item.style.fontWeight = ‘bold’; Item.style.color = ‘#ff0000’;} and result will be as below
Some time we need to show associated view (1:N or N:N) in Iframe. I found a good article in https://community.dynamics.com/blogs/crmjimwang/comments/28067.aspx written by Jim Wang. After doing some little changes it worked like a charm for me. You can use this code for any associated view (1:N or N:N). You just need to get Left navigation item name that you can… Read more »
I found a question here to set left navigation link as default for ms crm record, while opening ms crm form. http://social.microsoft.com/Forums/en-US/crmdevelopment/thread/9dd557d3-3828-441b-a6dc-e6c481fdb8c9 We can easily do this through JS, we just need to get ID of particular left navigation item which we can get IE Dev toolbar or Developer Tools Paste this code on form onload event var NavItem=document.getElementById(“Paste LeftNavigation… Read more »
Some time we need to calculate number of days between two dates in crm, we can easily do this using below JS script var d1=crmForm.all.FirstDate.DataValue; var d2=crmForm.all.SecondDate.DataValue; var DayValue=1000*60*60*24; alert(Math.ceil((d2.getTime()-d1.getTime())/DayValue)); Update for Dynamics 365 var d1=Xrm.Page.getAttribute(“FirstDate”).getValue(); var d2=Xrm.Page.getAttribute(“SecondDate”).getValue(); var DayValue=1000*60*60*24; alert(Math.ceil((d2.getTime()-d1.getTime())/DayValue));