2

I'm using a viewJsonService from the XPages Extension Library to return data for an agGrid. The service is called using it's URL with a keys parameter to select the data returned. If the key doesn't exist in the view then I'm getting an error NotesException: CreateNavFromKey failed.

I'm working around this by checking the whether the key exists in the view and if it doesn't using a second REST service that just returns an empty JSON object.

But is there any way of trapping the error so that the viewJsonService returns an empty JSON object in this scenario?

This is running on Domino 10.0.1 FP1

UPDATE...

<xe:restService id="restService1" pathInfo="getContactsForInd">
    <xe:this.service>
        <xe:viewJsonService defaultColumns="true" viewName="vwContactsByInd" var="row" databaseName="#{javascript:sessionScope.DBPath}" searchMaxDocs="0" count="5">
            <xe:this.keys><![CDATA[#{javascript:docInd.getItemValueString("IndKey");}]]></xe:this.keys>
        </xe:viewJsonService>
    </xe:this.service>
</xe:restService> 
Martin Perrie
  • 398
  • 5
  • 16
  • Please include the XML markup for the properties you're setting. There are various options, some of which result in a ViewNavigator, some a ViewEntryCollection – Paul Stephen Withers Jul 16 '19 at 07:58
  • According to what's open sourced, this should use a `RestViewNavigator` and call the `createNavigator()` method. With the `keys` property it should create a `SearchKeyNavigator` object, which uses `view.getAllEntriesByKey()`. Only the `category` property or `parentId` property should use a ViewNavigator. Maybe something has changed since the last open sourced version. – Paul Stephen Withers Jul 19 '19 at 12:59

0 Answers0