Membership Plugin - Populate CreatedByUserNum from drop down.
2 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: January 14, 2011 (RSS)
By Rusty - January 14, 2011 - edited: January 14, 2011
the Frvilious Details...
I have a Section Editor section called Customer but labeled Order Status. The admin can create an order, and then via a drop down single select, choose the client for whom the Order Status record will be associated with.
Since the admin is creating the order, the CreatedByUserNum populates from the Admins num, however the issue is that the client, will have Author status, so they can append/make changes to their order notes etc. and as such, since they didn't author the Order Status, they can't view it.
How can I get CMS Builder to populate the "CreatedByUserNum" from the "Client" drop down. This way, the table records it as being created/authored by that user, and when the client logs in they can view the records.
I need CMS Builder to let a user have access to on this criteria.
If CreatedByUserNum = $CURRENT_USER['num'] OR if CreatedByUserNum = 1 (admin) AND Client = CurrentUserNum.
The other option/possibility would be to Assign the $RECORD[client] value to the CreatedByUserNum.
I'm sure there's a way to do it. I can see in the CMS Builder Drop down Field Type selection I can pick "Related Records"
If I pick that Option I could just set the value by doing this: "CreatedByUserNum = $RECORD[client]
But when I try to save it, the popup msg says the "Type must be set to None"
Please Help Me!
================
2 hours of messing around later...
I have discovered a round-about way of sort of fixing it. By clicking on the "change" text link next to the "Created By" user, we can change who "Created" that record. It's more or less doing the exact same thing I want to do, but I want to populate that change automatically from a drop down when the Client is selected.
Still open for any thoughts on how we can do this automatically.
I have a Section Editor section called Customer but labeled Order Status. The admin can create an order, and then via a drop down single select, choose the client for whom the Order Status record will be associated with.
Since the admin is creating the order, the CreatedByUserNum populates from the Admins num, however the issue is that the client, will have Author status, so they can append/make changes to their order notes etc. and as such, since they didn't author the Order Status, they can't view it.
How can I get CMS Builder to populate the "CreatedByUserNum" from the "Client" drop down. This way, the table records it as being created/authored by that user, and when the client logs in they can view the records.
I need CMS Builder to let a user have access to on this criteria.
If CreatedByUserNum = $CURRENT_USER['num'] OR if CreatedByUserNum = 1 (admin) AND Client = CurrentUserNum.
The other option/possibility would be to Assign the $RECORD[client] value to the CreatedByUserNum.
I'm sure there's a way to do it. I can see in the CMS Builder Drop down Field Type selection I can pick "Related Records"
If I pick that Option I could just set the value by doing this: "CreatedByUserNum = $RECORD[client]
But when I try to save it, the popup msg says the "Type must be set to None"
Please Help Me!
================
2 hours of messing around later...
I have discovered a round-about way of sort of fixing it. By clicking on the "change" text link next to the "Created By" user, we can change who "Created" that record. It's more or less doing the exact same thing I want to do, but I want to populate that change automatically from a drop down when the Client is selected.
Still open for any thoughts on how we can do this automatically.
Rusty
Re: [Rusty] Membership Plugin - Populate CreatedByUserNum from drop down.
By Jason - January 14, 2011
Hi Rusty,
The solution where you use the "Change" link to set which user created it will definitely be the quickest solution.
Assigning a value to createdByUserNum based on the value of another field in your section can be accomplished with a plugin that would automatically run after the record is saved.
If you're interested in this, please send an email to consulting@interactivetools.com with all of your requirements (ie, is it only for 1 section, is it only when a record is created, or when it's modified as well, etc). and we can get you an estimate.
Hope this helps.
The solution where you use the "Change" link to set which user created it will definitely be the quickest solution.
Assigning a value to createdByUserNum based on the value of another field in your section can be accomplished with a plugin that would automatically run after the record is saved.
If you're interested in this, please send an email to consulting@interactivetools.com with all of your requirements (ie, is it only for 1 section, is it only when a record is created, or when it's modified as well, etc). and we can get you an estimate.
Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/