SetObjectProperty

概要 

指定した API オブジェクトのプロパティの値を設定します。

構文 

SetObjectProperty(1, 2, 3)

関数のプロパティ 

序数説明
1string必須プロパティ値を設定する対象のオブジェクト
2string必須プロパティ名
3string必須新しいプロパティ値

例 

<script runat="server">
     Platform.Function.SetObjectProperty("Subscriber","emailAdddress","jdoe@example.com");
</script>

サンプルコード 

このサンプルコードは、取得呼び出しを実行します。

<script type="text/javascript">// <![CDATA[
    // Note that you can perform retrieves only in context of a landing page or platform call

    // Create an API Retrieve Request
    var RetrieveRequest = Platform.Function.CreateObject("RetrieveRequest");

    // Set the request type
    Platform.Function.SetObjectProperty(RetrieveRequest, "ObjectType", "Email");

    // Set the columns
    Platform.Function.AddObjectArrayItem(RetrieveRequest, "Properties", "Email.Name");
    Platform.Function.AddObjectArrayItem(RetrieveRequest, "Properties", "Email.ID");
    Platform.Function.AddObjectArrayItem(RetrieveRequest, "Properties", "Email.Subject");
    Platform.Function.AddObjectArrayItem(RetrieveRequest, "Properties", "Email.Status");
    Platform.Function.AddObjectArrayItem(RetrieveRequest, "Properties", "Email.CharacterSet");
    Platform.Function.AddObjectArrayItem(RetrieveRequest, "Properties", "Email.ContentCheckStatus");

    // Create a filter
    var RetrieveFilter = Platform.Function.CreateObject("SimpleFilterPart");
    // By email id
    // Platform.Function.SetObjectProperty(RetrieveFilter, "Property", "ID");
    // Platform.Function.SetObjectProperty(RetrieveFilter, "SimpleOperator", "equals");
    // Platform.Function.AddObjectArrayItem(RetrieveFilter, "Value", "5709");
    // By client id
    Platform.Function.SetObjectProperty(RetrieveFilter, "Property", "Client.ID");
    Platform.Function.SetObjectProperty(RetrieveFilter, "SimpleOperator", "equals");
    Platform.Function.AddObjectArrayItem(RetrieveFilter, "Value", "1191");


    // Add the filter to the retrieve
    Platform.Function.SetObjectProperty(RetrieveRequest, "Filter", RetrieveFilter);

    // Do the retrieve
    var StatusAndRequestID = [0,0];

    var Emails = Platform.Function.InvokeRetrieve(RetrieveRequest, StatusAndRequestID);

    // Check staus
    Platform.Response.Write("Status: " + StatusAndRequestID[0]);
    Platform.Response.Write("RequestID: " + StatusAndRequestID[1]);

    for ( var c = 0 ; c < Emails.length ; c ++ )
    {
        Platform.Response.Write(Emails[c].ID);
        Platform.Response.Write(" - ");
        Platform.Response.Write(Emails[c].Name);
        Platform.Response.Write("\r\n");
    }
// ]]>
</script>