Create new Lookup map
About this task
This guide instructs on how to add new lookup map that is not part of out of the box lookups.
Procedure
Step 1: Insert the reference to the desired data source
<schema id="d_693">[...]<attribute name="calnum" searchable="true" id="jnz3_"><lookup-map name="calnum" id="pmgg9"><lookup-return lookup-field="displayValue" datasource-field="description" id="gkp6r"/><lookup-return lookup-field="value" datasource-field="calnum" id="rb2gqaa"/></lookup-map></attribute>[...]
“The lookup-map element with id: ’####’ contains the lookup name: ’####’ which either doesn’t exist or match the case of the lookup name in the lookups.json file. Please fix the lookup name reference.”
If this error is thrown during the build process than it is typically caused due to a look up that is not part of the out of the box.
“Extended lookup found: lookups.json”
The message above indicates the lookup map extension file was identified and processed.
Step 2: Create a new file to extend existing lookups
In src folder of the project, create a new file and name it as lookups.json. The source folder is located where MAF tool was mapped, along with user and instance that MAF was connected.
Step 3: Add the new object to be part of lookups
{"calnum": {"objectName": "MXAPIASSET","getList": "calnum","attributeNames": "calnum,calendarid,description","displayAttributes": "calnum,description","searchAttributeNames": "calnum,description","useSearchTerms": "true"}