Automatically filling-in a related record field in a portal

Posted by Rollbase User on 23-Feb-2012 15:14

I am creating a flow of pages in a portal. A logged-in portal user (AppUser) creates a new session (AppUser object is linked to the Session object in a 1 to many relationship) How do I get the "AppUser" drop down in the Session Portal page to automatically fill-in the name of the current AppUser, or Record Creator?

All Replies

Posted by Admin on 23-Feb-2012 18:06
Hi,



Try going to the page editor of the new session portal page and then clicking on the appuser lookup field. If the required checkbox is ticked untick it first then click on the use record in scope checkbox, additionally you can set the display to be hidden and then tick the show record in scope option, this blocks the portal user from changing the value of the appuser lookup - if ever you need it.



Hope this helps :-)
Posted by Admin on 23-Feb-2012 18:52
Yes, it worked, thank you.



Another question:

In this record, I would like to have a "count" field, that would count the number of sessions that are related to the "AppUser"? I also want, either this field, or another field, have the count become "static," as soon as the record is saved.



Example:

- Session 1 created, (count in record session 1 = 1)

- Session 2 created, (count in record session 2 = 2, and count in record session 1 = 1)

- etc.



Thanks

Posted by Admin on 24-Feb-2012 06:13
Set an update field value trigger after create that returns the count of related records of the record creator and save it on the session record. You can do this by using rbv_api.selectNumber('select count(id) from session where createdBy={!createdBy}');



Hope this helps

Piscoso Martin
Posted by Admin on 01-Mar-2012 17:36
Thanks Martin,



It's helpful



Marc
This thread is closed