Skip to main content

execute.query.form.search

ExecuteQueryFormSearchCommand : d2/sdk/commands/execute.query.form.search​

SDK command that executes a query form based search. It extends the internal ExecuteQueryFormSearch implementation and exposes it as part of the public SDK so that consumers can trigger a query form search. Given a query form identifier and the corresponding form data, it prepares the search request, stores the form data in the next perspective session state and navigates to the search perspective where the matching results are rendered. This command is typically triggered when an end user submits a query form.

Extends: ExecuteQueryFormSearch
See: ExecuteQueryFormSearch
Example (to invoke the command programmatically)


define([
'csui/utils/commands'
], function(commands){
'use strict';

var command = commands.get('D2-ExecuteQueryFormSearch');
command.execute({
queryFormId: 'myQueryFormId',
formData: {'attr_name': 'value'},
parentId: 'optionalParentId'
});
});

Example (to create a new command instance and execute the query form search)


define([
'd2/sdk/commands/execute.query.form.search'
], function(ExecuteQueryFormSearchCommand){
'use strict';

var command = new ExecuteQueryFormSearchCommand();
command.execute({
queryFormId: 'myQueryFormId',
formData: {'attr_name': 'value'},
parentId: 'optionalParentId'
});
});

ExecuteQueryFormSearchCommand~constructor(attr, options)​

Creates a new ExecuteQueryFormSearchCommand instance.

Kind: inner method of ExecuteQueryFormSearchCommand

ParamTypeDescription
attrObject

Attributes used to initialize the command.

optionsObject

Additional options passed to the base command.

ExecuteQueryFormSearchCommand~execute(status) ⇒ jQuery.Promise​

Executes the query form search by delegating to the base implementation. Prepares the supplied query form data, updates the perspective session state with the prepared data and navigates to the search perspective where the search results are rendered.

Kind: inner method of ExecuteQueryFormSearchCommand
Returns: jQuery.Promise - Returns a jQuery promise that resolves once navigation to the search perspective is triggered, or rejects when mandatory data is missing.

ParamTypeDescription
statusObject

Invocation data required to run the command.

status.queryFormIdString

Mandatory identifier of the query form to be executed.

status.formDataObject

Mandatory query form data used to build the search request.

[status.parentId]String

Optional parent id which is identifier of parent category for query form configuration.