Skip to main content
Version: v19 R8

One to Many - Actions

We are now going to go a little bit further and create a task for a specific employee.

It is very easy to create an entity using parent Entity !

Let's get started by downloading the Starter project:

Create addProject action

  • Open the project editor and go to the Action section.

  • Add a addProject Action

create addProject Method

On Mobile App Action method

The only thing you have to do is defining the addProject action in the On Mobile App Action method as follows :

: ($request.action="addProjects")

$o:=New object(\

$result:=addProject ($o)

addProject Method

Then enter thoses lines in your addProject Method:



$out:=New object("success";False)

If ($in.dataClass#Null)

$entity:=ds[$in.dataClass].new() //Create a reference

For each ($key;$in.parameters)


End for each

$primaryKey:=$in.parent.primaryKey //Get parent primary key


$inverseRelationName:=$in.entity.relationName //Get parent relation name


$status:=$ //save the entity

$out.success:=True // notify App that action success

$out.dataSynchro:=True // notify App to refresh the selection

$out.statusText:="Task added"



$out.errors:=New collection("No Selection")

End if


And that's it you can then add some task to your employees easily using the parent Entity !

Download the completed project: