Jump to content

TroubleShooter

Members
  • Posts

    24
  • Joined

  • Last visited

  • Days Won

    1

Reputation Activity

  1. Haha
    TroubleShooter got a reaction from DefinitelyNot31337 in Generate an expiration date   
    In addition to @DefinitelyNot31337's definitely genius solution, in case you're wondering how to get the last day of the current month, you may to use this syntax:
     
    DATEADD( month,  1, DATEADD(     DAY,     -DAY('[@cbTimestamp*]'),     '[@cbTimestamp*]'   ) )  
    Hope this helps,
    TroubleShooter
  2. Like
    TroubleShooter reacted to TsiBiRu in Hide (group of) fields based on another field's value   
    Hi @TroubleShooter,
    In my opinion, a straight forward approach for this is to create an Authentication for each of your Users (Type A, Type B, and Type C). Then create a Report DataPage for each user type, and then implement Record Level Security. For more details about how to implement RLS kindly check this link https://howto.caspio.com/getting-started/record-level-security-stamping-new-records/

    This way, you don't need to use / debug custom codes

    Hope this helps.

    Regards,
    TsiBiRu
     
  3. Like
    TroubleShooter reacted to DefinitelyNot31337 in Hide (group of) fields based on another field's value   
    Another approach is to use JavaScript. It's similar to the previous post but we're going to use JavaScript in this one.
     
    By this approach:
    1.) Same as previous post, first is to enclose your field/group of fields in a <div> tag, or <table> tag in HTML Blocks. (You will only need two HTML Blocks at most. If you want to hide an HTML Block, just enclose it in a <div> tag ).
    2.) Instead of a class, put an ID attribute for each blocks we want to hide (the condition will be defined later in the JavaScript). Sample usage would be  <div id="block1"> OR <div class="block1">
    3.) Once you have setup the class on the HTML Blocks, it's time to do JavaScript. Add a Footer, disable the HTML Editor from the Advanced tab, and paste the code below. (duplicate a whole block and edit the values as needed)
     
    <script> /* Block BEGIN */ var elemId = "block1"; var fieldName = "[@field:type]"; var fieldEqualTo = "typeA"; //Edits are unnecessary from this point to END var elem = document.querySelector(`[action*="[@cbAppKey]"] #${elemId}`); if (fieldName == fieldEqualTo) { elem.style.display = "none"; } /* Block END */ </script> 
  4. Like
    TroubleShooter reacted to Carlson in Hide (group of) fields based on another field's value   
    Troubleshooter,
    You can get around the issue in rules not working due to no editable fields, by adding the fields as hidden type or wrap them in a table to hide them, then display the values using virtual fields. Also, you can set rules to receive an authentication parameter to use in the logic of the rule.
     
×
×
  • Create New...