- SharePoint Guidance library: provides easy to reuse methods utility that can be easily employed in time crunched projects. http://msdn.microsoft.com/en-us/library/ff798385.aspx
- Building custom LoggingService implemented by inheriting SPDiagnosticsServiceBase. This provides better classification of ULS logs over logs created using method SPDiagnosticsService.Local.WriteTrace http://blog.mastykarz.nl/logging-uls-sharepoint-2010
Thursday, June 27, 2013
Event logging mechanisms in SharePoint and other .net applications
Tuesday, June 25, 2013
Online learn application for html5, CSS3, jQuery
Monday, June 24, 2013
Release management: Need for custom script to Auto publish documents
In one the release, a custom sequential approval workflow on document library was upgraded to make use of Publishing approval mechanism
- This enabled the process to make use of draft item security section to provision
- Check out- check in mechanism with a security filter (check out documents were shown to document author and approver alone)
- Previous approved versions of checked out document were searchable to all users
- After analysing different project sites, following facts were identified:
- Few document libraries has checked out approved document.
- One document library had minor versions of the document – which are in approved state. (this was due to document library level settings wasn’t done appropriately)
SPFile object provides below methods that were useful doing this: 1. Publish ( string comment); 2. Approve ( string comment); 3. UndoCheckOut ();
Saturday, June 8, 2013
Automating relaunching workflows
- Terminate existing workflow – This will also ensure deleting any tasks created for the workflow
- Start new workflow
- Disabling outgoing email alert notifications on Tasks list (if any)
- Our custom workflow utilises a configuration list where sending custom emails on task creation was one of the turn on and turn off kind of parameter.
- [Microsoft.SharePoint.Workflow.SPWorkflowManager]::CancelWorkflow($wf);
- $SPList.Parentweb.site.workflowmanager.startworkflow($item, $WFAssociation, $WFAssociation.AssociationData)
- SPWorkflowManager.RemoveWorkflowFromListItem(SPWorkflow workflow)
- SPWorkflowManager.StartWorkflow(SPListItem item, SPWorkflowAssociation association,string eventData)
Friday, May 31, 2013
Managing SharePoint Workflow releases
- Identification and bookings for change windows for deployment process
- Identification of number of workflows in progress
- Identification of process to relaunch the workflows which are in progress status
- Engaging Change management team to getting communications for
- Change in the workflow process
- System outages if any
- Relaunch of the workflows, broken approval links
Monday, May 27, 2013
Comparing PL-SQL with TSQL
functions comparison between PL-SQL and T-SQL
Function | T-SQL | PL-SQL |
Current date | GetDate() GetUTCDate() | Sysdate Current_date |
Current timestamp | SysDateTime | Current_TimeStamp systimestamp |
Get maximum value of the column | Max() | max() |
Get year from date field | Year(DOB) | to_char(DOB, ‘yyyy’) |
Get Month from the date field | Datename(mm,DOB) Other formats m, month | to_char(DOB, ‘MON’) Other formats can be MM, MONTH, mon |
Get Day of week | Datename(dw, DOB) | to_char(DOB, ‘DAY’) |
Specific Date format | SELECT CONVERT(VARCHAR(8), GETDATE(), 3) AS [DD/MM/YY] | To_char(DOB, ‘dd/mm/yyyy’) |
Finding index of (Location of text) | CHARINDEX ( expressionToFind ,expressionToSearch [ , start_location ] ) e.g. CHARINDEX('@','someone@somewhere') | Instr(expressionToSearch, expressionToFind [, start_position [, nth_appearance ] ] ) e.g Instr('someone@somewhere', '@') |
Finding tables with given column name
Not in all projects, enough Knowledge transfer is provisioned to understand complete database architecture. In such scenarios, we end up exploring the database tables and columns to understand their relationships or to just find out if such column exists and in which table. In SQL server, we have tables called sys.Tables and sys.Columns and by writing a simple query like below, it can be done.USE AdventureWorks GO SELECT t.name AS table_name, SCHEMA_NAME(schema_id) AS schema_name, c.name AS column_name FROM sys.tables AS t INNER JOIN sys.columns c ON t.OBJECT_ID = c.OBJECT_ID WHERE c.name LIKE '%EmployeeID%' ORDER BY schema_name, table_name;
After googling and altering the query, I came up with the PL-SQL query as below:
select a.table_name, column_name,DATA_TYPE,DATA_LENGTH from all_tab_columns a,USER_ALL_TABLES u where a.TABLE_NAME=u.TABLE_NAME and column_name like 'FAMILY_TYPE%'
[Note: default T-SQL like clause works as case-insensative, while with PL-SQL like clause works as case-sensative]First Sunday of October month (Daylight saving ending date)
In SQL server, this requires a bit of query while in PL-SQL a simple function is availableDeclare @D Datetime Set @D = DateTime(‘01/10/2013’) Select DateAdd(day, (8-DatePart(weekday, DateAdd(Month, 1+DateDiff(Month, 0, @D), 0)))%7, DateAdd(Month, 1+DateDiff(Month, 0, @D), 0))
With in PL-SQLSelect next_day(to_date('01/10/2013','dd/mm/yyyy'), 'Friday') from dual