<script runat="server">
Platform.Load("Core", "1.1.2");
try {
var deObj = {
CustomerKey: Platform.Function.GUID(),
Name: "TestDE",
Fields: [
{
Name: "Id",
FieldType: "Number",
IsPrimaryKey: true,
IsRequired: true
},
{ Name: "Id", FieldType: "Number", IsPrimaryKey: true, IsRequired: true}
{ Name: "Text", FieldType: "Text", MaxLength: 100 },
{ Name: "Date", FieldType: "Date" },
{ Name: "Field4", FieldType: "Boolean", DefaultValue: "false" },
{ Name: "Email", FieldType: "EmailAddress", IsRequired: true },
{ Name: "ZipCode", FieldType: "Text", MaxLength: 5 }
],
CategoryID: 67001
};
var de = DataExtension.Add(deObj);
if (de && de.Status == "OK") {
Write("(+) Data Extension was created successfully.<br>");
} else {
Write("(!) Data Extension was not created.<br>");
}
} catch (err) {
Write(
"(!) Data Extension was not created. Error message: " +
err.message +
"<br>"
);
}
</script>
<script runat="server">
Platform.Load("Core", "1.1.2");
try {
var deObj = {
CustomerKey: Platform.Function.GUID(),
Name: "TestDE",
Fields: [
{
Name: "Id",
FieldType: "Number",
IsPrimaryKey: true,
IsRequired: true
},
{ Name: "Id", FieldType: "Number", IsPrimaryKey: true, IsRequired: true}
{ Name: "Text", FieldType: "Text", MaxLength: 100 },
{ Name: "Date", FieldType: "Date" },
{ Name: "Field4", FieldType: "Boolean", DefaultValue: "false" },
{ Name: "Email", FieldType: "EmailAddress", IsRequired: true },
{ Name: "ZipCode", FieldType: "Text", MaxLength: 5 }
],
CategoryID: 67001
};
var de = DataExtension.Add(deObj);
if (de && de.Status == "OK") {
Write("(+) Data Extension was created successfully.<br>");
} else {
Write("(!) Data Extension was not created.<br>");
}
} catch (err) {
Write(
"(!) Data Extension was not created. Error message: " +
err.message +
"<br>"
);
}
</script>