Is it Possible to pass custom parameters from a javascript to Search dialog

I'm attempting to apply a custom filter value to a search dialog in my application. To achieve this, I'm using the 'onSearchdialog' event on a specific property where the filter should be applied. However, I've encountered an issue where the filter value is not accessible within the 'onSearchdialog' method. This filter value needs to be dynamically set based on the selection made in a dropdown within a custom form. How can I pass this dynamic filter value to the 'onSearchdialog' method from an external JavaScript file that opens the search dialog?

  • Is your custom form a some item form or a custom dialog? The dropdown is some item property or just list of values?

  • The custom form is a standard HTML page and not a dialog. 

    Then in the HTML page, from where i open the searchdialog, below code is used

    async _openSearchDialog() {
    		const returnValue =
    			await this._topWindow.ArasModules.MaximazableDialog.show('iframe', {
    				aras: this._aras,
    				itemtypeName: this._selectionSetItemType,
    				type: 'SearchDialog',
    				sourceItemTypeName: 'vm_SelectionSet',
    				sourcePropertyName: 'custom_variabilityitem',
    				parameter1: '%variability1%'
    			}).promise;
    
    		return returnValue;
    	}

    I write the below code in onSearchDialog event of the property. I want to use the parameter1 value in the 'onSearchdialog' event.

    var customParam = inArgs.parameter1;
    var Filter = {};
    Filter["dvl_variabilityitem"] = { filterValue: customParam, isFilterFixed: false };
    return Filter;
    

  • You can use the itemContext property of the search dialog parameters. The type of the itemContext is Node, you can set it properties or attributes and it will be passed to onSearchDialog method as inArgs.itemContext.