データエクステンションを削除する必要があるビジネスユニットで、次のデータエクステンションを作成します。
名前: DEtoDelete
外部キー: DEtoDelete
| 項目名 | データ型 | 文字数 | プライマリキー | Null 可能 | デフォルト値 |
| DEName | テキスト | 254 | いいえ | いいえ | 該当なし |
| isprocessed | Boolean | 該当なし | いいえ | いいえ | False |
データエクステンションに削除する必要があるデータエクステンション名を入力します。
次のコードを使用して SSJS アクティビティを作成します。
<script runat="server">
Platform.Load("core", "1.1.1");
var api = new Script.Util.WSProxy();
var rowstoprocess = DataExtension.Init("DEtoDelete").Rows.Lookup(["isprocessed"],[0])
for(j=0; j < rowstoprocess.length; j ++ )
{
var dataExtensionName = rowstoprocess[j].DEName
var req = api.retrieve("DataExtension", ["CustomerKey"], {
Property: "Name",
SimpleOperator: "equals",
Value: dataExtensionName
});
var customerKey = req.Results[0].CustomerKey;
var res = api.deleteItem("DataExtension", { "CustomerKey":customerKey });
DataExtension.Init('DEtoDelete').Rows.Update({"isprocessed": "1"}, ["DEName"], [dataExtensionName]);
}
</script>
000395614

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.