Enable ServiceState support for the ContactManager search screens
In the first step of this search example, you add support for the ServiceState property to enable its use in the ContactManager search screens.
Before you begin
<ArrayCriterion> in
Overview of adding search capability in ContactManager.Procedure
- In Guidewire Studio for ContactManager, in the Project window, navigate to and then double-click ABContactSearchCriteria.etx to open this entity in the editor.
- Right-click nonPersistentEntity (extension) at the top of the Element hierarchy and click Add new, and then choose typekey from the drop-down list.
-
Enter the following values:
Name Value name ServiceState typelist State desc State where contact provides services - In the Project window, navigate to and double-click search-config.xml to edit the file.
-
Increment the
versionattribute in theSearchConfigelement at the top of the file.In the following example, the original version number was1and has been changed to2.<SearchConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="search-config.xsd" version="2"> -
Press Ctrl+F and enter ABContact to find the
<CriteriaDef>element for the target entity ABContact. -
Add a new
<ArrayCriterion>element to the end of this<CriteriaDef>element, as follows:<!-- Search by ABContact Fields --> <CriteriaDef entity="ABContactSearchCriteria" targetEntity="ABContact"> <Criterion property="TaxID" matchType="eq"/> <Criterion property="VendorType" matchType="eq"/> <Criterion property="VendorAvailability" matchType="eq"/> <Criterion property="Keyword" matchType="startsWith"/> <Criterion property="KeywordKanji" matchType="startsWithCaseSensitive"/> <Criterion property="Score" matchType="ge"/> <!-- Some additional search criteria are defined in code --> <ArrayCriterion property="ServiceState" targetProperty="ContactServiceArea" arrayMemberProperty="ServiceState" /> </CriteriaDef>The attributes of the new element are:
property- The
nameattribute for the column in theABContactSearchCriteriaentity targetProperty- The
nameof the array on the base entityABContact arrayMemberProperty- The
nameof the column on the extension array entity ContactServiceState
What to do next
Add ServiceState search support in ContactManager for core applications
