Hi,
quick question about shellFrame.ShellUI.Vault.SearchOperations.SearchObjects method.
I've managed to get the search work with AND conditions, but what is the correct structure for OR conditions?
Documentation says this: "Search conditions are combined with the AND operator. Search condition arrays are combined with the OR operator." So apparently different array that has its own AND conditions. But where should this array be put?
I've tried this kind of structure, but it gives me "The parameter is incorrect."
conditions: [
{
value: [{}],
},
{
value: [{}],
}
],
What would be the correct structure for OR?
Here is the search operation with AND. Posting this also for visibility since I struggled a bit with the right condition structure and values:
const customerConditions = [
// Check if the object type is CUSTOMER
{
expression: {
type: 3, // STATUS_VALUE
data: {
status_value: {
type: 6, // STATUS_TYPE_OBJECT_TYPE
data_function: { data_function: 0 }
}
},
indirection_levels: []
},
type: 1, // CONDITION_TYPE_EQUAL
value: {
is_null_value: false,
type: 9, // DATATYPE_LOOKUP
data: {
lookup: {
value_list_item_info: {
obj_id: {
type: 136,
item_id: { internal_id: 136}
}
}
}
}
}
},
// Check if the object is NOT deleted
{
expression: {
type: 3, // STATUS_VALUE
data: {
status_value: {
type: 5, // IS_DELETED
data_function: { data_function: 0 }
}
},
indirection_levels: []
},
type: 1, // CONDITION_TYPE_EQUAL
value: {
is_null_value: false,
type: 8, // DATATYPE_BOOLEAN
data: {
boolean: false
}
}
}
];
try {
const results = await shellFrame.ShellUI.Vault.SearchOperations.SearchObjects({
call_importance: 2,
target: { mode: 0 },
conditions: [
{
value: customerConditions,
}
],
options: {
all: false,
look_in_all_versions: true,
return_latest_visible_version: true,
},
limit: 30
});
await shellFrame.ShowMessage(`RESULTS: ${JSON.stringify(results, null, 2)} and length: ${results.results.length}`);
} catch (error) {
await shellFrame.ShowMessage(`ERROR: ${error.message}`);
}
Thanks!
