Update field through workflow ONLY when no related records are present - Printable Version +- CoreBOSBB (https://discussions.corebos.org) +-- Forum: Development (https://discussions.corebos.org/forumdisplay.php?fid=18) +--- Forum: coreBOS Development (https://discussions.corebos.org/forumdisplay.php?fid=4) +--- Thread: Update field through workflow ONLY when no related records are present (/showthread.php?tid=1146) |
Update field through workflow ONLY when no related records are present - Guido1982 - 07-11-2018 I have a use case where I hope I can use a workflow in stead of coding: I want to update the field 'dateinservice' in Assets. I have a custom module called 'ServiceJob' that is related to Assets through a M:M relation. Now I want to do the following: When an asset is saved, a workflow should check if only one ServiceJob is related. If so, the 'dateinservice' field should be filled with a field from that related ServiceJob record. If the no. or related ServiceJob records is 0 or greater than 1, it should do nothing. Do we have a workflow expression function that counts related records, or one that could be 'abused' to do so? RE: Update field through workflow ONLY when no related records are present - joebordes - 07-11-2018 I think you are going to have to create a custom function for that. RE: Update field through workflow ONLY when no related records are present - Guido1982 - 07-15-2018 Will do and PR it. |