Hi everyone, I am facing Nuexo exception "can not fetch document type id.."

Here i am getting docs value empty can anyone help me pleaseā€¦..PFB code.

public void run() throws NuxeoException {

            String tenantDocumentPath = getOrCreateCPODocTypesForGlobalUsageMangementDoc(tenantId, session).toString();
            DocumentModelList docs = session.query(String.format(
                    "Select * from FlexibleDocType where %s = '%s' AND ecm:path STARTSWITH '%s'",
                    CPO_FLEXIBLE_DOC_TYPE_ID_PROPERTY, fmDocTypeId, tenantDocumentPath));
            if (docs.size() == 0) {
                throw new NuxeoException("Can not fetch fm doc type with id: " + fmDocTypeId);
            }
            if (docs.size() > 1) {
                log.error("More than one fm doc type found for the id: " + fmDocTypeId + " .This must be fixed");
            }

            fmDocType = docs.get(0);
            fmDocType.detach(true);
        }
0 votes

0 answers

1435 views

ANSWER

Can you test your query in NXQL on your server and see if you get any results? This may help you identify any issues with your query.
11/28/2018