CapNcook Posted August 30, 2023 Report Share Posted August 30, 2023 I have two tables and two tabular reports. Tbl_Customer and Tbl_Projects In the table customer this is where I set the limit field in which the user can only add a record base on this limit This is what it looks like in the tabular page. Now when I click mark it would bring me to another tabular page where the user can inline add but I want them to be able to add only base on the limit for example in the screenshot Mark has only "1" limit I want to limit mark to be able to only post 1 record. Any thoughts about this? jyll2113 1 Quote Link to comment Share on other sites More sharing options...
ianGPT Posted August 30, 2023 Report Share Posted August 30, 2023 Hi, Since you are already passing parameters to view the customer projects via tabular report you can also pass the limit parameter.https://howto.caspio.com/parameters/passing-parameters/ Example Now on your tabular report you can hide the in-line add table-row by using this simple CSS and Javascript. CSS <style id="dynamic-styles"> /* Initial styles here */ </style> JS: <script> var lidValue = parseInt([@lid]); // Assuming [@lid] returns a number var rowIndexToHide = lidValue + 2; var styleTag = document.getElementById("dynamic-styles"); if (styleTag) { styleTag.innerHTML += ` .cbResultSetDataRow:nth-child(${rowIndexToHide}) { display: none; } `; } </script> what it would do is it would hide the rows of the inline add if it's already in the limit. Hope this helps! Quote Link to comment Share on other sites More sharing options...
Merikirin Posted September 18, 2023 Report Share Posted September 18, 2023 Hi, You may want to consider adding a formula field that adds +2 to the value of the Limit field for the row of the Header in the DataPage and the Inline Insert count. And then on the Projects DataPage, you can just add a code to the Header for counting the rows and the field Limit value. The [@FLimit] is the parameter name for the LimitFormula field on the table that you created on the Customers table. I hope it helps! 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.