Replies: 1 comment
-
I have done this for user "delegates" -- in other words, a Project Manager user has a "default delegate" who should handle their work when the Project Manager is not available. So, similar scenario, I think, except that it is not 1:M? I have a UserListRow entity, which is based on an entity that happens to be a view; I don't think that matters particularly, but I mention it because it is not the same entity as the one for the regular user row. To get a list of people who can be assigned as the default delegate for the current Project Manager User, I just have this:
... in other words, I am not using LinkingSetRelation at all, and I am not sure why you are doing it, unless you have a cross reference table for your 1:M relationship. But I don't see a cross reference table here, you've just talked about 2 tables. Maybe if you explain your data model, or show a screenshot of the form with what you expect to be happening? |
Beta Was this translation helpful? Give feedback.
-
Hi All,
I have an issue with the LinkingSetRelation Attribute.
For my use case, let's say that I have a User table with an UserId
And I have a join Table named GoldenBook with :
GoldenBookId : Identity Key
PrimaryUserId : ForeignKey on UserId
SecondaryUserId : ForeignKey on UserId
The idea of the golden book is to have "duplicate" of users.
For example :
Jérémy J
Jérémie J
If we check the two lines above, we have a proximity of 98%, so we say that we have duplicate.
So, I have this code :
`[ConnectionKey("Default"), Module("X"), TableName("Users")]
[DisplayName("Users"), InstanceName("User")]
[ReadPermission(PermissionKeys.Security)]
[ModifyPermission(PermissionKeys.Security)]
[LookupScript]
public sealed class UserRow
: Row<UserRow.RowFields>, IIdRow
{
[IdProperty, Identity]
public long? UserId
{
get => Fields.UserId[this];
set => Fields.UserId[this] = value;
}
[LookupEditor(typeof(UserRow), Multiple = true)]
[LinkingSetRelation(typeof(GoldenBookRow), nameof(GoldenBookRow.PrimaryAdherantId), nameof(GoldenBookRow.SecondaryAdherantId))]
public List ProximityUsers
{
get => Fields.ProximityUsers[this];
set => Fields.ProximityUsers[this] = value;
}
public class RowFields
: RowFieldsBase
{
public Int64Field AdherantId;
// Other fields
public ListField ProximityAdherants;
}`
And this is the GoldenBookRow
`[ConnectionKey("Default"), Module("X"), TableName("GoldenBook")]
[DisplayName("GoldenBook"), InstanceName("GoldenBook")]
[ReadPermission(PermissionKeys.Security)]
[ModifyPermission(PermissionKeys.Security)]
public sealed class GoldenBookRow : Row<GoldenBookRow.RowFields>, IIdRow
{
[Identity, IdProperty]
public long? GoldenBookId
{
get => fields.GoldenBookId[this];
set => fields.GoldenBookId[this] = value;
}
}`
But the list on UserRow is never filled...
How can I do to make such things work ?
An idea ?
Beta Was this translation helpful? Give feedback.
All reactions