Wednesday, January 9, 2019

C# .NET Sample Code: Perform a getList operation via Web Services

CustomizationRef[] custRef = new CustomizationRef[1];

custRef[0] = new CustomizationRef();
custRef[0].internalId = "123";
custRef[0].type = RecordType.customList;
custRef[0].typeSpecified = true;

ReadResponse[] readResponses = _service.getList(custRef);

foreach (ReadResponse readResponse in readResponses)
{
 if (readResponse.status.isSuccess)
 {

  CustomList myCustomList = (CustomList)readResponse.record;

  foreach (CustomListCustomValue customValue in myCustomList.customValueList.customValue)
  {
   Console.WriteLine("Value: " + customValue.value + "\n" +
         "valueId: " + customValue.valueId + "\n");
    }
 }
 else
 {
  displayError(readResponse.status.statusDetail);
 }
}

No comments:

Post a Comment