Jump to content

pmcfarlain

Caspio Ninja
  • Posts

    89
  • Joined

  • Last visited

Everything posted by pmcfarlain

  1. Just realized it was the # after the calcfield causing the issue. Removing it fixed this. <div id="visi[@field:tbl_ggl_job_lines_Line_Number]">[@calcfield:1]</div> <script> var isi = document.getElementById("visi[@field:tbl_ggl_job_lines_Line_Number]"); if([@calcfield:1] < 0){ isi.parentNode.parentNode.style.backgroundColor = 'yellow'; //background color isi.style.color="red"; //font color } else{ isi.parentNode.parentNode.style.backgroundColor = '#NoColor'; } </script> So now that this field is displaying the calculated value, I have 2 "Days" fields. In the tabular report I don't see a way to hide the calculated value. Is there a way I can calculate it in the HTML block?
  2. Realized that because of the way my view is set up the Job Number is not a unique field so I changed it to the Line Number which is a GUID. Still no luck. <div id="visi[@field:tbl_ggl_job_lines_Line_Number#]">[@calcfield:1#]</div> <script> var isi = document.getElementById("visi[@field:tbl_ggl_job_lines_Line_Number#]"); if([@calcfield:1#] < 0){ isi.parentNode.parentNode.style.backgroundColor = 'red'; //background color isi.style.color="yellow"; //font color } else{ isi.parentNode.parentNode.style.backgroundColor = '#NoColor'; } </script> Let me know if you see any issues with the updated code.
  3. Sure. Here's the two blocks: The calculated field is just taking the difference in days between today and the due date.
  4. Thanks for your response! I pasted this code into an HTML block and swapped "Report_ID" for my unique ID but it's still not showing any color. Here's what's in my HTML block: <div id="visi[@field:job_Job]">[@calcfield:1#]</div> <script> var isi = document.getElementById("visi[@field:job_Job]"); if([@calcfield:1#] < 0){ isi.parentNode.parentNode.style.backgroundColor = 'red'; //background color isi.style.color="yellow"; //font color } else{ isi.parentNode.parentNode.style.backgroundColor = '#NoColor'; } </script> And here's the result (HTML on the left, original on the right): Here's the link to my test page: https://c1dcs476.caspio.com/dp/66ca9000fb6b84ef7b9a462ba0a2
  5. I'd like it to set the row red. The field I'm referring to in the HTML is the calculated field "Days". This is the URL for a sample page: https://c1dcs476.caspio.com/dp/66ca9000fb6b84ef7b9a462ba0a2
  6. I'd like to add some HTML to my Datapage to conditionally change the color of a report's background and text color based on the value of a calculated field. This field finds the number of days left until a project is due. I'd like to change the text color of this field to red and the background to yellow if it is past due (if the days left are negative). I know there are a couple of other pre-existing threads on this topic but for some reason I am having no luck. I pasted these in the source of my header but they had no effect. Let me know if you see anything wrong with my formulas: //for the background <a id="visi[@calcfield:1#]"> <script> var isi = document.getElementById("visi[@calcfield:1#]"); if(isi < 0){ isi.parentNode.parentNode.style.backgroundColor = 'red'; } else{ isi.parentNode.parentNode.style.backgroundColor = '#NoColor'; } </script></a> //for the text <div id="mydiv[@calcfield:1#]"> </div> <SCRIPT LANGUAGE="JavaScript"> if ("[@calcfield:1#]" < "0"){ document.getElementById("mydiv[@calcfield:1#]").innerHTML ="<span style='color:red;'> [@calcfield:1#] </span>"; } </SCRIPT>
  7. None of these solutions are having any effect on my table. Am I doing something wrong? <div id="mydiv[@calcfield:1#]"> </div> <SCRIPT LANGUAGE="JavaScript"> if ("[@calcfield:1#]" < "0"){ document.getElementById("mydiv[@calcfield:1#]").innerHTML ="<span style='color:red;'> [@calcfield:1#] </span>"; } </SCRIPT> This should be able to set the text color to red if the calculated field "Days" (which gets the days left until the project is due) is negative. Ideally, I'd like to set the background yellow and the text red. The background thread wasn't working for me either. Am I using the wrong IDs? or does it not work with calculated fields?
  8. None of these solutions are having any effect on my table. Am I doing something wrong? <a id="visi[@calcfield:1#]"> <script> var isi = document.getElementById("visi[@calcfield:1#]"); if(isi < 0){ isi.parentNode.parentNode.style.backgroundColor = 'red'; } else{ isi.parentNode.parentNode.style.backgroundColor = '#NoColor'; } </script></a> This should be able to set the background color to red if the calculated field "Days" (which gets the days left until the project is due) is negative. Ideally, I'd like to set the background yellow and the text red. The text thread wasn't working for me either. Am I using the wrong IDs? or does it not work with calculated fields?
  9. I'd prefer to keep it unique as these tables should be one-to-one rather than one-to-many but if I need to change it to make this work that's not the end of the world. However, even after turning off unique on the child table, I'm still getting the same error message.
  10. I'm trying to enforce referential integrity with some tables in my app so that I can cascade update/delete records but I keep getting this error: The parent field is an autonumber and the related field is a unique integer. It's a one-to-one relationship with an inner join. Here's the relationship settings. Any ideas?
  11. So I'm trying to make a trigger so that when new data is inserted/updated in my table it checks that the address doesn't match any existing addresses for that Customer and if not, it stores the address in a lookup table for easier inputting in the future. This is the trigger I set up but it isn't working. Anyone know a better way to do this?
  12. Shouldn't the FULL OUTER join include all records from the tables though?
  13. I need some help figuring out the issue with my trigger. Currently, it inserts nothing into my tbl_ggl_job_lines_dates table. In previous iterations, it has inserted duplicates of the same record. What it does is make a line from the feeder table which is this #inserted table. Then it should use this trigger to create a matching line in the dates table with some info filled in from the feeder table. The feeder table only has the Job ID which can have many Line Numbers within it. The dates table only has the Line Number. The #inserted table has both. Thus the two joins. The where statement is supposed to ensure that I don't pick up duplicate records but I'm not picking up any records. Any help would be appreciated. Thanks!
  14. That improves it but doesn't fully solve the problem. Also it makes the rows a bit taller than I'd like.
  15. Exactly what I was looking for thanks! Sorry for the unclear phrasing!
  16. I'd like to reduce the row height in my editable tables. I did so in my normal tables by reducing the padding in the stylesheet so that it now looks like this: But I can't find where to edit the editable columns in the stylesheet. This is what it currently looks like: How can I adjust this?
  17. I'd like to increase the width of my record action cell so that it doesn't end up like this: I tried doing so here: But for some reason it made no difference whatsoever. I think it might have to do with the columns fitting JUST the width of their header text. Which is another problem I'd like to fix. How can I set the width of a specific column when I'm using it in a datapage? I've tried adjusting the field width but it doesn't seem to make a difference. Any help would be appreciated. Thanks!
  18. On editable tables, I'd like to move the "Edit" button from the left side to the right. Is there a way to edit this in the stylesheet?
  19. I'm working on a trigger to create a certain number of lines based on the quantity specified upon submission. Basically it's one table that feeds another table. Here's the trigger. Variable i starts at the First Serial Number specified upon submission and iterates while i is less than the serial number plus the number of lines. Each line has a unique incremental serial number in the format JOB-01 where 01 is the serial number and JOB is the job ID. That's what the concatenate statement should do. This is the error I'm getting which doesn't make any sense because this should just be inserting new lines right? It shouldn't affect any vast number of records... Please help!
  20. I need help debugging a trigger. The whole trigger is very big because it's all the actions that need to happen when any data in the table is updated. Trying to avoid too much cascading. But here's what's relevant to my issue: So I have two tables, one for current notes and one for the history of all notes ever added to a job. In my job table, I have a Notes column and a New Notes column which is perpetually blank so that new notes can be added. What this trigger is supposed to do is insert the old note into my history table along with the Job ID and who submitted it. Then, the update should put the new note into the Notes column and empty out the New Notes column. What actually happens is the second part of the trigger works perfectly and adds the new note to the notes column but something goes awry with the first part and it adds 2 new rows to my history table with the note as completely blank and it also changes any pre-existing records with the same Job ID to be blank ???? I am at a loss. Please help!
  21. I have a table of phases and the goal is to save the time that each phase was completed. I can make a separate table for the timestamps if that would improve speed but I'm still not clear on how to grab the timestamp when a specific column is updated. Are you suggesting I make another table with the previous statuses and just compare if it has changed from one table to the other? I'll definitely have to use the audit trail suggestion in the future but I'm not sure it's as helpful in this specific instance since the columns are simple checkboxes and I don't need to save previous data from them, only the time that they were updated. Thanks!
  22. I'd like to change the height of my rows so that I can show more data on-screen at a time. Is this possible?
  23. Is there a way to change the label width in a single record update form? This is the way it looks right now and I'd prefer a more uniform look.
  24. Is there a way to save previous fields when using the bulk edit feature? I want to be able to quickly and easily update multiple records if need be but also save the old dates.
×
×
  • Create New...