Hello,
This is possible using two optional parameters that you can pass into your Search Dialog when you open it programmatically. These are sourceItemTypeName and sourcePropertyName. When you use these two parameters, Aras Innovator will check to see if there is an onSearchDialog event on the property you specify. If so, it will call that event when you open your Search Dialog programmatically.
For instance, if I have an onSearchDialog event defined on the owned_by_id of Part, I can call the event even when I open my search dialog from a method by defining my parameters like the sample below.
var param = {
aras: top.aras,
type: 'SearchDialog',
dialogWidth: 700,
dialogHeight: 450,
itemtypeName: 'Part',
sourceItemTypeName: 'Part',
sourcePropertyName: 'owned_by_id'
};
You can find a general description of what all of these parameters are in our blog post on standard dialogs in Aras Innovator. Additionally, you can check out our blog post on applying a filter to a search dialog for help writing the actual method.
Chris
Christopher Gillis
Aras Labs Software Engineer