Jump to content


Caspio Rockstar
  • Posts

  • Joined

  • Last visited

  • Days Won


Community Answers

  1. TellMeWhy's post in Stylized List Report was marked as the answer   
    Something like this? 

    If yes, I added <br /> at the end of each Label
    On Header:
    <style> dd{ background-color:yellow; } </style> dd is for the data, dt is for labels
    Here's script for the conditional: from https://howto.caspio.com/tech-tips-and-articles/advanced-customizations/how-to-dynamically-change-the-background-of-a-results-page/
    <div id="visi[@field:UNIQUEID]"> </div> <script> if([@field:FIELDINNUMBER] < 10){ var isi = document.getElementById("visi[@field:UNIQUEID]"); isi.style.display = 'none'; isi.parentNode.parentNode.children[5].style.backgroundColor = 'red'; } </script> change children number, as well. I suggest putting the HTML block at the end. use ctrl shift c then count the elements under the <dl> starting from 0. Mine is the 6th child, so, it's 5

  2. TellMeWhy's post in Label Current Month was marked as the answer   
    Anything Dynamic in a Webpage needs JavaScript
    Put this on your Label
    <span id="CurrMonth"></span> Then on Footer
    <script> var d = new Date(); var n = d.getMonth(); var months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']; document.getElementById("CurrMonth").innerHTML = months[n]; </script> getMonth returns 0 for January, 1 for February and so on
  3. TellMeWhy's post in XML Download Issues was marked as the answer   
    Seems that if you have a 'Report' in file name, it gets corrupted. 'Reports' work fine

    EDIT: nvm it seems that it's the short date
  4. TellMeWhy's post in Calculated Field Date was marked as the answer   
    Here's the conversion codes
    You can also try changing the formatting, should definitely be doable there, however, it's just for display, value would still be the same.,
  5. TellMeWhy's post in Calculated Field Help was marked as the answer   
    What DataPage is this? try using 
    WHERE Job_ID = target.[@field:Job_ID]  
  6. TellMeWhy's post in Formula Field Check if INT was marked as the answer   
    Not sure what the RIGHT is for, you can try this

    CASE WHEN isNumeric(FIELD) = 1 THEN CONVERT(INT, ROUND(FIELD,0)) ELSE 0 END it checks if it's numeric (numeric may be INT, Float, etc)
    if it is (equal to 1) Then Round the Field to 0 decimal (because INT has no decimal) and convert it to INT(can be omitted, but, just to be sure) to avoid incompatible values when the field's value is in decimal
    Else, 0 or any number you want
  7. TellMeWhy's post in No Scrollbar in Wordpress was marked as the answer   
    should be something to do with overflow of the container, this one hides it, if you want the scrollbar, just use 'scroll' instead of 'hidden'

  8. TellMeWhy's post in Formula Field Int to String was marked as the answer   
    You can convert it to TEXT 
    'CC'+CONVERT(VARCHAR, (SELECT MAX(Clean_Job) FROM tbl_ggl_job WHERE Job_Letter = 'CC') + 1)) Double check the parenthesis if it's the correct amount
  9. TellMeWhy's post in Show all when checked? was marked as the answer   
    It might be better to use Dropdown or Radio button for the On Hold Field so you get Yes, No, and Any option.
    If you want to use checkbox, you'll have to use this option

    There would be no way to display all records regardless if it's On Hold or Not, though.
  10. TellMeWhy's post in Conditionally Change Background and Text Color was marked as the answer   
    You only need 1 HTML Block
    <div id="visi[@field:Report_ID]"> [@calcfield:1]</div> <script> var isi = document.getElementById("visi[@field:Report_ID]"); if([@calcfield:1#] > 47){ isi.parentNode.parentNode.style.backgroundColor = 'red'; //background color isi.style.color="yellow"; //font color } else{ isi.parentNode.parentNode.style.backgroundColor = '#NoColor'; } </script> You need to use UNIQUE Field for the id, my unique field is Report_ID
    You can also insert the calc field in the div already, and then just change the font color base on the conditions.
  11. TellMeWhy's post in Stacked Area Chart Colors was marked as the answer   
    Try JS instead,
    <script type = "text/javascript" > var timer = setInterval(function() { //Find if chart exists using rect element every x milliseconds if (document.getElementsByTagName('rect') != null) { //Update Chart UpdateChart(); } }, 500); function UpdateChart() { try { Highcharts.charts[0].update({ //CHANGES HERE series: [ {color:'red'}, {color:'blue'}, {color:'yellow'} ] //CHANGES END HERE }); //Stop checking clearInterval(timer); } catch (err) { //log errors } }; </script> basically makes the first one red, then blue, then yellow
    No script:

    With the script

  12. TellMeWhy's post in Remove from dropdown if value has been taken on date was marked as the answer   
    This is quite tricky, basically, you have lookup table for assistants, and they can only be booked PER DAY, and if they're booked for that date already, then they're not selectable in the dropdown.
    Here's what I tested
    Virtual Field 1
    STUFF( (SELECT ' , ' + CAST (FIELDNAME AS nvarchar) FROM TABLENAME WHERE DATEFIELD = target.[@field:DateFIELD] FOR XML PATH ('')) , 1, 2, '') What this does is combine all records that meet the criteria. We want to use this to select values where the date is the specific date that the user is booking.

    For example here, I'm using June 28 2021 as the date and the three values showed up.
    Virtual 2 is a Custom and LookUp Table Dropdown
    <script> document.querySelector("input[name='cbParamVirtual1']").addEventListener("change", function(event){ var d2 = document.getElementById("cbParamVirtual2"); var a= document.querySelector("input[name='cbParamVirtual1']").value; for (var i=0; i<d2.length; i++) { if (a.includes(d2.options[i].value)){ d2.options[i].remove(); } else { d2.options[i].style.display = "block"; } } }); </script>  
    What this script does is loop through the options in dropdown and check if 'a' (or the Virtual 1 Calculated Value) includes the said option then removes it from the dropdown.

    I hope this helps!
  13. TellMeWhy's post in Trigger Help was marked as the answer   
    Most of these are not needed.
    1.) You don't need NEW NOTES field, you only need one, so you won't need the 2nd part anymore
    2.) INSERT INTO tbl_job_notes SELECT FROM Job Table instead of #inserted
    This is an example

    In this, if I update Table one Quantity, what will get inserted in tableTwo is the OLD quantity since the new quantity is in the #inserted.Quantity

    You can add Where clause on the Select From if you want to check if the specific field has been updated (you're right with the tableone not equal #inserted)
  14. TellMeWhy's post in Timestamp for individual fields was marked as the answer   
    I see, then you'll probably need one update block for each field. Your Timestamp field should be a Text or Date Field (you need to use concatenate block if it's a text field)

    For example this one, update #inserted so it will put the timestamp in the field, when #inserted and table check is not equal means it's been updated/changed
  15. TellMeWhy's post in Vertical Column Headers was marked as the answer   
    text-align:center !important;
    vertical-align:center !important;
    .cbResultSetLabel:nth-child(2) {
    transform: rotate(180deg);
    You can try this, you'll have to manually set the number of that header, if you want 2 and 3, you'll do .cbResultSetLabel:nth-child(2), .cbResultSetLabel:nth-child(3) 

    Just separate with comma
  16. TellMeWhy's post in Get Values From List - String Into Text Field was marked as the answer   

    Btw, I found a way
    <script> document.querySelector("input[id^='InsertRecordList']").addEventListener('change', function() { document.getElementById('cbParamVirtual1').value = document.querySelector("input[id^='ComboBoxInsertRecordList']").value; }); </script> The input with id starting with InsertRecord**FieldName** stores the checked values, so you can just use that as a reference to listen for a change

    You can try it out again https://c2aby549.caspio.com/dp/83ff8000344c2f4c1794467fb6e2 
  17. TellMeWhy's post in Caspio Knowledge Base Navigation Bar was marked as the answer   
    The code for the Navigation menu is not on the HTML, but on the JavaScript files since it's the most efficient way to do, and you can just call it using one line on every HTML Page.
    1. Go to JS folder of the Application
    2. Right-click on the file named 'common' and edit it using your desired Text Editor
    3. You may look for the line 'function load_user_sidenavbar(active_nav)' for user navigation menu and 'function load_admin_sidenavbar(active_nav)' for the admin navigation menu. You can use Ctrl + F if the application supports that function.
    Hope this helps!
  18. TellMeWhy's post in Disable option in dropdown was marked as the answer   
    Hi @imJihyo,
    Yes, unfortunately, this can't be done through standard features as we cannot edit the HTML tag of the options through DataPage Settings. We may use JavaScript for this one, though.
    Please change the id 'InsertRecordTitle' to your proper field ID

    This basically takes the first option 'options[0]'  and disables it 'disabled=true' so it cannot be selected.
    Here's a demo if you want to see
  • Create New...