# Thursday, January 28, 2010
SPFieldLookupValue category = new SPFieldLookupValue(1, "Books");

and then use it to set field value

item["Category"] = category
posted on Thursday, January 28, 2010 12:11:57 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] Trackback
        static void Main(string[] args)
        {
            SPSite site = null;
            SPWeb web = null;

            try
            {
                site = new SPSite("http://testSite/SubWeb/Pages/");
                web = site.OpenWeb();
                PublishingWeb publishingWeb = PublishingWeb.GetPublishingWeb(web);
                SPContentTypeId contentType = new SPContentTypeId("YourContentTypeId");
                PageLayout[] layouts = publishingWeb.GetAvailablePageLayouts(contentType);
                PageLayout pageLayout = layouts[0];
                string pageName = Guid.NewGuid().ToString() + ".aspx";

                SPUser user = web.EnsureUser("DOMAIN\\USERNAME");
                string createdDate = "2009-11-05T22:35:10Z";
                string modifiedDate = "2009-11-05T22:35:10Z";

                web.AllowUnsafeUpdates = true;
                PublishingPage newPage = publishingWeb.GetPublishingPages().Add(pageName, pageLayout);

                newPage.ListItem["Author"] = user.ID;
                newPage.ListItem["Editor"] = user.ID;
                newPage.ListItem["Created"] = createdDate;
                newPage.ListItem["Modified"] = modifiedDate;
                newPage.ListItem.UpdateOverwriteVersion();

                web.AllowUnsafeUpdates = false;

                Console.WriteLine("OK");
                Console.ReadLine();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
                Console.ReadLine();
            }
            finally
            {
                web.Dispose();
                site.RootWeb.Dispose();
                site.Dispose();
            }
        }
posted on Thursday, January 28, 2010 12:06:33 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] Trackback
        static void Main(string[] args)
        {
            SPSite site = null;
            SPWeb web = null;

            try
            {
                site = new SPSite("http://testsite/subweb/Pages/");
                web = site.OpenWeb();
                PublishingWeb publishingWeb = PublishingWeb.GetPublishingWeb(web);
                SPContentTypeId contentType = new SPContentTypeId("YourContentTypeID");
                PageLayout[] layouts = publishingWeb.GetAvailablePageLayouts(contentType);
                PageLayout pageLayout = layouts[0];
                string pageName = "PageName.aspx";

                PublishingPage newPage = publishingWeb.GetPublishingPages().Add(pageName, pageLayout);
                newPage.Update();
                newPage.ListItem.File.CheckIn("created");
                newPage.ListItem.File.Publish("created");

                Console.WriteLine(newPage.Url);
                Console.WriteLine("OK");
                Console.ReadLine();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
                Console.ReadLine();
            }
            finally
            {
                web.Dispose();
                site.RootWeb.Dispose();
                site.Dispose();
            }
        }
posted on Thursday, January 28, 2010 8:39:37 AM (GMT Standard Time, UTC+00:00)  #    Comments [0] Trackback

Consider the following scenario. You create a survey, and then you add a workflow to the survey in Microsoft Windows SharePoint Services 3.0. Then, you connect to the survey and respond to it. Finally, you view the response that you submitted, and then you try to start a workflow from the response. To do this, you click the arrow next to the response, click Workflows, click the workflow that you added, type your user name in the Reviewers box, and then click Start. However, the workflow does not start. Instead, the status of the workflow appears as Failed to Start.

This issue occurs because starting a workflow from a survey response is not supported in Windows SharePoint Services 3.0. Although the Workflows option appears when you click the arrow next to a survey response, you cannot start a workflow from a survey response.

posted on Thursday, January 28, 2010 8:21:45 AM (GMT Standard Time, UTC+00:00)  #    Comments [0] Trackback
# Tuesday, January 26, 2010

Microsoft recently released a new Silverlight 4 based facebook client for both Windows and Mac OS X. Scott Guthrie originally demonstrated this Silverlight client for Facebook during his PDC 2009 keynote late last year.

For more information, visit MicrosoftFeed article.

posted on Tuesday, January 26, 2010 8:32:11 AM (GMT Standard Time, UTC+00:00)  #    Comments [0] Trackback
# Monday, January 25, 2010

The Save (Not Permitted) dialog box warns you that saving changes is not permitted because the changes you have made require the listed tables to be dropped and re-created.

The following actions might require a table to be re-created:

  • Adding a new column to the middle of the table
  • Dropping a column
  • Changing column nullability
  • Changing the order of the columns
  • Changing the data type of a column

To change this option, on the Tools menu, click Options, expand Designers, and then click Table and Database Designers. Select or clear thePrevent saving changes that require the table to be re-created check box.

posted on Monday, January 25, 2010 8:39:46 AM (GMT Standard Time, UTC+00:00)  #    Comments [0] Trackback
# Friday, January 15, 2010

Based on customer requests for more robust compliance features, Microsoft has improved the validation capabilities of lists and libraries. Validation is now supported at both list and item levels.

For instance, a list owner can configure a validation to disallow the start date of an event item (stored in one column) to be after the end date of the event (stored in another column). If a user enters a start date that is later than the specified end date they will be presented with an error message when he or she attempts to save the item.

In another example, people can specify a column in a list as unique so that a contact list may not contain two entries with the same email address.

posted on Friday, January 15, 2010 9:02:35 AM (GMT Standard Time, UTC+00:00)  #    Comments [6] Trackback

The activity feed in SharePoint 2010 is very interesting. It is a way to see and read what your co-workers are doing. Most of your actions in SP2010 will end up in the activity feed.

But what about your actions and updates outside the organisation? Like twitter?

Stef van Hooijdonk created a class that will import your twitter updates ( through your public timeline rss feed ) and will post those updates to your activityfeed. Form more information and download; click here...

 

posted on Friday, January 15, 2010 7:35:00 AM (GMT Standard Time, UTC+00:00)  #    Comments [1] Trackback

MOSS Faceted Search is a set of web parts that provide intuitive way to refine search results by category (facet). 

The facets are implemented using SharePoint API and stored within native SharePoint METADATA store. The solution demonstrates following key features:

  • Grouping search results by facet
  • Displaying a total number of hits per facet value
  • Refining search results by facet value
  • Update of the facet menu based on refined search criteria
  • Displaying of the search criteria in a Bread Crumbs
  • Ability to exclude the chosen facet from the search criteria
  • Flexibility of the Faceted search configuration and its consistency with MOSS administration

 

For more information go to the project site

posted on Friday, January 15, 2010 7:29:53 AM (GMT Standard Time, UTC+00:00)  #    Comments [1] Trackback
# Wednesday, January 13, 2010

Sites – The basic capabilities required to use SharePoint sites to engage employees, partners and customers in en effective manner, both inside and outside the firewall.

Communities – The ability to easily access expertise and interact with other people in new and creative ways across the enterprise through both formal and informal networks.

Content – The facilities for the creation, review, publication and disposal of content while conforming to defined compliance rules, whether the content exists as traditional documents or as Web pages. SharePoint 2010’s content-management capabilities include document management, records management, and Web-content management.

Search – With more content existing online and involving the collaboration of multiple participants, it is critical that people can quickly and easily locate relevant content across SharePoint lists, sites and external systems and data sources, such as file shares, Web sites or line-of-business applications.

Insights – Information workers need the ability to not only rapidly deliver and share information that is critical to the success of the business but also to turn raw data into actionable conclusions and to drive business results through sharing data-driven analysis.

Composites – Business users of all roles need the ability to quickly create customized solutions without involving corporate IT in each request. At the same time, the IT staff needs the capability to empower business users to create these applications while ensuring the environment’s stability and availability.

posted on Wednesday, January 13, 2010 11:55:13 AM (GMT Standard Time, UTC+00:00)  #    Comments [3] Trackback