Forum Discussion
christopher_gillis
8 years agoNew Member
Hello,
It is possible to set a filter from an onSearchDialog event on the Property that opens the dialog using code like the sample below.
<script src="">gist.github.com/.../script>
However, since you are opening this dialog from a method instead of directly from a property, you will need to follow the steps below to add a "dummy" property that will hold the filter for this search dialog.
- Create a "dummy" property on the ItemType that is calling the search dialog with the following information
- Name: dummyForFilter
- Type: String
- Length: 1
- Hidden1: true
- Hidden2: true
- Right-click on this new Property and select "View Properties"
- Create a Method with the filter code above and add it as an "onSearchDialog" event to this property
- Save, unlock, and close both the Property and the ItemType
var param = {
aras: top.aras,
type: 'SearchDialog',
dialogWidth: 700,
dialogHeight: 450,
itemtypeName: 'Part',
multiselect: true,
handler: addRelationshipHandler,
sourceItemTypeName: "Part", // <-- The name of your ItemType
sourcePropertyName: "dummyForFilter" // <-- The name of your dummy property
};
Following this example, you will see that the "state" column of the resulting search dialog now auto-populates with a value of "Released" and cannot be changed.
Chris
_______________________________
Christopher Gillis
Aras Labs Software Engineer