Kerfisbundið Update List Efni í SharePoint

Hæ Devs,

The neðan er dæmi um kóða til að uppfæra Sharepoint lista efni kerfisbundið með því að nota SharePoint Object Model.

SPSite Site = new SPSite(“http://localhost:21000”);
SPWeb vefur = Site.OpenWeb();
SPList List = Web.Lists[“Address Book”];
SPListItem ListItem = List.GetItemById(0);

string FullName = string.Empty;

FullName = ListItem[“FirstName”].ToString() + ListItem[“LastName”].ToString();
SPListItem[“Full Name”] = FullName;
ListItem.Update();

4 comments to Programmatically Update List Content in SharePoint

  • noreply@blogger.com (lis)

    Hæ Uday,

    I have a custom list “Weekly Activity”, this is supposed to be entered daily and checked weekly. The problems I face are as follows:

    1. Team members can enter the activity daily but I am not being able to categorise it on a week basis( I used the group by facility but that does not give me what I want). that is Sunday to thursday week.

    2. I have a “Checked By” field which is meant only for the manager.. but the team members are being able to edit this field.

    3.Once an activity is checked by the manager, no team member should be able to go back and edit it.

    Kindly tell me how I can do the above on my custom list.

    thanks and Regards,
    lis

  • noreply@blogger.com (siva)

    Hæ Uday,

    where do you write this code. On what event

  • noreply@blogger.com (Uday)

    Hi Lis,
    as of now we dont have column level security available OOB in MOSS.

    My suggestion would be write a event handler and on “saving” event, then verify the person belongs to which while updating the content to list. based on the group he/she belongs to you can update the content.

    Takk,
    ~ Uday

  • noreply@blogger.com (Uday)

    Hey Siva,
    þú getur notað þetta stykki af kóða byggt á kröfu fyrirtækisins.

    fyrir td.
    þú getur notað þetta í atburði dýraþjálfari að uppfæra reiknað gildi í sérsniðnum dálki byggða á gildum inn af notendum.

    Takk,
    ~ Uday.

Skildu eftir svar

Hægt er að nota þessi HTML tög

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>