Jump to content

Is there a way to prevent the user in adding a records base on field?

Recommended Posts

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? 


Link to comment
Share on other sites


Since you are already passing parameters to view the customer projects via tabular report you can also pass the limit parameter.


Now on your tabular report you can hide the in-line add table-row by using this simple CSS and Javascript.
<style id="dynamic-styles">
  /* Initial styles here */


  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;

what it would do is it would hide the rows of the inline add if it's already in the limit.

Hope this helps!


Link to comment
Share on other sites

  • 3 weeks later...


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! 

Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...