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;
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
add a comment |
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
add a comment |
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
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
suitescript2.0
asked Mar 28 at 5:57
Tom HansonTom Hanson
5034 silver badges16 bronze badges
5034 silver badges16 bronze badges
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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.
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
add a comment |
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.
add a comment |
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.
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.
answered Jun 6 at 12:36
AviAvi
1,4621 gold badge5 silver badges18 bronze badges
1,4621 gold badge5 silver badges18 bronze badges
add a comment |
add a comment |
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.
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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