2 owners to a record

The recommended method of customizing your AppGini-generated application is through hooks. But sometimes you might need to add functionality not accessible through hooks. You can discuss this here.
Post Reply
Maevari
Posts: 5
Joined: 2015-06-14 15:26

2 owners to a record

Post by Maevari » 2015-06-14 15:31

Is there a way that I can add TWO owners to a record?

Anyone can help with this, as without this feature my "application" is utterly useless :cry:

I was trying to find a similar issue on the forum, but the only 2 posts are 2 years old, and without solutions.

User avatar
shasta59
AppGini Super Hero
AppGini Super Hero
Posts: 231
Joined: 2013-01-08 19:40
Location: Calgary, Alberta, Canada

Re: 2 owners to a record

Post by shasta59 » 2015-06-16 00:11

A couple of questions:

What version of appgini are you using? (This is very handy to post at the beginning of your message.)
Do both owners need to have their own user/pass?

There is a way to do it but it is a real workaround.

If you look in membership_userrecords this is where you can figure out who owns what record. It is listed by memberID.

What I did was duplicate the record and then have some code to determine who is editing what based upon their username. Then the code I wrote would update the other record with the new dateUpdated data.

So yes, it is possible, but it is not pretty and causes some other issues. I have thought out a way around this but do not have the time nor inclination to work it out so it is clean and works well with the entire system. It means having to work with many other aspects of the programming. As I would have not have a use for this method other than in a very limited respect.

Instead I am working on a method whereby a member can be a member of more than one group. This, to me, is much more useful.

There may be someone who is willing to write the code for you to do this but everything you regenerate you have to insure you do the necessary things to include the code changes.

Sorry this is not a solution but am advising you it is possible and wish you luck in the programming to get it to work.
Calgary, Alberta, Canada - Using Appgini 5.50 -

Maevari
Posts: 5
Joined: 2015-06-14 15:26

Re: 2 owners to a record

Post by Maevari » 2015-06-16 15:17

PRO 4.51.

What I really need is a solution, where 1 user creates a record, which then is visible by another member from a different group (but this member only). So in another word, a record is assigned to a designated person based on some sort of criteria; an 'owner' seemed to be good criteria.

On the other hand, a method where 1 member can be assigned to 1 or more 2 groups does sound nice, but does not really solve my problem.

User avatar
shasta59
AppGini Super Hero
AppGini Super Hero
Posts: 231
Joined: 2013-01-08 19:40
Location: Calgary, Alberta, Canada

Re: 2 owners to a record

Post by shasta59 » 2015-06-16 15:24

How would you be deciding who can look at the other member's record? Manually? Or are you looking for an automatic solution?

What criteria will you be using to decide who can look at what?

Alan
Calgary, Alberta, Canada - Using Appgini 5.50 -

Maevari
Posts: 5
Joined: 2015-06-14 15:26

Re: 2 owners to a record

Post by Maevari » 2015-06-16 16:05

I will give you a scenario that perhaps will explain my problem:

* We have an Instructor (a member of 'Instructors' group) and a Student (obviously a member of 'Students' group)
* Each member of any group can view their own records only
* An instructor creates a number of courses assigned to him only, each with an unique name (table 'Available Courses')
* A student can create a list with desired courses from different instructors /look up functionality/ (My Courses)
* Once a new course is registered by a student, THIS PARTICULAR record only needs to be visible for an instructor who has created the course in the first place (table 'Active Courses')
* After a course is completed, the instructor marks the course as 'completed' (then a record is moved from 'Active Courses' to 'Completed Courses')

For this scenario, I need a solution that can automatically assigned, let's call it a second owner based on available criteria (course name, instructor name etc)

I somehow think, this is too complicated for AppGini without massive development :)

User avatar
shasta59
AppGini Super Hero
AppGini Super Hero
Posts: 231
Joined: 2013-01-08 19:40
Location: Calgary, Alberta, Canada

Re: 2 owners to a record

Post by shasta59 » 2015-06-16 17:47

AppGini is a framework to get a working database online with a front end. It is not a final solution for every situation.

But it is very possible to use AppGini to do this after the basic code is created.

What would need to happen is once the record is created the added code would then look at the instructor listed and add his username as an owner of that record in the additional fields. New fields in membership_userrecords such as memberID2 and groupID2 would be needed and then the code would work with these.

It is not easy but also can be done. Means mapping out the functions and code which use membership_userrecords and changing it. There is no program out there built to do this out of the box. It would all be custom work. I took a quick look at all the places where membership_userrecords appears in the generated application code and there is a lot but to do what you want would not be hard just time consuming.

As a final note I will include this paragraph from the AppGini page: (yes it should be you time not your time but this is what is on the website)

http://www.bigprof.com/appgini/

AppGini greatly saves your time by taking care of the routine data management code. This allows you to concentrate on your business logic, and to reduce project finish time.


Note where it says reduce project finish time. Your project front end and basics are all done for you and all you have to do is the rest of what you need it to do. Concentrate on your business logic. Not the answer to your problem but a confirmation it is possible.

Alan
Calgary, Alberta, Canada - Using Appgini 5.50 -

User avatar
a.gneady
Site Admin
Posts: 1354
Joined: 2012-09-27 14:46
Contact:

Re: 2 owners to a record

Post by a.gneady » 2015-06-20 13:29

yes it should be you time not your time but this is what is on the website
Fixed that. Thanks for the hint :D
:idea: AppGini plugins to add more power to your apps:

Post Reply