Posts: 3,565
Threads: 36
Joined: Apr 2014
Reputation:
49
Bring in the current_user from the global scope, you are inside the application so it is already there. The example you link can be executed from the command line or independently so it needs to get the user.
The rest looks ok
Joe
TSolucio
Posts: 855
Threads: 238
Joined: Nov 2015
Reputation:
96
I also found out you have to set the 'assigned_user_id' in the 'data to send' array in the form of 19x[USER_ID], which is a webservice format.
Posts: 855
Threads: 238
Joined: Nov 2015
Reputation:
96
Okay, I studied your example and I understand the function. But I don't fully understand what the webservice ID is. I looked in the database at the table you query, it seems as though the ws entity ID tells the system which module made this request? Anyway, for my purpose I suppose I should always look up the ID for the 'Users' and prefix the 'assigned_user_id' with this?
Posts: 3,565
Threads: 36
Joined: Apr 2014
Reputation:
49
The webservice interface uses an enhanced identifier structure which is defined by the ID of the module, followed by the letter x and then the crmid of the exact record. So with one ID we know the module and the exact record. I'm not quite sure why this is like this, nor why the module identifier isn't the same as the module's tabid (vtiger_tab) which would have seemed logical and what I would have done.
I have asked this question in the vtiger CRM developer's list a few times but I was totally ignored as usual (!!).
In any case, you are correct, you will be safe getting the Users module webservice id from the table and using that value instead of a hardcoded "19"
Joe
TSolucio
Posts: 855
Threads: 238
Joined: Nov 2015
Reputation:
96
Exactly, at first glance I started to look in the vtiger_tab table also, since it seemed redundant to me as well to create a completely different table for this. Well, this is the reason why we are here now, and not in the vTiger forum: because they have seem to lost sight of the open-source mentality. I am convinced that a collaboration like coreBOS will lead to a better product in the end.