Monday, 29 June 2015

internet explorer options are disable by network policies enforced

when I try to add a url to trusted sites the page is disabled and I am not able to do so, in order to enable this go to run and write regedit and go to following path and delete the "Internet Settings" sub nodes, and then close and restart internet explorer.
 
HKLM\Software\Policies\Microsoft\Windows\CurrentVersion\Internet Settings

Thursday, 7 May 2015

Shrink Database - SQL JOB that runs every mornign

1. Open "Microsoft SQL Server Management Studio" MSSMS
2 Connect to server
3. In Object explorer expand
     I. Server Instance
     II. SQL Server Agent
     III. Jobs
4. Right click on Jobs folder and click on "New Job..." and provider following information
   I. In General Tab
        a. Name (e.g. Shrink Database)
        b. Description (e.g. Currntly having issue with disk space, setting up the job so that it runs every morning and I don't have to restart box or run sql manually)
  II. In Steps Tab
       a. Click New button
           1. In General Tab
               I. Step name (e.g. SHRINK DATABASE)
               II. Command (e.g. EXEC sp_MSForEachDB 'DBCC SHRINKDATABASE ("?",0)'  )
           2. Advanced Tab
              I. Run as user (e.g. xyz\kaleemkhan)
  III. In Schedules Tab
          a. Name (e.g. Run every morning)
          b. Schedule Type (e.g. Recurring) 
          c. Enable: yes
          d. Frequency: Daily
          e. Recurs: 1 day(s)
          f. Occurs once at 08:00:00
          g. Start date (e.g. creation date)
 

Click Okay to opened windows to setup the SQL job.
     


 

sql for database names created in desc order

I got more than 50 dev crm org, and I created one and forgot which one is the latest one, in order to find that I used following sql it lists all the database names order by created date in desc

SELECT * FROM sys.databases ORDER BY create_date  desc

Thursday, 16 April 2015

Show lookup view dialog and Schedule engine

Following is UNSUPPORTED, and was used to work to elemenate some of the user clicks. I had a requirment to select the service on service activity form and then show schedule engine once the service been selected. function PrepoulateService() { if(Xrm.Page.getAttribute(serviceFieldName).getValue()!=null){ return;} var fetchXml = GetServicesQuery(validServices); var data = GetOrganisationService().Fetch(fetchXml); var canCreate = false; Xrm.Page.getAttribute(serviceFieldName).addOnChange(showScheduleEngine); if (data != null && data.length == 1) { if (data[0].attributes.serviceid.value != null) { Xrm.Page.getAttribute(serviceFieldName).setValue(data[0].attributes.serviceid.value); } } else { //select service by showing service lookup document.getElementById(serviceFieldName).click(); } //show schedule engine setTimeout("showScheduleEngine", 500); } function showScheduleEngine() { Type.registerNamespace("Mscrm"); Mscrm.Form_onload = function () { InitCalendar(USER_DATE_FORMATSTRING, USER_DATE_SEPARATOR, USER_DATE_START_DAY, _dCalMinDate); _oServiceRetrieveCommand = new RemoteCommand("Service", "Retrieve"); window.setTimeout("ScheduleActivity($get('crmFormSubmit').crmFormSubmitId.value, ServiceAppointment, !IsNull(location.search.match(/autoSearch=([^&]*)/)))", 100) }; Mscrm.Form_onsave = function (context) { CustomFormSubmit($find("crmForm"), context.getEventArgs()) }; Mscrm.serviceid_onchange = function () { ServiceLookupChanged() }; Mscrm.isalldayevent_onchange = function () { Mscrm.FormControlInputBehavior.GetBehavior("scheduledstart").set_forceSubmit(true); Mscrm.FormControlInputBehavior.GetBehavior("scheduledend").set_forceSubmit(true) } var eventObj = Xrm.Page.ui; var eContext = Mscrm.FormUtility.constructExecutionObject(eventObj, 0, null, null); eContext = Mscrm.FormUtility.constructExecutionObject(eventObj, 0, null, eContext); var t_s = new Date().getTime(); Mscrm.Form_onload(eContext); }

Tuesday, 31 March 2015

Refresh all subgrids on a form

RefreshAllSubGrids: function () { Xrm.Page.ui.controls.forEach( function (control, index) { if (control.getControlType() == "subgrid") { control.refresh(); } } ); }

Tuesday, 28 October 2014

SharePoint 2010 :- 'Activate Features'. A timeout has occurred while invoking commands in SharePoint host process.

When trying to deploy a SharePoint project getting Error Message:
Error occurred in deployment step 'Activate Features'. A timeout has occurred while invoking commands in SharePoint host process.

After doing a bit of search found every second article was saying to specify the time in the key

HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\SharePointTools key, and then add a time out to 'ChannelOperationTimeout' to something like 240 for 4 mins time out.

but the issue I was getting in my system I only had path up to HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0

Resolution

Open Regedit
go to HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0
Create a new Key (folder) SharePointTools
Create a DWORD entry called ChannelOperationTimeout
Specify the value of 480

I used the 480 as the project I was trying to deploy actually took 06.14 mins