Showing posts with label sharepoint list. Show all posts
Showing posts with label sharepoint list. Show all posts

Wednesday, June 20, 2012

No Author (Created By) Field in SPList.getItems(SPQuery).

Hi,

I assume that you all know that all the list items can be retrieved from SharePoint List using

SPList.getItems(SPQuery)

And returns all the items based on user permission and Filter that were specified in query. The columns that it return by default (For a document library) are

FileLeafRef
Title
ID
ContentType
Created
Modified
_CopySource
_CheckinComment
LinkFileNameNoMenu
LinkFilename
DocIcon
FileSizeDisplay
ItemChildCount
FolderChildCount
Edit
_UIVersionString
ParentVersionString
ParentLeafName
CheckoutUser
Editor

And Author.

The reason why i mentioned Author separately is because GetItems() method return Author Filed only for SiteCollection Admins and application pool admins. 
 
Regual user like site administrator, modifiers, visitors will not get that column.
 
If you are trying to get datatable from GetItems() method and use a custom column that shows Author (created By) column make sure to user elevated privileges based on your need.

Tuesday, March 20, 2012

Error Compiling SharePoint Workflow in Dev Server.

If any one of have problem compiling the SharePoint 2010 Workflow (Sequential and State Machine) in you Dev Server. And if the Error is this


Even for the empty workflow its giving this error.
Error 1 The "CompileWorkflowTask" task failed unexpectedly.
System.NotSupportedException: The given path's format is not supported.
   at System.Security.Util.StringExpressionSet.CanonicalizePath(String path, Boolean needFullPath)
   at System.Security.Util.StringExpressionSet.CreateListFromExpressions(String[] str, Boolean needFullPath)
   at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
   at System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, String[] pathList, Boolean checkForDuplicates, Boolean needFullPath)
   at System.IO.Path.GetFullPath(String path)
   at System.CodeDom.Compiler.TempFileCollection.EnsureTempNameCreated()
   at System.CodeDom.Compiler.TempFileCollection.AddExtension(String fileExtension, Boolean keepFile)
   at System.Workflow.ComponentModel.Compiler.CompileWorkflowTask.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult) stateWorkflow1

Check this Thread in MSDN Forum.


http://social.technet.microsoft.com/Forums/en-US/sharepoint2010programming/thread/74975cb4-20f9-4a3f-bb41-74382eecc5bb/#dd666781-46fb-4bb2-b8e8-cf49a4ebfa4b 

Wednesday, September 21, 2011

Look up columns problem with List Templates.

When we try to recreate the lists with look up columns from one site to another site, we lose the look up connection.

For example if have two sites 

A and B

A has list called A1 which has a look up column referring List AL1

If you want to take a copy of list A1 and recreate it in site B as B1 with look up referring to BL1.

Follow these steps

  1. Save List A1 as template (.stp).
  2.  Go to site collection settings.
  3. open the list template gallery.
  4. Save the A1's template in your computer.
  5. Go to the .stp file saved in you computer.
  6. change its extension to .cab 
  7. open the ziped file and extract the files in it to a folder.
  8. Open the manifest.xml file in notepad (or any other text editor).
  9. search for the GUID of list AL1 and replace it with GUID or BL1.
  10. save the manifest.xml file
  11. open command prompt and type the command "makecab manifest.xml template1.stp".
  12. It creates the template1.stp file.
  13. Upload template1.stp to the site collection of B site.
  14. create the list B1 using template1.stp.
  15. If you have multiple look up fields repeat the step 1 to 14 for all those fields.



If this is post is helpful, please leave a comment. Thanks.

Thursday, May 5, 2011

JQuery Script to Move View Selecting Menu to left side.

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>

<script type="text/javascript">

$("td.ms-toolbar:last").insertBefore($("td.ms-toolbar[width='99%']"));

</script>

Thursday, March 24, 2011

A really good article to freeze header in Sharepoint List views.

This is a really good article which explains the jQuery to freeze the header in SharePoint List views.



http://kjellsj.blogspot.com/2009/06/sharepoint-jquery-scrolling-view-with.html


Please leave a comment if this post is helpful to you. Thanks.

Tuesday, July 6, 2010

Monday, June 28, 2010

Datasource in Infopath pull the items from the view of list.

Hi,

Today when I was working with InfoPath to get the list items from SharePoint List using Data Connections (Data Sources), I observed that it is pulling only first hundred items.

Then, I changed the items limit in default view of that list to 200. Then the data source in InfoPath is pulling the first two hundred items.

So, that means it is pulling the data from the Default view.