This topic contains 4 replies, has 0 voices, and was last updated by haydent 7 years, 10 months ago.
-
AuthorPosts
-
December 7, 2016 at 11:35 pm #6556
haydentI 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. -
December 15, 2016 at 2:31 am #6557
tect22You 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.
-
December 18, 2016 at 9:59 pm #6558
chanarbonHi @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.
-
January 16, 2017 at 6:52 pm #6559
haydentThanks 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’)
)
)
-
January 20, 2017 at 4:25 pm #6560
haydentfound 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 -
AuthorPosts
You must be logged in to reply to this topic.