DOCUMENTS_BY_FORMULA Strategy
We have two possibilities here:
DOCUMENTS_BY_FORMULA or DOCUMENTS_BY_FORMULA_PAGED
The route entry in the groovy document looks like this:
Route DOCUMENTS_BY_FORMULA
router.GET('docsbyform/{formname}') {
strategy(DOCUMENTS_BY_FORMULA) {
databaseName('names.nsf')
selectQuery('SELECT (Form=\"{formname}\")')
runAsSigner(true)
}
mapJson 'UNID', json:'unid', type:'STRING', isformula:true, formula:'@Text(@DocumentUniqueID)'
mapJson 'Created', json:'Created', type:'DATETIME', isformula:true, formula:'@Created'
mapJson 'Modified', json:'Modified', type:'DATETIME', isformula:true, formula:'@Modified'
mapJson 'Form', json:'form', type:'STRING'
mapJson 'Type', json:'type', type:'STRING'
}
URL to call
http://localhost/rest/myfirst.nsf/xsp/.xrest/docsbyform/Server
Test using postman