So I was intregued as to the actual answer as I have always left it in. I guess one of the reasons why is that I think its good practice and hasn't caused me any problems. This plus Visual Studio puts it in when you override the function.
However, it looks like you should leave it in as when reflected this is what's implemented underneath:-
public virtual ...
Pass around ClientContext.
Call .ExecuteQuery() as few times as possible, bundle/batch up with .Load().
Once is usually enough, only in a very few cases do you need more.
Do not pass around Web.
You need to reference other members from ClientContext, such as Site.
Do not pass around an URL (either as String or Uri).
Initialization method ...
But you can make such calls in SharePoint 2013:
var crossSiteContext = new SP.ClientContext("http://url-of-another-siteCollection/");
var crossSiteWeb = crossSiteContext.get_web();
Generally speaking you will want to use SPQuery to only query items you're interested in.
Unless you're doing
SPList oList = web.GetList("XYZ");
for(int i=0; i < oList.Items.Count; i++)
string strLstItemName = oList.Items[i].Name; // << BAD, as you use Items here, so you fetch them from DB each loop
there shouldn't be any relevant ...
AllowUnsafeUpdates=true; is not required to add/delete/update list items unless you are doing these operations in Page_Load or other Get methods. Both CASE 1 and CASE 2 does not look good in terms of best practice.
Problems with both case code:
Do not use oSPWeb.Lists["MyList"]; instead use oSPWeb.Lists.TryGetList("MyList1");
Do not use list.Items.Add(); ...
Yes its possible to have a single server SharePoint 2016 development Farm.
The machine needs to have atleast 16 GB RAM available. The processor should be 64 bit and 4 cores. Also there needs to be 80 GB space available for system drive and 100 GB for second drive.
Step by step guide - Single server 2016 installation & configuration
Install SP 2016
As per my suggestion, Better to use field's internal name, in future if you may rename your field that doesnot affect the field which you updating on it. because field's internal name never change so no need to update code, whereas display name changed on rename field, so you need to update the code as per you define(renamed) field name
About your code: Since you are checking the value of an SPListItem in a different SPWeb but in the same SPSite, I think something like this will be better:
using (SPWeb web = properties.Site.OpenWeb("WebName"))
SPList list = web.GetList("/Path");
SPListItem item = list.GetItemById(theID);
From the MSDN article you posted:
Do not ...
In the code behind the code may look like this:
var url = SPContext.Current.Web.Url + "/_layouts/myPage.aspx;
"CustomScript", "OpenDialog('" + url + "', 994, 1000, 'Title of the script', null);", true);
function OpenDialog(strPageURL, width,...
Objects like Web, ClientContext are passed by reference, that is they are not copied. So there is no need to worry about performance. However, as mentioned by @eirikb, pasing ClientContext between methods make more sense as you can then load whatever objects you want from it inside the method.
If you can whip up a console app and schedule it and it does the job - then great. I probably would rely on PowerShell. I prefer being able to monitor and alter scripts if needed without having to recompile or open up VS to make the edit. When working with data I've also used SSIS packages on SQL server.
If you are running SharePoint locally you have an ...
Migration of controls developed using custom code has always been a problem, not when you migrate to newer versions but also when you move them to another server or on another farm.
The only reason "I KNOW OF or Experienced" Site Definitions create problems while migrating is because they can have different components in them, so when you deploy them to a ...
The New-SPContentDatabase cmdlet creates a new content database and attaches it to the specified Web application.
The Mount-SPContentDatabase cmdlet attaches an existing content database to the farm. If the database being mounted requires an upgrade, this cmdlet will cause the database to be upgraded.
so if you created database in advance, make sure the ...
I don't see why you can't use the OOB versioning functionality.
If you enable versioning and content approval for your library and turn on major and minor versions, then whenever a document is submitted, it is marked as Draft and it gets assigned a minor version.
You can then use a standard approval workflow (or customize it to suit your needs) to approve ...
The idea behind using one shared web application with host-named site collection is to overcome web application limitation of using multiple DNS name without having to extend the web application. By using host-named site collection, the DNS can now be set at site collection level and of course a site collection’s DNS name can be different from DNS of a Web ...
TEMPDB is a temporary database that contains all Temporary user objects such as: global or local temporary tables, table variables, cursors. It also includes internal objects created by the SQL Server Database Engine; For example, work tables to store intermediate results for spools or sorting. All the mechanism of row versions is being handled and managed ...
You can order up your approaches as below,
I suggest, ULS - Its the SharePoint native logging and it manages to remove the older files periodically, its better to keep all the SharePoint related logs in one place "ULS". Use SPDiagnosticsService.Local.WriteTrace method in your timer job to log into the ULS logs
If you find that ...
There are some, you can find these here:
For 2010: http://social.technet.microsoft.com/wiki/contents/articles/8666.sharepoint-2010-best-practices.aspx
For 2013: http://social.technet.microsoft.com/wiki/contents/articles/12438.sharepoint-2013-best-practices.aspx
On this link, you can find a section called development which has some links about writing code.
I don't believe there is a difference in terms of what they return back (the string representation of the root URL of the site).
However, in the second case you are referencing both an SPSite and SPWeb object whereas in the first you are only referencing the SPSite object (so there might be some minor performance considerations if all you are looking for is ...
In your case you need to find whether the item exists or not, so there is no problem with invoking the CAML for each check.
Another approach is to form a dynamic query based on the number of rows to validate, for example if you want to validate 3 rows of data then form a query in with condition like
I know this is an old question, but I thought it would be useful to post an updated response for anyone looking into this.
I believe you are looking for Dynamic Data Connections in the SharePoint Framework.
It is relatively easy to implement, see the tutorial on docs.microsoft.com.
There are also a few samples in the GitHub:
The current public website on Office 365 is frustrating, because you cannot easily use dynamic content as you would do with regular SharePoint sites. This is going to change with the next version, so my first advice would be to wait for a couple months if you can.
Apart from this limitation, I don't think there's anything complicated about the public site, ...
Regarding customization I would add that you should be careful when decide to use InfoPath as it has limited support in SP2013 (you can't use InfoPath forms to customize 2013 workflow task forms).
Quote from MSDN:
"Workflow form changed from InfoPath form to ASPX form.
Workaround: No workaround is currently available. "
Matt, we had the same issue at our company. After a fair amount of trial and error, and even backing up and restoring the site collection with a corrected name url, there were still issues. We opted to move the content temporarily and have them delete and re-create using the MyContent link, and copy back their content. The User Profile service while ...