node-sellsy icon indicating copy to clipboard operation
node-sellsy copied to clipboard

Search by custom Field

Open spprod35 opened this issue 5 years ago • 2 comments

Hello,

I can not implement the Client.getList method with a custom field filter. Between the objects, the arrays, I am lost on the implementation.

Here is the code:

var params = {
    search : {
      customfields : {
        0 : {cfid : "70596", unspecified : "N", value : "Y"}
      },
    },
  };
  
sellsy.api({
  method: 'Client.getList',
  params: params
  }).then(data => {
    console.log(JSON.stringify(data.response.infos));
  }).catch(e => {
    console.log('error:', e);
});

I want to get customers with the custom field 70596 to "yes". This is a Yes / No field.

In my base today, I have only one customer having this field to "yes". Currently, the code returns to me 101 customers.

Regards,

spprod35 avatar Apr 01 '19 14:04 spprod35