Skip to main content

Eric Wettstein's Library tagged no_tag   View Popular

20 May 09

Help & Support - Making Calls and Using Features

21 Jul 08

Glen's Exchange Dev Blog: Exchange 2007 Mailbox Size Powershell Form Script version 2

  • That error is because you are using the default Self Signed Certificate. The
    script cant deal with the normal SSL cert error popups you get when you use a
    browser in OWA. To fix this all you need to do is import the SSL certificate
    used in OWA into your local cert store so you no longer get any cert errors in
    OWA. Once this is done it will fix the error in the script

Creating an Exchange Web Services Client Application

  • ExchangeServiceBinding service = new ExchangeServiceBinding();
    service.Credentials = new NetworkCredential("<username>", "<password>", "<domain>");
    service.Url = @"https://<FQDN>/EWS/Exchange.asmx";
13 May 08

SPSecurity.RunWithElevatedPrivileges Method (Microsoft.SharePoint)

  • public class Worker
    {
    public Worker()
    {
            }
            private SPSite site     = null;
    private SPWeb web = null;
    private SPFolder folder = null;
            /// <summary>
    /// This Method is called throug Delegate elevatedGetSite which is definend in cmdOpenCnn_Click
    /// </summary>
    private void EstablishSharepoint()
    {
    site = new SPSite("http://srv-moss-tp1:36000");
    web = site.OpenWeb();
    }
    /// <summary>
    /// If you click the Button to establish a connection to your SharePoint-Site,
    /// you run this code with elevated Privileges.
    /// </summary>
    private void cmdOpenCnn_Click(object sender, EventArgs e)
    {
    SPSecurity.CodeToRunElevated elevatedGetSite = new SPSecurity.CodeToRunElevated(EstablishSharepoint);
    SPSecurity.RunWithElevatedPrivileges(elevatedGetSite);
                // After code execution in EstablishSharepoint(), following code will be executed
    // and fills a TreeView (tv in this example) with all First-Level-Folders and their Subfolders
                TreeNode MainNode = new TreeNode("Web-Folders");
    TreeNode n = null;
    int index = 0;
                foreach (SPFolder f in web.Folders)
    {
    n = new TreeNode();
    n.Text = f.Name;
    n.Tag = f.ParentWeb.Url + "/" + f.Url;
    n.ToolTipText = f.ParentWeb.Url + "/" + f.Url;
    index = MainNode.Nodes.Add(n);
                    foreach (SPFolder sf in f.SubFolders)
    {
    n = new TreeNode();
    n.Text = sf.Name;
    n.Tag = sf.ParentWeb.Url + "/" + sf.Url;
    n.ToolTipText = sf.ParentWeb.Url + "/" + sf.Url;
    MainNode.Nodes[index].Nodes.Add(n);
    }
    }
    tv.Nodes.Add(MainNode);
    }
05 May 08

Microsoft SharePoint Developer Documentation Team Blog : Synchronizing with Windows SharePoint Services, Part 1

  • Examples of ExpandUserField


    <ExpandUserField>FALSE</ExpandUserField> looks like:


    ows_Author="1;#Admin AdminName"


     


    <ExpandUserField>TRUE</ExpandUserField> looks like:


     ows_Author="1;#Admin
    AdminName,#login\name,#email@address,#sip@address,#Admin AdminName "

18 Apr 08

Programming Sharepoint(MOSS 2007): Custom Calendar Webpart,With colors

  • SPQuery query = new
    SPQuery();
    query.ExpandRecurrence = true;
    query.CalendarDate = day.Date;

17 Apr 08

Notes on Customizing the Content Query Web Part Without Code - Jim Jackson


    • To format a date:


      • add this to the top of the ItemStyles.xsl - xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime"


      • Then this to the xsl variables - <xsl:variable
        name="StartDate"><xsl:value-of
        select="ddwrt:FormatDateTime(string(@Start_x0020_Date), 1033, 'M/d/yyyy')"
        /></xsl:variable>


      • Then this to render it: <div><xsl:value-of
        select="$StartDate"/></div>
08 Apr 08

Dates and CAML - Patrick Tisseghem's Blog [MVP SharePoint]

  • So, you're query in the CAML Builder should look like the following:

    <Where>
    <Ge>
    <FieldRef
    Name="EventDate" />
    <Value
    Type="DateTime">2005-5-27T00:00:00Z</Value>
    </Ge>

    </Where>

    I know, this way your date is static and I
    suppose you want it dynamic. If you build your CAML query dynamically in code,
    you can use functions like
    SPUtility.CreateISO8601DateTimeFromSystemDateTime(DateTime.Today). This will
    convert your date from a DateTime value into a CAML Date format, which is the
    ISO8601 format.

03 Apr 08

Paul Galvin's SharePoint space: Yet Another Event Receiver Debug Trick

  • try {
    UpdateEditionDate(properties);
    }
    catch (Exception e)
    {
    throw new Exception("Dispatcher, UpdateEditionDate(): Exception: [" + e.ToString() + "].");
    }

    This showed up in the 12 hive thusly:


    Error loading and running event receiver Conchango.xyzzyEventReceiver in
    xyzzy, Version=1.0.0.0, Culture=neutral, PublicKeyToken=blahblahblah. Additional
    information is below.  : Dispatcher, UpdateEditionDate(): Exception:
    [System.NullReferenceException: Object reference not set to an instance of an
    object.     at
    Conchango.xyzzyManagementEventReceiver.UpdateEditionDate(SPItemEventProperties
    properties)     at
    Conchango.xyzzyManagementEventReceiver.Dispatcher(SPItemEventProperties
    properties, String eventDescription)].


    That gave me all the detail I needed to track down that particular

01 Apr 08

Caml Query with Lookup field - ASP.NET Forums

  • You need to declare that you are using the ID:


    <Query>
      <Where>
        <Eq>
     
        <FieldRef Name='Fruit' LookupId='TRUE' />
     
        <Value Type='Lookup'>15</Value>
       
    </Eq>
      </Where>
    </Query>

SharePoint 2007 - create lookup fields as a feature - Source Code

  • /* COB 11 Sept 2007 - amended next line to use internal name to fix bug when
    field display name
     
                *
    is different to internal name.
    */
               //
    lookupColumn = web.Fields[sCreatedColName] as
    SPFieldLookup;
               lookupColumn
    = web.Fields.GetFieldByInternalName(sCreatedColName) as SPFieldLookup;

SharePoint 2007 - Add a Lookup Field to a List Template Element that references its own List - Attis on SharePoint and more...


  • public override void
    FeatureActivated(SPFeatureReceiverProperties
    properties)
    {
            using (SPWeb
    _SPWeb = properties.Web)
           
    {
                // the
    name of the list is set in the ListInstance Element
    of
                // this
    Feature
               
    SPList _SPList = (SPList)_SPWeb.Lists["ListName"];

                if
    (_SPList !=
    null)
               
    {
                   
    // add a new lookup field to the
    list
                   
    _SPList.Fields.AddLookup("LookupField", _SPList.ID,
    false);                      

                   
    // update the
    list
                   
    _SPList.Update();

                   
    // get a reference to the SPFieldLookup we just
    added
                   
    SPFieldLookup _SPFieldLookup = new SPFieldLookup(_SPList.Fields, "LookupField");

                   
    // get a reference to the default
    view
                   
    SPView _SPView = _SPList.DefaultView;

                   
    // add the field to the view if it is not
    there
                   
    if
    (!_SPView.ViewFields.Exists("LookupField"))
                   
    {
                       
    _SPView.ViewFields.Add(_SPFieldLookup);
                   
    }

                   
    // update the
    view
                   
    _SPView.Update();   

               
    }
            }
    }

SharePoint Programmatically: Provisioning Lookup Fields - Tech MOSS Team

  • public
    static SPFieldLookup CreateLookupField(string fieldName, string group, bool
    required, bool allowMultipleValues, SPWeb w, SPList lookupList, string lookupField)
    {
          
    w.Fields.AddLookup(fieldName, lookupList.ID, lookupList.ParentWeb.ID,
    required);
           SPFieldLookup lookup = (SPFieldLookup)w.Fields[fieldName];
          
    lookup.AllowMultipleValues = allowMultipleValues;
          
    lookup.LookupField = lookupField;
          
    lookup.Group = group;
          
    lookup.Update(true);
           return lookup;
    }

    You can use this method like
    this:


    SPFieldLookup
    lookup = CreateLookupField("CustomLookup",
    "Custom fields", false, false, SPContext.Current.Site.RootWeb, SPContext.Current.Site.AllWebs["MyWeb"].Lists["CustomList"], "Title");


    The next step is to link the
    created Lookup Field to the existing Content Type:


    public
    static void
    LinkFieldToContentType(SPWeb web, string contentType, SPField field)
    {
           SPContentType ct =
    web.ContentTypes[contentType];
          
    ct.FieldLinks.Add(new SPFieldLink(field));
          
    ct.Update();
    }


    As we have just created a
    method returning the created

1 - 20 of 351 Next › Last »
Showing 20 items per page

Highlighter, Sticky notes, Tagging, Groups and Network: integrated suite dramatically boosting research productivity. Learn more »

Join Diigo