Which code segment should you use?

You create a Microsoft Windows SharePoint Services site.

You need to update the first item in a SharePoint list named MyList without triggering any alerts.

Which code segment should you use?

You create a Microsoft Windows SharePoint Services site.

You need to update the first item in a SharePoint list named MyList without triggering any alerts.

Which code segment should you use?

A.
Dim site As SPSite = SPControl.GetContextSite(context)
Dim destList As SPList = site.AllWebs(0).Lists(0)
Dim listItems As SPListItemCollection = destList.Items
Dim item As SPListItem = listItems(0)
item(“Type”) = “Important”
item(“Assigned”) = “No”
item.Up dateOverwriteVersion()

B.
Dim site As SPSite = SPControl.GetContextSite(context)
Dim destList As SPList = site.AllWebs(“MySite”).Lists(“MyList”)
Dim listItems As SPListItemCollection = destList.Items
Dim item As SPListItem = listItems(0)
item(“Type”) = “Important”
item(“Assigned”) = “No”
item.Recycle()

C.
Dim site As SPSite = SPControl.GetContextSite(context)
Dim destList As SPList = site.AllWebs(“MySite”).Lists(“MyList”)
Dim listItems As SPListItemCollection = destList.Items
Dim ite m As SPListItem = listItems(0)
item(“Type”) = “Important”
item(“Assigned”) = “No”
item.SystemUpdate()

D.
Dim mySite As SPWeb = SPControl.GetContextWeb(context)
Dim listItems As SPListItemCollection = mySite.Lists(“MyList”).Items
Dim item As SPListItem = listItems.Add()
item(“Type”) = “Important”
item(“Assigned”) = “No”
item.Update



Leave a Reply 0

Your email address will not be published. Required fields are marked *