- A Customer with the supplied Login already exists
- The Login is not acceptable.
- The Password is not acceptable.
- The system cannot create the Customer.
- alphanumeric (Unicode letters or decimal digits)
- space
- period
- dash
- underscore
- @
- A Customer with the supplied Login already exists
- A Customer with the explicitly provided or calculated customer number already exists.
- The Login is not acceptable.
- The Password is not acceptable.
- The system cannot create the Customer.
- alphanumeric (Unicode letters or decimal digits)
- space
- period
- dash
- underscore
- @
null
is returnedNull
if the token is invalid.
var count=0; function callback(profile: Profile) { count++; dw.system.Logger.debug("customer found: "+profile.customerNo) } CustomerMgr.processProfiles(callback, "gender=1"); dw.system.Logger.debug("found "+count+" men in customer list");
custom.color = {1}
),
while for system attributes no prefix is used (e.g. name = {4}
).
Supported attribute value types with sample expression values:- String
'String', 'Str*', 'Strin?'
- Integer
1, 3E4
- Number
1.0, 3.99E5
- Date
yyyy-MM-dd e.g. 2007-05-31 (Default TimeZone = UTC)
- DateTime
yyyy-MM-dd'T'hh:mm:ss+Z e.g. 2007-05-31T00:00+Z (Z TimeZone = UTC) or 2007-05-31T00:00:00
- Boolean
true, false
- Email
'search@demandware.com', '*@demandware.com'
- Set of String
'String', 'Str*', 'Strin?'
- Set of Integer
1, 3E4
- Set of Number
1.0, 3.99E5
- Enum of String
'String', 'Str*', 'Strin?'
- Enum of Integer
1, 3E4
The following types of attributes are not queryable:
- Image
- HTML
- Text
- Quantity
- Password
Note, that some system attributes are not queryable by default regardless of the actual value type code. The following operators are supported in a condition:
=
Equals - All types; supports NULL value (thumbnail = NULL
)!=
Not equals - All types; supports NULL value (thumbnail != NULL
)<
Less than - Integer, Number and Date types only>
Greater than - Integer, Number and Date types only<=
Less or equals than - Integer, Number and Date types only>=
Greater or equals than - Integer, Number and Date types onlyLIKE
Like - String types and Email only; use if leading or trailing wildcards will be used to support substring search(custom.country LIKE 'US*'
)ILIKE
Caseindependent Like - String types and Email only, use to support case insensitive query (custom.country ILIKE 'usa'
), does also support wildcards for substring matching
gender = {1} AND (age >= {2} OR (NOT profession LIKE {3}))
.
The query language provides a placeholder syntax to pass objects as
additional search parameters. Each passed object is related to a
placeholder in the query string. The placeholder must be an Integer that
is surrounded by braces. The first Integer value must be '0', the second
'1' and so on, e.g.
querySystemObjects("sample", "age = {0} or creationDate >= {1}", 18, date)
If there is more than one object matching the specified query criteria, the
result is not deterministic. In order to retrieve a single object from a sorted result
set it is recommended to use the following code:
queryProfiles("", "custom.myAttr asc", null).first()
.
The method first()
returns only the next element and closes the
iterator.
This method is deprecated and will be removed in a future release. One of the following methods should be used instead: searchProfile(String, Object...), searchProfiles(Map, String) and searchProfiles(String, String, Object...) to search for customers and processProfiles(Function, String, Object...) to search and process customers in jobs.
queryString
.
This method is deprecated and will be removed in a future release. One of the following methods should be used instead: searchProfile(String, Object...), searchProfiles(Map, String) and searchProfiles(String, String, Object...) to search for customers and processProfiles(Function, String, Object...) to search and process customers in jobs.
A map with the key/value pairs: 'name'/'tom*', 'age'/66 will be converted as follows:
"name like 'tom*' and age = 66"
The identifier for an attribute to use in a query condition is always the
ID of the attribute as defined in the type definition. For custom defined attributes
the prefix custom is required in the search term (e.g. custom.color = {1}
),
while for system attributes no prefix is used (e.g. name = {4}
).
Supported attribute value types with sample expression values:- String
'String', 'Str*', 'Strin?'
- Integer
1, 3E4
- Number
1.0, 3.99E5
- Date
yyyy-MM-dd e.g. 2007-05-31 (Default TimeZone = UTC)
- DateTime
yyyy-MM-dd'T'hh:mm:ss+Z e.g. 2007-05-31T00:00+Z (Z TimeZone = UTC) or 2007-05-31T00:00:00
- Boolean
true, false
- Email
'search@demandware.com', '*@demandware.com'
- Set of String
'String', 'Str*', 'Strin?'
- Set of Integer
1, 3E4
- Set of Number
1.0, 3.99E5
- Enum of String
'String', 'Str*', 'Strin?'
- Enum of Integer
1, 3E4
The following types of attributes are not queryable:
- Image
- HTML
- Text
- Quantity
- Password
Note, that some system attributes are not queryable by default regardless of the actual value type code. The sorting parameter is optional and may contain a comma separated list of attribute names to sort by. Each sort attribute name may be followed by an optional sort direction specifier ('asc' | 'desc'). Default sorting directions is ascending, if no direction was specified.
Example:
age desc, name
Please note that specifying a localized custom attribute as the sorting attribute is currently not supported.
It is strongly recommended to call close()
on the returned SeekableIterator
if not all of its elements are being retrieved. This will ensure the proper cleanup of system resources.
See SeekableIterator.close()
This method is deprecated and will be removed in a future release. One of the following methods should be used instead: searchProfile(String, Object...), searchProfiles(Map, String) and searchProfiles(String, String, Object...) to search for customers and processProfiles(Function, String, Object...) to search and process customers in jobs.
custom.color = {1}
),
while for system attributes no prefix is used (e.g. name = {4}
).
Supported attribute value types with sample expression values:- String
'String', 'Str*', 'Strin?'
- Integer
1, 3E4
- Number
1.0, 3.99E5
- Date
yyyy-MM-dd e.g. 2007-05-31 (Default TimeZone = UTC)
- DateTime
yyyy-MM-dd'T'hh:mm:ss+Z e.g. 2007-05-31T00:00+Z (Z TimeZone = UTC) or 2007-05-31T00:00:00
- Boolean
true, false
- Email
'search@demandware.com', '*@demandware.com'
- Set of String
'String', 'Str*', 'Strin?'
- Set of Integer
1, 3E4
- Set of Number
1.0, 3.99E5
- Enum of String
'String', 'Str*', 'Strin?'
- Enum of Integer
1, 3E4
The following types of attributes are not queryable:
- Image
- HTML
- Text
- Quantity
- Password
Note, that some system attributes are not queryable by default regardless of the actual value type code. The following operators are supported in a condition:
=
Equals - All types; supports NULL value (thumbnail = NULL
)!=
Not equals - All types; supports NULL value (thumbnail != NULL
)<
Less than - Integer, Number and Date types only>
Greater than - Integer, Number and Date types only<=
Less or equals than - Integer, Number and Date types only>=
Greater or equals than - Integer, Number and Date types onlyLIKE
Like - String types and Email only; use if leading or trailing wildcards will be used to support substring search(custom.country LIKE 'US*'
)ILIKE
Caseindependent Like - String types and Email only, use to support case insensitive query (custom.country ILIKE 'usa'
), does also support wildcards for substring matching
gender = {1} AND (age >= {2} OR (NOT profession LIKE {3}))
.
The query language provides a placeholder syntax to pass objects as
additional search parameters. Each passed object is related to a
placeholder in the query string. The placeholder must be an Integer that
is surrounded by braces. The first Integer value must be '0', the second
'1' and so on, e.g.
querySystemObjects("sample", "age = {0} or creationDate >= {1}", 18, date)
If there is more than one object matching the specified query criteria, the
result is not deterministic. In order to retrieve a single object from a sorted result
set it is recommended to use the following code:
queryProfiles("", "custom.myAttr asc", null).first()
.
The method first()
returns only the next element and closes the
iterator.
If the customer search API is configured to use the new Search Service, the following differences apply:- newly created customers might not be found immediately via the search service, and changes to existing customers might also not be in effect immediately (there is a slight delay in updating the index)
- wildcards will be filtered from the query (*, %, +) and replaced by spaces
- LIKE and ILIKE queries will be executed as fulltext queries (working on whole words), not as substring searches
- LIKE queries will always be case insensitive
- using logical operators may change the execution of LIKE/ILIKE clauses to exact string comparison, depending on how they are combined
- using logical operators may result in degraded performance, depending on how they are combined
queryString
.
- newly created customers might not be found immediately via the search service, and changes to existing customers might also not be in effect immediately (there is a slight delay in updating the index)
- the search will return only the first 1000 hits from the search result
A map with the key/value pairs: 'name'/'tom*', 'age'/66 will be converted as follows:
"name like 'tom*' and age = 66"
The identifier for an attribute to use in a query condition is always the
ID of the attribute as defined in the type definition. For custom defined attributes
the prefix custom is required in the search term (e.g. custom.color = {1}
),
while for system attributes no prefix is used (e.g. name = {4}
).
Supported attribute value types with sample expression values:- String
'String', 'Str*', 'Strin?'
- Integer
1, 3E4
- Number
1.0, 3.99E5
- Date
yyyy-MM-dd e.g. 2007-05-31 (Default TimeZone = UTC)
- DateTime
yyyy-MM-dd'T'hh:mm:ss+Z e.g. 2007-05-31T00:00+Z (Z TimeZone = UTC) or 2007-05-31T00:00:00
- Boolean
true, false
- Email
'search@demandware.com', '*@demandware.com'
- Set of String
'String', 'Str*', 'Strin?'
- Set of Integer
1, 3E4
- Set of Number
1.0, 3.99E5
- Enum of String
'String', 'Str*', 'Strin?'
- Enum of Integer
1, 3E4
The following types of attributes are not queryable:
- Image
- HTML
- Text
- Quantity
- Password
Note, that some system attributes are not queryable by default regardless of the actual value type code. The sorting parameter is optional and may contain a comma separated list of attribute names to sort by. Each sort attribute name may be followed by an optional sort direction specifier ('asc' | 'desc'). Default sorting directions is ascending, if no direction was specified.
Example:
age desc, name
Please note that specifying a localized custom attribute as the sorting attribute is currently not supported.
It is strongly recommended to call close()
on the returned SeekableIterator
if not all of its elements are being retrieved. This will ensure the proper cleanup of system resources.
- newly created customers might not be found immediately via the search service, and changes to existing customers might also not be in effect immediately (there is a slight delay in updating the index)
- wildcards will be filtered from the query (*, %, +) and replaced by spaces
- LIKE and ILIKE queries will be executed as fulltext queries (working on whole words), not as substring searches
- LIKE queries will always be case insensitive
- using logical operators may change the execution of LIKE/ILIKE clauses to exact string comparison, depending on how they are combined
- using logical operators may result in degraded performance, depending on how they are combined
- the search will return only the first 1000 hits from the search result