OQL Query Issue

0
Hi All,   I am getting Null pointer error while using associated table data . My Query: 'SELECT c.Status,  d.CorpId  FROM "MobilityOrganization.EmployeeInMobility" c  INNER JOIN       "c/MobilityOrganization.EmployeeInMobility_Employee/Master.Employee" d'   Error: Caused by: com.mendix.modules.microflowengine.MicroflowException: com.mendix.systemwideinterfaces.MendixRuntimeException: java.lang.NullPointerException: Could not find result attribute CorpId in target object.    at MobilityOrganization.ACT_Report_WFMTool (JavaAction : 'Execute OQL statement')       
asked
4 answers
0

Could not find result attribute CorpId in target object." suggests that CorpId does not exist in the referenced table or is not correctly aliased.

 

Try something like below:

 

SELECT c.Status,

              d.CorpId

FROM MobilityOrganization.EmployeeInMobility AS c

INNER JOIN Master.Employee AS d

ON c.EmployeeInMobility_Employee = d.ID

answered
0

Have you checked the correct use of upper and lowercase in the attribute CorpId?

answered
0

Please add screenshots of Master.Employee and MobilityOrganization.EmployeeInMobility. I suppose attribute CorpId is in there.

 

Also see what you get with this OQL

SELECT d.CorpId 
FROM Master.Employee AS d

This will probably return the expected content, not an error.

 

Then try to see what attributes the OQL returns and see if you get CorpId as you expect it:

SELECT d.*
FROM "MobilityOrganization.EmployeeInMobility" c
INNER JOIN "c/MobilityOrganization.EmployeeInMobility_Employee/Master.Employee" d'

 

If this still did not bring you the solution, share us your findings. We will have another look.

 

answered
0

Hi Ankit,

You can check this

https://medium.com/@mohammad.saqib_1262/oql-series-part-1-introduction-to-object-query-language-in-mendix-213a0ff132a6

answered