How can I make Rollbase generate multiple records

Posted by Bob van Elburg on 27-Jul-2016 09:49

In my application on rollbase I have the function to create a task and assing this to a project. Recently I want to add the feature to be able to create a general task to multiple project. But as a result I have the same task record assigned to multiple projects.

As a result I want to have individual tasks generated for each assigned project without having to create multiple individual tasks by hand.

Is this possible in Rollbase and how?

All Replies

Posted by Santosh Patel on 28-Jul-2016 00:12

You should create another object called "Unassigned Task" to mimic "Task" object with a 1:m relationship with Project object. Enable workflow on Unassigned Task and add an action to run an object script trigger that iterates over the project Ids assigned to "Unassigned Task" and creates a new Task record for each of these with the desired data. Use rbv_api.createRecord

The flow would be, to create an "Unassigned Task". Fill in the task details and also select the projects that this task would be assigned to. Once created, the workflow action on this record say, "Assign Task", will create a separate "Task" record associated with each of the project.

Note: The workflow aspect is to easily render the action in the More Actions menu on the record. You could also create a button that invokes rbf_runTrigger in javascript if you think workflow is an overkill.

This thread is closed