Forum Discussion

achava02's avatar
achava02
New Contributor III
5 years ago

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

2 Replies

  • bojanvelevski's avatar
    bojanvelevski
    Valued Contributor

    I think when you execute a query and you don’t have any results, you will get an empty object on the output, or just the original object if the Execute snap has an input.

    In this case, you can check for a specific field that you know that exists in the result set.
    Example: $.hasPath(‘timestamp’)