Need help with NetSuite Search snap input parameters

Hi All,

Happy New Year.

I need an insight of how to pass input parameters to NetSuite Search snap for the following scenario.
I need to search customerPayment object for paymentmethod = “CreditCard”

Here is the screenshot of my input parameters.

I have the following customer payments in NetSuite. From this list, i want to select the transactions where payment method value = “CreditCard”

platformCore:record":
[
{
@xmlns:tranCust”:“urn:customers_2015_2.transactions.webservices.netsuite.com”
@externalId”:“1111111111111”
@internalId”:“1234567”
@xsi:type”:“tranCust:CustomerPayment”
“tranCust:createdDate”:“2020-12-31T16:03:39.000-08:00”
“tranCust:lastModifiedDate”:“2021-01-05T07:43:16.000-08:00”
“tranCust:paymentMethod”:
{
@internalId”:“113”
“platformCore:name”:“CreditCard”
}
},
{
@xmlns:tranCust”:“urn:customers_2015_2.transactions.webservices.netsuite.com”
@externalId”:“1111111111111”
@internalId”:“1234567”
@xsi:type”:“tranCust:CustomerPayment”
“tranCust:createdDate”:“2020-12-31T16:03:39.000-08:00”
“tranCust:lastModifiedDate”:“2021-01-05T07:43:16.000-08:00”
“tranCust:paymentMethod”:
{
@internalId”:“113”
“platformCore:name”:“Card1”
}
},
{
@xmlns:tranCust”:“urn:customers_2015_2.transactions.webservices.netsuite.com”
@externalId”:“1111111111111”
@internalId”:“1234567”
@xsi:type”:“tranCust:CustomerPayment”
“tranCust:createdDate”:“2020-12-31T16:03:39.000-08:00”
“tranCust:lastModifiedDate”:“2021-01-05T07:43:16.000-08:00”
“tranCust:paymentMethod”:
{
@internalId”:“113”
“platformCore:name”:“Card2”
}
}
]

For my NetSuite search snap i am sending the following inputs

$searchRecord.basic.dateCreated.operator : ‘after’
$searchRecord.basic.dateCreated.searchValue: Date.parse(‘2021-01-01’)

I am passing the following parameters for payment method to search for “CreditCard”. But it is not working.
$searchRecord.basic.paymentMethod.operator : ‘is’
$searchRecord.basic.paymentMethod.searchValue[*].name: ‘CreditCard’

Can you please advise on it.
CC: @ptaylor

Regards,
Aj

Unfortunately, NetSuite’s API does not make this easy.

To search on the paymentMethod field, you have to set the operator to one of the operators in the SearchMultiSelectFieldOperator column in the “Platform Enumerations” table in their docs. There are just two: anyOf, noneOf. You want anyOf.

With that operator, the searchValue is an array:

The easiest way to specify a value is with an expression like this:

[{'internalId': 113}]

In context, it looks like this:

Unfortunately, NetSuite only seems to support searching on the internalId (113), not on the name (‘CreditCard’), since I suppose that would require an additional join on the back end.

Hope that helps.

1 Like

It worked. Thank you @ptaylor for your immediate assistance. I appreciate your help.

1 Like