<script runat="server">
Platform.Load("Core", "1.1.1");
try {
var deObj = {
CustomerKey: Platform.Function.GUID(),
Name: "TestDE",
Fields: [
{ 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);
Write("(+) Data Extension was created successfully." + "<br>");
} catch (err) {
Write("(!) Data Extension was not created. Error message: " + err + "<br>")
}
</script>
<script runat="server">
Platform.Load("Core", "1.1.1");
try {
var deObj = {
CustomerKey: Platform.Function.GUID(),
Name: "TestDE",
Fields: [
{ 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);
Write("(+) Data Extension was created successfully." + "<br>");
} catch (err) {
Write("(!) Data Extension was not created. Error message: " + err + "<br>")
}
</script>