marcd Posted March 16, 2019 Report Share Posted March 16, 2019 Can someone help me with a JS that will add a record with parameters to a table by clicking on a row of a tabular report? Would also work if it was a link added to each row. I'm trying to allow users to quickly create a list of favorites from a large database of docs. Details: Click on tab report row (or link) generated from "Docs" table > add new record to "Favorites" table setting Favorites.DocID to Docs.DocID AND @UserID to Favorites.UserID Thank you!! marc Quote Link to comment Share on other sites More sharing options...
MayMusic Posted March 18, 2019 Report Share Posted March 18, 2019 1. Create a favorite table that includes these fields: Doc_ID, User_ID, DateAdded (Timestamp) 2. Authentication this page 3. Check to receive Doc_ID as a parameter 4. Receive User_ID from Authentication 5. Add an HTML Block to the end of element list and use this code to auto submit this page https://forums.caspio.com/topic/4314-js-auto-submit-a-datapage/ 6. In the report DataPage, add an HTML Block and Type in "Add" 7. Highlight the test and click on hyperlink icon, paste the URL to this submission page and at the end add "?Doc_ID=[@field:Doc_ID]" 8. Click on Target tab and select popup window. This way by clicking on this link a popup page will open and add the record of the Doc to this table. If you create a report based on Favorite table and enable RLS on User_ID, each user can see the list of items they have added Quote Link to comment Share on other sites More sharing options...
marcd Posted March 18, 2019 Author Report Share Posted March 18, 2019 Thank you! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.