Jump to content


Caspio Ninja
  • Content Count

  • Joined

  • Last visited

  • Days Won


DefinitelyNot31337 last won the day on October 23

DefinitelyNot31337 had the most liked content!

1 Follower

About DefinitelyNot31337

  • Rank
    Advanced Member

Recent Profile Visitors

123 profile views
  1. DefinitelyNot31337


    Hi @JckDY, Formula Fields and Calculated Fields are fundamentally the same. Their values are processed and can be dynamic based by the values of the other fields. To give you further insight, I'll just give a few contrast points between the two. * Everything that a formula field can do, a calculated field can. * A formula field is defined on a table-level, whereas a calculated field is defined in a DataPage. * A formula field may only reference to fields that are in the same table, while a calculated field may select/reference to fields from other tables (Most SQL queries) * Last point, I think, is that formula fields may only have scalar values, meaning it does not have the ability to do SELECT statements, Subqueries, and get the current time, which a calculated field can. So the deciding factor on which to use would be the scope of the field. * If you want to be using a computed table field across multiple DataPages, Triggers, Views via a DataSource, formula field is the way to go. * If you would be using a function that is not doable in a formula field, go for calculated fields instead. Hope this helps. Regards, DN31337
  2. DefinitelyNot31337

    Add New Button

    If I understand correctly, you wanted to be able to append a button beside the "Back" button of a Details Drilldown. To do so, just paste the code below in the footer of your DataPage. Do make sure the HTML Editor in the Advanced tab is unchecked before pasting the code. <script> var linkUrl = 'https://www.google.com' var title = `Go ask Google, kiddie`; //Your HTML goes here. Edits are not necessary but you may do so if you know what you're doing var myButton = ` <a href="${linkUrl}" class="cbBackButton"> ${title} </a> `; document.querySelector('.cbBackButtonContainer').insertAdjacentHTML('beforeend', myButton); </script> Hope this helps. Regards, DN31337
  3. DefinitelyNot31337

    Passing Internal Parameter To Popup

    Hi @kpcollier, I don't know if I understand this thread correctly but based on the title and what I assume, I think you were trying to pass the current value of a parent field to a pop-up via external parameters. Is that correct? If not, I'd suggest to just open a new thread and just notify me to avoid confusion. If my assumption is what you want to achieve in a Submission Form DataPage, you may do the following: 1.) Add an HTML Block, Create the link that you wish using the WYSIWYG editor. Then click on source. 2.) Add an ID attribute to your link. (Copy-paste: id="linkToChild" ) 3. Add a Footer, disable HTML Editor, and Paste this code <script> var fieldName = "value"; // The name of your table field. var paramName = "myParam"; // The name of your parameter /* No modifications necesarry beyond this line */ var inputField = document.querySelector('[action*="[@cbAppKey]"] #InsertRecord' + fieldName); var linkToChild = document.querySelector('[action*="[@cbAppKey]"] #linkToChild'); var baseUrl = linkToChild.href; //do not touch var moddedUrl = baseUrl; //do not touch function updateLink() { moddedUrl = `${baseUrl}?${paramName}=${this.value}` } ['keydown','keyup'].forEach( function(e) { inputField.addEventListener(e, updateLink); }); linkToChild.onclick = function() { window.open(moddedUrl, '', 'resizable=no,status=no,location=no,toolbar=no,menubar=no,fullscreen=no,scrollbars=no,dependent=no'); return false; } </script> Note: When the link is hovered, it will show the value of the href attribute but if the it is clicked, the popup will still contain the parameter. Hope this helps. Regards, DN31337
  4. DefinitelyNot31337

    Passing Paramaters Containing Amperand (&)

    Hello, If you want to pass your parameter via query string , you may want to consider a different approach I came up with. In a Tabular Report Record: 1.) Create an HTML Block 2.) Disable the HTML Editor from the Advanced Tab 3.) Paste the code below then replace the variables corresponding to your need. <a id="link-[@cbRecordIndex]" target="_blank"> [@field:name] </a> <script> var protocol = 'http://'; var base_url = 'www.google.com'; var param = 'param'; var qStringVal = `[@field:name]`; document.querySelector('#link-[@cbRecordIndex]').href = `${protocol + base_url}/?${param}=${encodeURIComponent(qStringVal)}`; </script> Hope this helps. Regards, DN31337
  5. DefinitelyNot31337

    Caspio 15 and Chrome

    How about clearing your browser cache? You can do so by doing Crtl+Shift+Delete then select Time Range: All Time. If it still doesn't work, then this issue probably has something to do with Caspio. Either related on your account, or their backend. Regards, DN31337
  6. DefinitelyNot31337

    Limit Voting

    Hi, You may also want to implement composite keys as shown in this clip: Just concatenate the email field and datesubmitted field in a formula field and set it to unique. The formula syntax should look something like: [@field:email] + CONVERT(date, [@field:datesubmitted], 121)) Hope this helps. Regards, DN31337
  7. Hi, I modified MayMusic's JavaScript code. Please see below. The USAGE of this would be, copy paste this snippet in the footer of your DataPage. Then add/modify the addField lines as needed. <script type="text/javascript"> var fields = []; function addField(id) { var field = document.getElementById(id); field.maxLength = 10; fields.push(field); } function telephize(ev) { fields.forEach( function(elem) { var message = elem.value; message = (message.replace(/[^\d]/g, '')); message = ("(" + message.substring(0,3) + ") " + message.substring(3,6) + "-" + message.substring(6,10)); elem.maxLength = 14; elem.value = message; }); } document.querySelector("form[action*='[@cbAppKey]']").onsubmit = telephize; document.addEventListener("BeforeFormSubmit", telephize); addField('cbParamVirtual1'); addField('InsertRecordYOURFIELD'); addField('cbParamVirtual3'); </script> Hope this helps. Regards, DN31337
  8. DefinitelyNot31337

    AutoComplete based on Role

    Hello, (A different approach) If I understand you correctly, it's not actually hard to implement as it seems. I, myself, wanted to implement this before. I am assuming that you are using an Authentication in your DataPage. If so: First, what we need to do is to somehow add to a Default_Task field to the DataSource of your Authentication (much easier if it's a View, but you can also do with a field with manually input value. Hopefully this makes sense. I am attaching an image for you to better visualize my point). Once it's in your authentication field, you should be able to use that as an OnLoad value on pretty much all kinds of DataPages Hope this helps you, kpcollier Regards, DN311337
  9. Hi, A different approach would be to utilize the Triggered Actions instead. You'd just need a supervisors table then create a Triggered Action in your DataPage's DataSource. -- Otherwise, if Triggered Actions are not available on your plan, I'd suggest to hardcode ("manually input") the emails on a another column in your jobsites table. Hope this makes sense. Regards, DN31337
  10. DevArora is correct about the behavior of reset buttons. I just wanted to add my version JavaScript solution that will clear the values of all text elements on a specific DataPage. Just paste the snippet below in an HTML Block on Configure Search Fields Page (with HTML Editor disabled from the Advanced tab). <button type="button" onclick="resetForm()">Clear Form</button> <script> var myForm = document.querySelectorAll('form[action*="[@cbAppKey]"] input[type=text]'); function resetForm() { myForm.forEach(function(elem) { elem.value=""; }); } </script> Hope this helps. `DN31337
  11. DefinitelyNot31337

    Remove "Data Table" tooltip

    Hi, just want to add my version of JavaScript. To remove all tooltips that say "DataTable", try pasting the code block on either: the footer of your last DataPage (disable HTML Editor in the advanced tab) ; or just before the closing </body> tag of your webpage. <script> document.querySelectorAll('[title*="Data Table"]').forEach(function(elem){ elem.title=""; }) </script> Hope this helps -DN31337
  12. DefinitelyNot31337

    Simple Javascript Condition

    Hello @NJConrcs, Your question looks similar to a different forum post I found today. Please find my answer on on that thread and see if it satisfies your need. Attaching hyperlink: Hope this helps. Best Regards, DN31337
  13. DefinitelyNot31337

    Hide and/or Show Document Icons

    Hello @Accountability, Assuming that you have a Report DataPage, just paste the snippet provided on an HTML Block with HTML Editor disabled in the Advanced Tab. (Important). If it is a Details DataPage just remove all occurences of -[@cbRecordIndex#], else, just paste as is. (Be sure to keep a backup before saving). <div id="googledoc-[@cbRecordIndex#]"> Google Doc <br /> <a href="[@field:Employee_Document_Link]" target="_blank"> <img alt="File Quick View" src="http://account-ability.net/webapps/hca/images/Entypo_e731(1)_32.png" style="width: 32px; height: 32px;" /> </a> <div> <br /> <br /> <div id="uploadeddoc-[@cbRecordIndex#]"> Uploaded Doc <br /> <a href="https://c0axa147.caspio.com/dp/76292000e18ad3e841834930b209?Employee_Document_ID=[@field:Employee_Document_ID]" target="_blank"> <img alt="File Quick View" src="http://account-ability.net/webapps/hca/images/Entypo_e731(1)_32.png" style="width: 32px; height: 32px;" /> </a> <div> <script> var googledoc = document.getElementById('googledoc-[@cbRecordIndex#]'); var uploaddeddoc = document.getElementById('uploadeddoc-[@cbRecordIndex#]'); if (![@field:Employee_Document_Link]) googledoc.style.display = "none"; if (![@field:Employee_Document_Upload]) uploaddeddoc.style.display = "none"; </script> What I did was, I just modified your whole HTML block. Wrapped the two links on separate div tags, then wrote a script that hides the link if the condition field is blank/empty. Hope this works and helps. Regards, DN31337
  14. DefinitelyNot31337

    Conditional naviagation-links based on auth fields

    Hello TroubleShooter, You may want to do your links in an HTML DataPage then group your role-specific links in a container. Let me give a concrete example. <div id="root-links"> <div id="user"> <a href="#">User Specific Link</a> </div> <div id="tester"> <a href="#">Tester Specific Link</a> </div> <div id="superadmin"> <a href="#">Superadmin Specific Link</a> </div> <div> <script> document.querySelectorAll('#root-links div').forEach(function(elem){ if([@authfield:navId] != elem.id) { elem.style.display = "none"; } }); </script> After then, you can formulate a JavaScript code that will hide the group of links not intended not to be seen by the logged-on user. Hope this helps. Regards, DN31337
  15. DefinitelyNot31337

    Hiding Aggregate Columns (td)

    Hi Clint, Just to verify that we don't miss the standard way of doing stuff, though it's kind of obvious, would you want to hide the whole column? If so, you can just remove the field in Select Results Page Fields, or set its form element to Hidden in Configure Results Page Fields > field > Editing. Else, it's much better if you can provide your DataPage, probably with sample data and via Deployment URL / Exported file to better help you. Regards, DN31337