Register a Custom Workflow Function and it will appear in the task list.
e.g.:
require'modules/com_vtiger_workflow/VTEntityMethodManager.inc';$emm=newVTEntityMethodManager($adb);$emm->addEntityMethod("Contacts","My Custom Function Name","path/to-file/containing/custom/function/code.php","className");
Hi Alan , I meant custom expression functions , the ones you get when in “update fields task” select expression and you have a menu full of simple functions like concat or strreplace.
Don’t you think it would be useful to populate that menu with custom functions too?
I don't recall ever really needing that myself. But it doesn't seem like a bad idea. It might be helpful to include a "use-case" to explain what it could be used for.
Also, I think I might have read a similar request before. Have you searched the issue list?
I know Alan I've written those issues myself.
I think this could make a programmer's job faster.
Well this could be a simple use case:
write in a field an address' latitude, selecting a function in a menu of "update fields" workflow task , passing this function some parameters like street city and country.
now imagine using this function again by selecting it from a menu for another vtiger, no code changes, just select function and parameters, done.
@angelo.paglialonga I wrote the GeoTools extension module and geocoding or reverse geocoding isn't that easy to do. The Google service is probably the most reliable but you are not permitted by their license conditions to use it on a private application (only public websites). I'm not sure how that would fit in with the original request - that doesn't sound like a
simple functions like concat or strreplace.
Secondly, it's not really a good idea to create multiple tickets for the same issue/request.
Thirdly, I still think you need to explain some real-life use cases (as I do not really understand the benefits) and then support this with a merge request that has code. Then others can evaluate what you are suggesting more easily.
@lord_alan first of all, if I write a new issue and if you don't like it that's ok, I don't think you have any approval rights here.
Other crm systems like corebos have in workflow expression menu custom functions like "getLatitude", so don't take it personally as an attack if I use it as an example of a custom function with parameters.
And lastly @lord_alan I've already explained the benefits of having custom functions in workflow expression menu, if you don't see any it's fine, don't worry, let's see what others think of it
@angelo.paglialonga It's nothing to do with if "I like it or not". It is generally considered to be unhelpful to create multiple tickets for the same issue. Maintainers find it hard enough to keep up so duplicating is simply not helpful at all.
I have a great deal of experience with vtiger and business in general over many, many years - I'm old ;-) The point I was making was simply that if I can't understand why your idea is a good thing, then you probably haven't explained it very well. But there was no malice or personal criticism in my comments; if I offended you in any way then I apologise - that was not my intention.
Ok @lord_alan, I'm happy to know there's no malice or personal criticism.
If you don't understand my example than I suggest you to take a look at workflows at demo.corebos.com,
At Corebos, devs also think that having a library of custom functions with parameters in update fields speeds up development.
Let's see what other people in vtiger team think of it. Personally I'm trying to be open and to bring innovation in my tools no matter where it comes from. I'll close duplicate thickets don't worry, I care about maintainers too and I'm trying to help the community.
This is a very good point @angelo.paglialonga and there is a demand by users of Vtiger OS. Example cases:
Upper case, Small case, Replace : helps in keeping data clean. Such as on integration with from various lead portals, sone send country codes as in IN, IND, india etc. Coud be used to replace those values with standard. Though better would be dropdown for Country.
Similarly, phone numbers come in different formats.
Creating content which is going ahead to be put in Email template etc..
Sum, Avg. Deviation, Max, Min etc. can make life easier.
Geo location service to get Lat. Long. for a given address.
Whether its good or nnot by our decisions, businesses using Vtiger ask for this.
Thank you @nilay.automatesmb for your thoughts and examples! I've made an extension allowing custom expression functions in workflows and I'm currently testing it
I just found a use-case for this... a customer is having issues with a url field. Somehow the url is being saved but containing spaces (it might be coming in over a webform or REST maybe). It would be helpful to have a workflow function triggered, when this field value changes, to urlencode() the value :-)