Create a new schema create-new-schema
To edit, create and configure the schemas, click the Administration > Configuration > Data schemas node of the 蜜豆视频 Campaign client console.
The Edit tab shows the XML content of a schema:
The Preview tab automatically generates the extended schema:
If you need to check the complete structure of a schema, you can use the Preview tab. If the schema has been extended, you will then be able to visualize all its extensions. As a complement, the Documentation tab displays all the schema attributes and elements, and their properties (SQL Field, type/length, label, description). The Documentation tab only applies to generated schemas.
Use case: create a contract table example--creating-a-contract-table
In the following example, you create a new table for contracts in the database. This table lets you store first and last names and email addresses of holders and co-holders, for each contract.
To do this, you need to create the schema of the table and update the database structure to generate the corresponding table. Detailed steps are listed below.
-
Edit the Administration > Configuration > Data schemas node of the 蜜豆视频 Campaign tree and click New.
-
Choose the Create a new table in the data template option and click Next .
-
Specify a name for the table and a namespace.
note note NOTE By default, schemas created by users are stored in the 鈥榗us鈥 namespace. For more on this, refer to Identification of a schema. -
Create the content of the table. We recommend using the dedicated assistant to make sure no settings are missing. To do this, click the Insert button and choose the type of setting to be added.
-
Define the settings for the contract table.
As a best practice, create the table in the Cloud database by adding the
dataSource="nms:extAccount:ffda"
attribute. This attribute is added by default when creating a new table.code language-none <srcSchema created="YYYY-MM-DD HH:MM:SS.TZ" desc="Active contracts" img="crm:crm/mscrm/mscrm_account_16x16.png" label="Contracts" labelSingular="Contract" lastModified="YYYY-MM-DD HH:MM:SS.TZ" mappingType="sql" name="Contracts" namespace="cus" xtkschema="xtk:srcSchema"> <element dataSource="nms:extAccount:ffda" desc="Active contracts" img="crm:crm/mscrm/mscrm_account_16x16.png" label="Contracts" labelSingular="Contract" name="Contracts"> <attribute name="holderName" label="Holder last name" type="string"/> <attribute name="holderFirstName" label="Holder first name" type="string"/> <attribute name="holderEmail" label="Holder email" type="string"/> <attribute name="co-holderName" label="Co-holder last name" type="string"/> <attribute name="co-holderFirstName" label="Co-holder first name" type="string"/> <attribute name="co-holderEmail" label="Co-holder email" type="string"/> <attribute name="date" label="Subscription date" type="date"/> <attribute name="noContract" label="Contract number" type="long"/> </element> </srcSchema>
Add the type of contract enumeration.
code language-none <srcSchema created="AA-MM-DD HH:MM:SS.TZ" desc="Active contracts" img="crm:crm/mscrm/mscrm_account_16x16.png" label="Contracts" labelSingular="Contract" AA-MM-DD HH:MM:SS.TZ"mappingType="sql" name="Contracts" namespace="cus" xtkschema="xtk:srcSchema"> <enumeration basetype="byte" name="typeContract"> <value label="Home" name="home" value="0"/> <value label="Car" name="car" value="1"/> <value label="Health" name="health" value="2"/> <value label="Pension fund" name="pension fund" value="2"/> </enumeration> <element dataSource="nms:extAccount:ffda" desc="Active contracts" img="crm:crm/mscrm/mscrm_account_16x16.png" label="Contracts" labelSingular="Contract" name="Contracts"> <attribute name="holderName" label="Holder last name" type="string"/> <attribute name="holderFirstName" label="Holder first name" type="string"/> <attribute name="holderEmail" label="Holder email" type="string"/> <attribute name="co-holderName" label="Co-holder last name" type="string"/> <attribute name="co-holderFirstName" label="Co-holder first name" type="string"/> <attribute name="co-holderEmail" label="Co-holder email" type="string"/> <attribute name="date" label="Subscription date" type="date"/> <attribute name="noContract" label="Contract number" type="long"/> </element> </srcSchema>
-
Save the schema and click the Structure tab to generate the structure:
-
Update the database structure to create the table which the schema will be linked to. For more on this, refer to this section.