Open vs2012 New project.
Select SharePoint hosted mode.
A project for app development was created.
Create a site column
1. Right key item Add "New Item" site column create a Web site column
2. Add the following fields to the Element.xml.
<?xml version= "1.0" encoding= "Utf-8"?> <elements xmlns= "http://schemas.microsoft.com/sharepoint/" > &L T Field id= "{0e87dcf9-cdee-4842-956c-83769804bcae}" name= "Demonumber" displayname= "number" type= "Tex T "required=" True "group=" Demo "> </Field> <field id=" {076b7907-8a20-4ee9 -9004-0c0ded00c628} "name=" Demoname "displayname=" name "type=" Text "required=" True "group=" Dem O ' > </Field> <field id= ' {c808c172-03c3-413c-af10-4855b555ed25} ' name= ' DemoType ' D
Isplayname= "type" type= "Lookup" required= "True" list= "Lists/demotype" showfield= "Title" group= "Demo" > </Field> <field id= "{e4cd63a6-c6cb-46d0-93d6-a4ad93497d92}" name= "Demooperator" Displ Ayname= "operator" type= "User" list= "UserInfo" required= "True" showfield= "Imnname" userselectionmode= "People" Only "UserselectioNscope= "0" group= "Demo" > </Field> <field id= "{CECCCC3E-1D00-4442-8018-52FC260C5ADF}" Name= "Demooperationtime" displayname= "Operation Time" type= "DateTime" required= "True" group= "Demo" > ;/field> </Elements>
This site column contains a few basic fields.