SuiteScript 2.0 search.createFilter with formula not workingSuiteScript 2.0 - Logical operator for multiple filternetsuite suitescript 2.0 export(csv)Access Transaction Type in SuiteScript 2.0SuiteScript 2.0 Filter Operator AnyOf Not WorkingSuiteScript 2.0: Reschedule Script With Updated ParametersPagination in Suitescript 2.0 NetsuiteSuiteScript 2.0 Estimate Not UpdatingSuitescript 2.0 submit data on different threadsuitescript 2.0 fail to evaluateAutomatically add line item(s) to a vendor bill in suitescript 2.0SuiteScript 2.0 Merge a Letter Template

How many attacks exactly do I get combining Dual Wielder feat with Two-Weapon Fighting style?

Book/story which features a mental link to a prophet

Friend is very nit picky about side comments I don't intend to be taken too seriously

Male viewpoint in an erotic novel

What can we do about our 9-month-old putting fingers down his throat?

Why are there no wireless switches?

What does "先が気になる" mean?

Is storing sensitive data in files instead of a database safe?

Passport - tiny rip on the edge of my passport page

Explanation of switch statement constraints on variably modified types in C standard

Entering the US with dual citizenship but US passport is long expired?

Did the US Climate Reference Network Show No New Warming Since 2005 in the US?

Loss function (and encoding?) for angles

I multiply the source, you (probably) multiply the output!

Sinning and G-d's will, what's wrong with this logic?

How do you say "to hell with everything" in French?

Filling attribute tables with values from the same attribute table

How to interpret or parse this confusing 'NOT' and 'AND' legal clause

Why did Tony's Arc Reactor do this?

Can you pop microwave popcorn on a stove?

Do aarakocra have arms as well as wings?

Word for something that used to be popular but not anymore

Leaving the USA

Template default argument loses its reference type



SuiteScript 2.0 search.createFilter with formula not working


SuiteScript 2.0 - Logical operator for multiple filternetsuite suitescript 2.0 export(csv)Access Transaction Type in SuiteScript 2.0SuiteScript 2.0 Filter Operator AnyOf Not WorkingSuiteScript 2.0: Reschedule Script With Updated ParametersPagination in Suitescript 2.0 NetsuiteSuiteScript 2.0 Estimate Not UpdatingSuitescript 2.0 submit data on different threadsuitescript 2.0 fail to evaluateAutomatically add line item(s) to a vendor bill in suitescript 2.0SuiteScript 2.0 Merge a Letter Template






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I am trying to filter customers based on a given Email and Mobile phone. These customers must match on both. The search I have is



function getCustomerByCriteria(data)

var search = data.modules.search;
var filters = data.filters;

var crit = search.create(
type: search.Type.CUSTOMER,
filters:filters
);

/*var crit = search.load(
id: 'customsearch1112'
);*/
log.debug(
title: "Data Criteria",
details: JSON.stringify(crit)
);

var results = crit.run().getRange(
start : 0,
end : 1000
);

return results;


var customerList = customerService.getCustomerByCriteria(
filters : [
search.createFilter(
name : 'email',
operator : search.Operator.IS,
values : email,
isor: false
),
search.createFilter(
name : 'formulanumeric',
operator : search.Operator.IS,
values : [1],
formula : "CASE WHEN mobilephone ='"+mobile+"' THEN 1 ELSE 0 END",
)
],
modules :
search : search

);


It currently filters giving all customers with the given email address but does not filter based on the mobile phone. I do not understand why as the isor on the first filter is false so this should be an AND set of filters.










share|improve this question






























    1















    I am trying to filter customers based on a given Email and Mobile phone. These customers must match on both. The search I have is



    function getCustomerByCriteria(data)

    var search = data.modules.search;
    var filters = data.filters;

    var crit = search.create(
    type: search.Type.CUSTOMER,
    filters:filters
    );

    /*var crit = search.load(
    id: 'customsearch1112'
    );*/
    log.debug(
    title: "Data Criteria",
    details: JSON.stringify(crit)
    );

    var results = crit.run().getRange(
    start : 0,
    end : 1000
    );

    return results;


    var customerList = customerService.getCustomerByCriteria(
    filters : [
    search.createFilter(
    name : 'email',
    operator : search.Operator.IS,
    values : email,
    isor: false
    ),
    search.createFilter(
    name : 'formulanumeric',
    operator : search.Operator.IS,
    values : [1],
    formula : "CASE WHEN mobilephone ='"+mobile+"' THEN 1 ELSE 0 END",
    )
    ],
    modules :
    search : search

    );


    It currently filters giving all customers with the given email address but does not filter based on the mobile phone. I do not understand why as the isor on the first filter is false so this should be an AND set of filters.










    share|improve this question


























      1












      1








      1








      I am trying to filter customers based on a given Email and Mobile phone. These customers must match on both. The search I have is



      function getCustomerByCriteria(data)

      var search = data.modules.search;
      var filters = data.filters;

      var crit = search.create(
      type: search.Type.CUSTOMER,
      filters:filters
      );

      /*var crit = search.load(
      id: 'customsearch1112'
      );*/
      log.debug(
      title: "Data Criteria",
      details: JSON.stringify(crit)
      );

      var results = crit.run().getRange(
      start : 0,
      end : 1000
      );

      return results;


      var customerList = customerService.getCustomerByCriteria(
      filters : [
      search.createFilter(
      name : 'email',
      operator : search.Operator.IS,
      values : email,
      isor: false
      ),
      search.createFilter(
      name : 'formulanumeric',
      operator : search.Operator.IS,
      values : [1],
      formula : "CASE WHEN mobilephone ='"+mobile+"' THEN 1 ELSE 0 END",
      )
      ],
      modules :
      search : search

      );


      It currently filters giving all customers with the given email address but does not filter based on the mobile phone. I do not understand why as the isor on the first filter is false so this should be an AND set of filters.










      share|improve this question














      I am trying to filter customers based on a given Email and Mobile phone. These customers must match on both. The search I have is



      function getCustomerByCriteria(data)

      var search = data.modules.search;
      var filters = data.filters;

      var crit = search.create(
      type: search.Type.CUSTOMER,
      filters:filters
      );

      /*var crit = search.load(
      id: 'customsearch1112'
      );*/
      log.debug(
      title: "Data Criteria",
      details: JSON.stringify(crit)
      );

      var results = crit.run().getRange(
      start : 0,
      end : 1000
      );

      return results;


      var customerList = customerService.getCustomerByCriteria(
      filters : [
      search.createFilter(
      name : 'email',
      operator : search.Operator.IS,
      values : email,
      isor: false
      ),
      search.createFilter(
      name : 'formulanumeric',
      operator : search.Operator.IS,
      values : [1],
      formula : "CASE WHEN mobilephone ='"+mobile+"' THEN 1 ELSE 0 END",
      )
      ],
      modules :
      search : search

      );


      It currently filters giving all customers with the given email address but does not filter based on the mobile phone. I do not understand why as the isor on the first filter is false so this should be an AND set of filters.







      suitescript2.0






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 28 at 5:57









      Tom HansonTom Hanson

      5034 silver badges16 bronze badges




      5034 silver badges16 bronze badges

























          1 Answer
          1






          active

          oldest

          votes


















          1
















          With formulanumeric as search-filter, your search-operator should be equalto (search.Operator.EQUALTO) since your return value will be number whereas, you can use formulatext with search-filter with is(search.Operator.IS).



          For further reading check NetSuite's Search Operator.






          share|improve this answer
























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );














            draft saved

            draft discarded
















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55391005%2fsuitescript-2-0-search-createfilter-with-formula-not-working%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1
















            With formulanumeric as search-filter, your search-operator should be equalto (search.Operator.EQUALTO) since your return value will be number whereas, you can use formulatext with search-filter with is(search.Operator.IS).



            For further reading check NetSuite's Search Operator.






            share|improve this answer





























              1
















              With formulanumeric as search-filter, your search-operator should be equalto (search.Operator.EQUALTO) since your return value will be number whereas, you can use formulatext with search-filter with is(search.Operator.IS).



              For further reading check NetSuite's Search Operator.






              share|improve this answer



























                1














                1










                1









                With formulanumeric as search-filter, your search-operator should be equalto (search.Operator.EQUALTO) since your return value will be number whereas, you can use formulatext with search-filter with is(search.Operator.IS).



                For further reading check NetSuite's Search Operator.






                share|improve this answer













                With formulanumeric as search-filter, your search-operator should be equalto (search.Operator.EQUALTO) since your return value will be number whereas, you can use formulatext with search-filter with is(search.Operator.IS).



                For further reading check NetSuite's Search Operator.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jun 6 at 12:36









                AviAvi

                1,4621 gold badge5 silver badges18 bronze badges




                1,4621 gold badge5 silver badges18 bronze badges





















                    Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







                    Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.




















                    draft saved

                    draft discarded















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55391005%2fsuitescript-2-0-search-createfilter-with-formula-not-working%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                    Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

                    Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript