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

                    SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                    은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현