Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Creating a module record from a workflow via webservice
#11
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
Reply
#12
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.
Reply
#13
All mandatory fields must have a value.
Be careful with the "19x" that value may change depending on the installation you are working on, so to make it generic you have to get that value from the database.

For example:
https://github.com/tsolucio/corebos/blob...WS.php#L16
Joe
TSolucio
Reply
#14
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?
Reply
#15
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
Reply
#16
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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)