Jump to content

khale

Caspio Ninja
  • Posts

    30
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

khale's Achievements

  1. Good day! Is there a way to save multiple dates on a calendar? I have case managers that meet with clients. They use a submission form to enter the date they met with the client, however when they meet with them again, the date of the last visit is then overridden by the next visit date. I want to be able to save the last meeting date AND the next meeting date on the calendar. I saw this thread but I don't need to select multiple dates, I just need to save more than one date on the calendar. Any ideas?
  2. I figured it out. Just added the code to multiple HTML blocks and all works fine! Not sure if that's the right way or not (please tell me if not) but its working! Thanks again! You're great!
  3. Like this for example.. <script> document.addEventListener('DataPageReady', colorHandler) function colorHandler() { const calcFieldCells = document.querySelectorAll('form[action*="[@cbAppKey]"] tr.cbResultSetDataRow td:nth-child(7)'); const doneFieldCells = document.querySelectorAll('form[action*="[@cbAppKey]"] tr.cbResultSetDataRow td:nth-child(6)'); const calcFieldCells = document.querySelectorAll('form[action*="[@cbAppKey]"] tr.cbResultSetDataRow td:nth-child(10)'); const doneFieldCells = document.querySelectorAll('form[action*="[@cbAppKey]"] tr.cbResultSetDataRow td:nth-child(9)'); calcFieldCells.forEach((cell, index) => { if(doneFieldCells[index].innerText.trim() !='') { cell.style.backgroundColor = '#bfbfbf'; } else if (parseInt(cell.innerText) <= 1) { cell.style.backgroundColor = '#ff5a4b'; } else if (parseInt(cell.innerText) > 1 && parseFloat(cell.innerText) <= 31) { cell.style.backgroundColor = '#f2f18b'; } else if (parseInt(cell.innerText) > 31 && parseFloat(cell.innerText) <= 62) { cell.style.backgroundColor = '#ff9966'; } }); document.removeEventListener('DataPageReady', colorHandler) } </script>
  4. Yes! This worked beautifully! I really appreciate your help! I have several columns that this code needs to apply to. I just copy it over and change the referencing fields, correct? Again, thank you so much!
  5. Hi Coopper Backpack! Thanks again for your help on this. I am trying to get the "gray" portion of this code to work but I am unsuccessful. In the current state of the code, its not changing to gray if the field is not blank. Thanks again for your help!
  6. Yes The Done column is in position 8
  7. And the code worked beautifully! Just need the fields to turn grey if there is a date in the done field!
  8. Good Morning! Thank you so much for responding! To answer your questions, In my example the Calculated field is the 3rd field on the results page, so I reference it accordingly in the script. Its 5th in mine so I will update accordingly. 1) Do you need to apply the font color or the background color? Background color only 2) Have you applied formatting for the values in the Calculated field? For example, there is the currency sign, etc.? No formatting as its just numbers without decimals. 3) Please clarify this part of the condition "If the value in another cell is not blank, change the color to grey". Do you mean that, for example, the value in the Calc field = 5 but the decision to color the field is based on another field? If that field is blank the script colors the Calc value in yellow, but if it is not blank - in gray. So basically, the calculated field calculates how many days past a due date or until how many more days until its due. There is also a field that's not calculated that is if it was already done date. If that date is populated, then the calculated field should turn gray, indicating that it has been done. Thanks so much!
  9. Hi! I am trying to get the cell of a calculated field to turn colors based on the value. I found this code but I am not sure how to make it work: <style> input[name="InsertRecordFIELDNAME"][value="Active"] { color: green; } </style> Basically, I want the value of a calculated filed to change colors based on the value. Specifically, <1 = Red, 1-31 Yellow, 32-62 Orange, and if the value in another cell is not blank, change the color to grey. Its a tabular report with a chart and html is disabled. Any help or direction will be appreciated!
  10. Hi! I found this code that I am trying to get to work for my case. I have several fields that need to change color so the array is great. However, I need it to change red if the date is overdue, yellow if its due this month and green if its due next month. Any ideas on how to accomplish this? TIA! <script> if (document.DataPageReadyHandler == undefined) { const columnsArr = [6,7,8,9,10,11,12,13] const paintCell = (cell, color) => { cell.style = color } const colorTableCells = () => { document.querySelectorAll('.cbResultSetDataRow').forEach(row=>{ for (let i=0;i<columnsArr.length;i++) { let cell = row.querySelector(`td:nth-child(${columnsArr[i]})`) if (cell==null) return switch (cell.innerHTML.trim()) { case '1': {paintCell(cell, 'background: #df4d55;color: #ffffff') break } case '2': {paintCell(cell, 'background: #fcc200;color: #ffffff') break } case '3': {paintCell(cell, 'background: #96ded1;color: #000000') break } case '4': {paintCell(cell, 'background: #96ded1;color: #000000') break } case 'NA': {paintCell(cell, 'background: #e6e6e6;color: #000000') break } } } }) } const DataPageReadyHandler = (e) => { if (e.detail.appKey != '[@cbAppKey]') { return } colorTableCells () } document.addEventListener('DataPageReady', DataPageReadyHandler) document.DataPageReadyHandler = 'Enabled' } </script>
  11. Got it to work! I had the "hide if blank" feature on. Turned it off and alls well! Thank you so much for your help! I immensely appreciate it! Have a great day!
  12. Ok, I tried the code. It is not highlighting any of the type fields. Am I to put it in a html block or leave it in the footer? Yes, all fields have labels...
  13. Sorry, hit enter too soon! Yes, that is the expected result! I am trying this now! Thanks again!
×
×
  • Create New...