Best way to deploy lists to Sharepoint 2010 - sharepoint-2010

OK, we're just starting our Sharepoint development, and I'm a little stuck on one item. We obviously have a development and production environment. When creating custom lists, do you create a list in both locations, or do you create the list in code? If you create it in code, do you first check to see if it exists, and if it doesn't create it?

do you create a list in both
locations, or do you create the list
in code?
You can use List Definition to create Custom Lists programatically. This will be faster than creating manualy if you have lists with large number of columns.
You can also check if this list exists, programatically, and if not use this template to create the list.

Related

Is There a way to get a List of all the Enterprise Fields a user on Project Server has In Use?

I'm building a MS Project VSTO tool (written in C#) that in many instances needs to either read or write data from a field in MS Project. Since I don't always know what field will contain the data I need, I many times need to allow the user the option to select the field they want. Getting all the basic fields is easy, my issue arises if a user is in a Project Server environment and using Enterprise fields. So my question is 2 fold:
Is there a way to check if the user is in a Project Server environment?
Is there a way to easily get all of the custom enterprise fields that are being used in MS Project? I'd like to be able to capture these fields in a collection like a list or array.
Is there a way to check if the user is in a Project Server
environment?
Look at the collection of Profiles to see if there is a project server one and check its ConnectionState to see if it's connected to a project server.
Is there a way to easily get all of the custom enterprise fields that
are being used in MS Project? I'd like to be able to capture these
fields in a collection like a list or array.
If you have access to the project server, take a look at this page, Accessing Project Online enterprise custom fields. Without access to the server I suggest:
Loop through all tables and their fields to find enterprise ones.
Allow the user to enter the name of enterprise fields and store that information for future use so that it's a one-time 'setup' for the user.

How do I dynamically retrieve columns using the oData source via SSIS?

I have several SSIS packages that use oData sources to pull data from SharePoint lists and libraries. Unfortunately, I'm not always notified when those lists and libraries are changed on the SharePoint server.....
Now, when those packages break, I know how to fix them manually. That's not a problem. What I would like to know is whether or not there's any way to dynamically refresh the package and recognize that there's more or less or different columns than there were before.......that way, I don't have to redevelop the package unless/until they need the new columns represented in the SQL Server database....

Create model view controller files for the table without using gii tool in yii

I am developing a project in yii, in that, i will register companies, for each registered company i will create one order form. This form will be dependent on fields entered by me while company registration. This order form will be different for each company. Depending on that form i want to create table in mysql database and also model, view, controller files automatically as i click on submit button. Can anybody help me to create this files of view, model and controller through my application and not by using gii tool. I have created table using createTable() function but not getting how to create model view files in yii
Just use the gii templates by including them after setting the right variables perhaps?
You should be able to find them in framework/gii/generators/ folder. The template folders contain the files that gii uses to generate them. If they don't fit exactly, you could copy and modify them
That being said, I do want to point out that you have to make sure to do the correct chown's and chmod's after you have generated the php files, it's a pretty dangerous practice if you are planning to do that directly on a production machine.
You can edit the gii template to suite your needs. Otherwise, if not needed, you should use gii and do a little adjustments on the model.

Adding Sharepoint list column that is populates dynamically from items

I have a SharePoint list that has a bunch of colunms. I need to ad an additional column. This column needs to be populated with the numbers of the items in the list, i.e. 1 - n-th.
I'm not sure how one would do that. Would I need to create it using simple SharePoint or using SharePoint Designer?
There already is such a column — ID. It's automatically assigned from a counter. However, when you delete an item, a gap in numbering emerges.
And no, you probably can't create a similar but custom column using plain SharePoint or SharePoint Designer. You would need to create an event receiver do assign the values programmatically.

Adding Sharepoint 2010 List Items to a List with external Items

I have a list in SharePoint 2010 that has external items.
It is easiest to explain the specific scenario.
We have sales orders that have information that is being pulled from our MRP system.
The unique key is the Sales order number.
There are several columns in the list that do not come from MRP that show the status of the order on our production floor.
The way that it works now, every time a new sales order is created, the user must go to the SharePoint list, click new item, type in the SO number, click the check external item button and click ok which subsequently populates several fields in the list..... Then someone out on the floor populates the rest of the info
The part in bold is what I would like to automate.
I understand it may need to be a stored procedure or some powershell script.
The issue is, that because of the external content type in the list, all of the canned SharePoint tools wont allow me to feed data back into the list.
One option is to create an SQL server trigger. This trigger would fire whenever a new sales order is created in your source database. You could make it a CLR trigger, and in the function make use of the SharePoint client interface.
After you provided a clearer description of the problem: I believe that you're looking for something like the list event handler. This will run on the events you care about, and you can pull from the database at the appropriate time.
Essentially, you need to make a Visual Studio SharePoint project (from my past experience this method requires you to use VS right on the SharePoint server, or else you have to copy a lot of DLLs manually from the server); and make an event receiver.