/// <summary>
        /// Run the code example.
        /// </summary>
        /// <param name="user">The Dfa user object running the code example.
        /// </param>
        public override void Run(DfaUser user)
        {
            // Create CreativeFieldRemoteService instance.
              CreativeFieldRemoteService service = (CreativeFieldRemoteService) user.GetService(
              DfaService.v1_20.CreativeFieldRemoteService);

              String searchString = _T("INSERT_SEARCH_STRING_CRITERIA_HERE");

              // Set up creative field value search criteria structure.
              CreativeFieldValueSearchCriteria creativeValueSearchCriteria =
              new CreativeFieldValueSearchCriteria();
              creativeValueSearchCriteria.pageSize = 10;
              creativeValueSearchCriteria.searchString = searchString;

              try {
            // Get creative field values for the selected criteria.
            CreativeFieldValueRecordSet creativeFieldValues =
            service.getCreativeFieldValues(creativeValueSearchCriteria);

            // Display creative field value names and ids.
            if (creativeFieldValues != null && creativeFieldValues.records != null) {
              foreach (CreativeFieldValue creativeFieldValue in creativeFieldValues.records) {
            Console.WriteLine("Creative field value with name \"{0}\" and id \"{1}\" was found.",
                creativeFieldValue.name, creativeFieldValue.id);
              }
            } else {
              Console.WriteLine("No creative field values found for your criteria");
            }
              } catch (Exception e) {
            Console.WriteLine("Failed to retrieve creative field values. Exception says \"{0}\"",
            e.Message);
              }
        }
예제 #2
0
 public CreativeFieldValueRecordSet getCreativeFieldValues(CreativeFieldValueSearchCriteria creativeFieldValueSearchCriteria) {
   object[] results = this.Invoke("getCreativeFieldValues", new object[] {creativeFieldValueSearchCriteria});
   return ((CreativeFieldValueRecordSet) (results[0]));
 }