Posts: 855
Threads: 238
Joined: Nov 2015
Reputation:
96
Since Business Maps use the workflow expression engine, I'd like to add a new expression. I need to make a business map that defaults the assigned to user to the current user when creating an Invoice from a SalesOrder. As far as I know, there is not expression to get the current user (ID). How would I add this?
Posts: 855
Threads: 238
Joined: Nov 2015
Reputation:
96
12-06-2016, 05:16 PM
(This post was last modified: 12-06-2016, 05:42 PM by Guido1982.)
This is really weird. I tested in my own install. There also an invoice will default to the user the SO is assigned to. In the coreBOS demo, the new invoice defaults to the current user. I don't understand why...
I even went as far as to set the $focus->column_fields['assigned_user_id'] in the editview.php of Invoices. But still no dice. I did find out that this only works for non-mandatory fields.
Posts: 855
Threads: 238
Joined: Nov 2015
Reputation:
96
07-13-2018, 05:11 PM
(This post was last modified: 07-13-2018, 05:33 PM by Guido1982.)
I've come a BIG step closer to what is happening. It is because the difference in user ID versus webservice user id. The module users has a webservice ID of 19. No matter which approach I choose, the assigned user keeps getting set to user no. 19, because the business map doesn't take the webservice markup into account.
I've given up. I'll just revert back to my hack to default the user to the current one when duplicating records.