Team, I am trying to run a transaction search via ...
# suitetalkapi
a
Team, I am trying to run a transaction search via SuiteTalk SOAP, but I am having issues retrieving columns with custom fields. Anyone can help?
Here is how I am defining the columns
<search xsitype=‘platformMsgsSearchRequest’> <searchRecord xsitype=‘tranSalesTransactionSearchAdvanced’ xmlnsplatformSearch=“urnsales_2023_1.transactions.webservices.netsuite.com” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”> <platformSearch:criteria> <platformSearch:basic> <platformCommon:type platformCommon:operator=“anyOf”> <platformCoresearchValue&gt;invoice&lt;/platformCoresearchValue> </platformCommon:type> </platformSearch:basic> </platformSearch:criteria> <platformSearch:columns> <platformSearch:basic> <amount xmlns=“urn:common_2023_1.platform.webservices.netsuite.com”/> <currency xmlns=“urn:common_2023_1.platform.webservices.netsuite.com”/> <fxAmount xmlns=“urn:common_2023_1.platform.webservices.netsuite.com”/> <internalId xmlns=“urn:common_2023_1.platform.webservices.netsuite.com”/> <lastModifiedDate xmlns=“urn:common_2023_1.platform.webservices.netsuite.com”/> <line xmlns=“urn:common_2023_1.platform.webservices.netsuite.com”/> <lineSequenceNumber xmlns=“urn:common_2023_1.platform.webservices.netsuite.com”/> <memo xmlns=“urn:common_2023_1.platform.webservices.netsuite.com”/> <message xmlns=“urn:common_2023_1.platform.webservices.netsuite.com”/> <refNumber xmlns=“urn:common_2023_1.platform.webservices.netsuite.com”/> <serialNumber xmlns=“urn:common_2023_1.platform.webservices.netsuite.com”/> <source xmlns=“urn:common_2023_1.platform.webservices.netsuite.com”/> <subsidiary xmlns=“urn:common_2023_1.platform.webservices.netsuite.com”/> <title xmlns=“urn:common_2023_1.platform.webservices.netsuite.com”/> <tranDate xmlns=“urn:common_2023_1.platform.webservices.netsuite.com”/> <transactionNumber xmlns=“urn:common_2023_1.platform.webservices.netsuite.com”/> <type xmlns=“urn:common_2023_1.platform.webservices.netsuite.com”/> </platformSearch:basic> <platformSearch:subsidiaryJoin> <nameNoHierarchy xmlns=“urn:common_2023_1.platform.webservices.netsuite.com”/> </platformSearch:subsidiaryJoin> </platformSearch:columns> </searchRecord> </search>
how can I add a column that is a custom column?
i
are you needing to return columns that have formulas in it, or just custom fields? columns with formulas are not supported on SOAP. if you just need a custom field then it should work the same way as the native fields, just use the internal id name of the field
a
just custom fields @Israel Gonzalez I just don’t know how to add the custom fields as columns, I get errors with everything I have tried
i
i dont use SOAP but i looked up an existing integration and it looks like this is how their calling custom fields, this is a header level field. are you needing a transaction header level field or line level field?
Copy code
<customFieldList xmlns="urn:common_2021_2.platform.webservices.netsuite.com">
                            <customField scriptId="custbody_test_customfield" xsi:type="SearchColumnLongCustomField" xmlns="urn:core_2021_2.platform.webservices.netsuite.com"/>
                        </customFieldList>
a
where should I add that?
inside columns?
i
image.png
a
ok, let me try
I added here:
image.png
but get this error
image.png
i
my sample was using 2021_2, youll need to update to the wsdl your using
a
right, let me fix it
corrected, now I get this error
image.png
looks like this
image.png
i
is the field you want a header level field or line level?
here is some more info
a
it’s on the header level
some issue with the definition of the column on the search
i
yeah its probably with the xsi:type, you will need to match it with your field type. whats your field type?
a
just a string
i
try not defining it or try: SearchColumnStringCustomField
a
ok, let me see
man, that worked!
<customFieldList xmlns=“urn:common_2023_1.platform.webservices.netsuite.com”> <customField scriptId=“custbody_ewg_entvatid” xsi:type=“SearchColumnStringCustomField” xmlns=“urn:core_2023_1.platform.webservices.netsuite.com”/> </customFieldList>
thank you so much!!!! you the man!
i
nice, your welcome
👋 1
a
sorry, just one more question, what if I need a custom field from the transaction line?
I guess I need a join with the line?
i
not sure about that one, i would just try doing it the same way just define the custcol field id instead <customField scriptId="custcol_custom_columnfield" .....
a
ok, thank you