Tuesday, March 19, 2019

Obtain available forms for a certain record via SuiteTalk (Web Services) using C#

Here is a sample C# code one can use to dynamically get forms available for a given record. In this sample, we get the available forms for Customer record. 

    _service.passport = prepareLoginPassport();
    GetSelectValueFieldDescription fieldDescription =  new GetSelectValueFieldDescription();
    fieldDescription.recordType=RecordType.customer;
    fieldDescription.recordTypeSpecified = true;
    fieldDescription.field = "customform";
    GetSelectValueResult result = _service.getSelectValue(fieldDescription, 1);
   
     if (result.status.isSuccess )

    {
        foreach (RecordRef recordRef in result.baseRefList)
        {
            Debug.WriteLine(recordRef.internalId);
            Debug.WriteLine(recordRef.name);
        }
    }

1 comment:

  1. Hello, I was wondering if you could answer a question or point me in the right direction. I'm new to using NetSuite Web Services, and I am trying to get a list of employee information (I'm using C#). For most of the fields there is no problem, I've constructed the search using custom labels and can get the name and value fine. Some of them, department for instance, return a RecordRef. How do I dereference that RecordRef. When I look at the saved search in the UI, I see the department name, that's what I want to get at in my code. I feel like I must be missing something obvious.

    ReplyDelete