Get Module data of a user from Vtiger CRM

1.5k views Asked by At

I am new in vTiger and need to fetch all data from "Project" module for a specific user Like: SELECT * FROM Projects WHERE assigned_user_id='9' I did not find the "assigned_user_id" field in vtiger_project table, so how can we get from it. My Project fields are as below:

https://i.stack.imgur.com/0c2fK.jpg

Please check, and suggest me how to get all project data of a particular user assigned to him.

2

There are 2 answers

0
pritaeas On

Update I've misunderstood the question. My answer below is valid when you are using the REST API.


According to the result from ListTypes the name of the module is Project, without the 's'.

ID's in Vtiger are prefixed with the module/object ID and an x, so your 9 would actually be:

19x9

Assuming 19 is the object ID for the user module. It is 19 in my Vtiger V7. You can make sure by calling Describe

If you need to find the name of the assigned user field, call Describe for the Project module. AFAIK assigned_user_id is correct.

Your query:

SELECT * FROM Project WHERE assigned_user_id='19x9'
0
Ruben Estrada On

Try the following:

SELECT * FROM vtiger_project INNER JOIN vtiger_crmentity ON projectid = crmid AND deleted = 0 where smownerid = 1;

the Assigned to field does not exist in the vtiger_project table, instead it is stored int he vtiger_crmentity table (that is true for all vtiger modules that have records).

The delted = 0 condition makes sure the record has not been (logically) deleted on vtiger.