How to add (or delete) an instance (via business rule) to a multiple allowed value (list) of an attribute ?
Example :
When a Person has a multiple allowed attribute : Department
How to add the 2nd department ?
Or just delete a department of the "list"
Something like :
Person.ob_Department = Person.ob_Department + ThisDepartment
Add / delete instances to a multiple value (SOLVED)
Add / delete instances to a multiple value (SOLVED)
Last edited by jannes on Mon Jul 12, 2021 8:38 am, edited 1 time in total.
Re: Add / delete instances to a multiple value
INSERT Department IN Person.ob_Department
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL
-
- Posts: 2413
- Joined: Mon Jul 02, 2012 12:24 am
- Location: Ulaanbaatar, Mongolia
Re: Add / delete instances to a multiple value
I generally do it a little differently depending on if the Reference is Single or Multiple..
So.... in the situation above, INSERT Department IN Person.ob_Department, ob_Department is Singular so I would ALWAYS use..
Person.ob_Department = Department
However, if the Departments Reference is multiple... ie... a Person can belong to many Departments....
Person.pm_Departments for example... then I would use
INSERT Department IN Person.pm_Departments
So.... in the situation above, INSERT Department IN Person.ob_Department, ob_Department is Singular so I would ALWAYS use..
Person.ob_Department = Department
However, if the Departments Reference is multiple... ie... a Person can belong to many Departments....
Person.pm_Departments for example... then I would use
INSERT Department IN Person.pm_Departments
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....