Creating a module record from a workflow via webservice - Printable Version +- CoreBOSBB (https://discussions.corebos.org) +-- Forum: Support (https://discussions.corebos.org/forumdisplay.php?fid=17) +--- Forum: Modules/Extension Support (https://discussions.corebos.org/forumdisplay.php?fid=9) +--- Thread: Creating a module record from a workflow via webservice (/showthread.php?tid=216) Pages:
1
2
|
RE: Creating a module record from a workflow via webservice - joebordes - 12-30-2015 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 RE: Creating a module record from a workflow via webservice - Guido1982 - 12-30-2015 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. RE: Creating a module record from a workflow via webservice - joebordes - 12-30-2015 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/master/include/Webservices/CustomerPortalWS.php#L16 RE: Creating a module record from a workflow via webservice - Guido1982 - 01-04-2016 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? RE: Creating a module record from a workflow via webservice - joebordes - 01-04-2016 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" RE: Creating a module record from a workflow via webservice - Guido1982 - 01-04-2016 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. |