11 Replies Latest reply on Apr 29, 2013 10:56 AM by philmodjunk

    Portal with Unique checkbox per user

    AppGuy

      Title

      Portal with Unique checkbox per user

      Post

           OK.. I need  some help here.. I am totally drawing a blank on how to go about doing this.

           I have a sign-in page that is a web portal..  when people come they sign into the portal on this layout.

           When they check they review button it takes them to another layout (based on the same table) and displays related records from another web portal called jobs.  This portion is working great. 

           Here is the part I am stuck on..

           I would like each user when they click the review button to be able to review each of the related records in the other web portal (JOBS). Each person that signs in will be able to create a new review record for each job.

           So if user1 signs into the sign-in portal, clicks the review button, it goes to the review layout and shows the related records from jobs, then they can choose with ones they want to check(review).

           then if user2 signs in.. they repeat the same process with a new review

           Right now I have:   signin--TO--main--TO--jobs      and  signin--TO--review

           Hopefully this makes sense...

            

        • 1. Re: Portal with Unique checkbox per user
          philmodjunk

               By "web portal" I assume that this is a database published to the web using IWP.

               Don't use a check box in that portal, use a button that performs a script to create the needed related "review" record for the current user. A calculation field in the portal's table can display different content based on whether that related record for that Job exists or not--it can even be given a checkbox format in the inspector to show the value as selected when the calculation returns the value specified in the assigned value list.

          • 2. Re: Portal with Unique checkbox per user
            AppGuy

                 ok  will be the button a try..  Actually it's just a portal in a layout..  the portal pulls in mulitple records based on the relationship.

                  

            • 3. Re: Portal with Unique checkbox per user
              AppGuy

                   OK.. got the button on the portal but having an issue.. 

                   The script is creating records for each entry to a separate table/field that is related to the portal.  I also have a condition on the button so when the reviewed field is empty the color is red and when not empty turn green.. this works great for the 1st one, but all the buttons turn green. 

                   I am thinking it might be a relationship issue at this point..  ideas..??

                   Here is hte script I created.

              • 4. Re: Portal with Unique checkbox per user
                AppGuy

                     portal view

                • 5. Re: Portal with Unique checkbox per user
                  philmodjunk

                       Is this for publishing to the web with Instant Web Publishing?

                       I think I'd need to see the relationships you have designed and the method you are using to change the color--conditional formatting doesn't work when using IWP BTW.

                       I'm puzzled by the go to record step in your script, but need to see how you've structured your tables/relationships before I can comment more that to observe that that step takes you to a different record in the table specified by your layout set up instead of a completely different table--so this seems odd.

                  • 6. Re: Portal with Unique checkbox per user
                    AppGuy

                         Phil-

                         No this is not for IWP... just a portal on a layout.. 

                         Just to re-iterate..

                         There will only be one JSA.

                         There will be multiple records on the jsa_portal table for each JSA.

                         There will also be multiple records on the signin for each JSA.

                         This is working great..

                         Now getting to the fun stuff..

                         When a person signs in to the personnel_sign in table - this is a portal on a layout.

                         I would like the ability to review each record on the jsa_portal and check a button or box that signifies "reviewed". This is based on each person that signs in on the personnel_sign.

                         So each record on the jsa_portal can be reviewed mutilple times by each person that signs in.

                          

                    • 7. Re: Portal with Unique checkbox per user
                      philmodjunk

                           New Issue:

                           How does JSA_form::JSA_ID get a value. The "crows foot" in the relationship line that indicates that this is not an auto-entered serial number concerns me that you have a potential week spot in your data model.

                           This is indeed the "fun part" in both senses of the vernacular.

                           

                                So each record on the jsa_portal can be reviewed mutilple times by each person that signs in.

                           I don't see any table in your system for recording each "review". If the same person reviews the same record in jsa_portal a second time, should there be one entry or two in that table to show that they reviewed it?

                      • 8. Re: Portal with Unique checkbox per user
                        AppGuy

                             Phil-

                             I am using UUID's in each table as a pk.  This generates the jsa_id.  

                             I was doing some testing with the touch_rate table. This is where I was storing my "review"  There is a field called Touch_Rate::Touch_Rate_Check_Status.

                             I tried multiple things but just not getting the results I want.  

                             If a person reviews the records in the jas_portal a second time they would have to create another record in the personnel_signin table to do this.

                             In other words..  a single signin (or a single record in the personnel_signin) can only have 1 review, but the review would consist on reviewing each of the related records in the jsa_portal table.  They would need to check off each one they reviewed. (They may choose not to review all of them only a few.)

                              

                              

                              

                        • 9. Re: Portal with Unique checkbox per user
                          philmodjunk

                               I take it then that you do want to create a new record if someone reviews the same record twice, but that each record should be linked to separate sign in records.

                               My best guess is that Touch_Rate and portal_touch_review are two occurrences of the same table. Clicking a button inside the Jsa_portal should perform the following script:

                               Set Variable [$JsaID ; value: jsa_portal::id ]
                               Set Variable [$PersID ; value: Personnel_signin::Personnel_id]
                               Freeze Window
                               Go to Layout ["Touch_Rate" (Touch_Rate) ]
                               New Record/Request
                               Set Field [Touch_Rate::_fkPersonnelSignin ; $PersID ]
                               Set Field [Touch_Rate::_fkJSAportal ; $JsaID ]
                               Go To Layout [original layout]

                               And the layout where you have the portal to jsa_portal should be based on Personnel_Signin, not jsa.

                                

                          • 10. Re: Portal with Unique checkbox per user
                            AppGuy

                                 Phil-

                                 I think I am almost there...  when the script executes I need it to grab the jsa_portal::id from that specific row in the portal..  It seems to be grabbing the 1st one all the time.

                                 I have tried Get(activeportalrow) and get(recordnumber)  and can't seem to get it to pull that portal row's unique id to pass to the touch field..??

                                  

                                  

                                  

                                  

                            • 11. Re: Portal with Unique checkbox per user
                              philmodjunk

                                   If your layout is based on  the sign in table and your portal refers to jsa_portal and your button is located inside the portal row,

                                   Set Variable [$JsaID ; value: jsa_portal::id ]

                                   will capture that value from the portal row where the user clicked the button.