This topic contains 4 replies, has 0 voices, and was last updated by haydent 7 years, 10 months ago.

  • Author
    Posts
  • #6556

    haydent

    I just keep getting “SearchColumnCustomField is an abstract type and cannot be instantiated”

    working off this doco: http://www.netsuite.com/help/helpcen…l?mode=package

    trying to specify the columns for the search to return, i can do others but not this one. i suspect it has to do with that there can be multiple fields in the field list, so how do i do this ??

    this is the code that generates the error:

    $search->columns->basic->customFieldList->customField = new SearchColumnCustomField();
    This is a cached copy. Click here to see the original post.

  • #6557

    tect22

    You may “loop” the customfield list to check first its ID of the custom Field, take note that you can already see the type of the custom field. So the chronological way is:

    First check if custom fields are existing, check each customfield for the ID of the custom field you want to get, then put in a variable you initialize with the same SearchColumnCustomField Type, i.e. SearchColumnStringCustomField, SearchColumnCustomBooleanField, etc.

  • #6558

    chanarbon

    Hi @haydent,

    For this concern, I would rather have a getCustomizationId() operation done before performing the search itself so you could determine the type of field. Once you are already sure about the type of custom field, that is were you initialize it. As noted from the error, SearchColumnCustomField is an abstract type which can be classified to SearchColumnStringField, SearchColumnSelectField and so on.

  • #6559

    haydent

    Thanks so much for you help chanarbon , i could not have worked it out otherwise, it really had me stumped but i got it working now with this: (maybe improvable ?)

    $field = new SearchColumnSelectCustomField();

    $field->scriptId = ‘custbody_os_freight_company’;//1314

    $search->columns->basic->customFieldList->customField[] = $field;

    One more question though, is it possible to return the actual List item Value/Text rather than the internal ID ??

    At the moment im getting a result as shown below, the list of options for the select is internalId 169 and the option in that list that result is set to is internalID 2

    Code:
    [‘customFieldList’] =>
    array(
    [‘customField’] =>
    array(
    [0] =>
    array(
    [‘searchValue’] =>
    array(
    [‘name’] =>
    NULL

    [‘internalId’] =>
    2

    [‘externalId’] =>
    NULL

    [‘typeId’] =>
    169

    )

    [‘customLabel’] =>
    NULL

    [‘internalId’] =>
    1314

    [‘scriptId’] =>
    ‘custbody_os_freight_company’

    )

    )

    )

  • #6560

    haydent

    found out how to request custom list values using join:

    Code:
    $CustomSearchRowBasic = new CustomSearchRowBasic();
    $CustomSearchRowBasic->customizationRef->scriptId = ‘custbody_os_entered_by’;
    $CustomSearchRowBasic->searchRowBasic = new EmployeeSearchRowBasic();
    $CustomSearchRowBasic->searchRowBasic->entityId = new SearchColumnStringField();

    $search->columns->customSearchJoin[] = $CustomSearchRowBasic;
    http://www.netsuite.com/help/helpcen…l?mode=package

You must be logged in to reply to this topic.