Jump to content

NikkiC

Caspio Ninja
  • Posts

    39
  • Joined

  • Last visited

Recent Profile Visitors

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

NikkiC's Achievements

Newbie

Newbie (1/14)

2

Reputation

  1. Hi there, I have a tabular report with inline edit and delete enabled. This report shows a list of comments made by different users. I wish to only show the edit / delete options for the user who has made the comment. I have tried this: <script> var user = "[@authfield:User_info_User_ID]"; var author = "[@field:Card_comments_and_updates_Author_ID]"; if (user === author) { document.getElementByClassName("cbResultSetActionCell").style.display = "block"; } if (user !== author) { document.getElementByClassName("cbResultSetActionCell").style.display = "none"; } </script> but it's not working. I think it's something to do with the fact I've used "getElementByClassName", but there is no ID assigned to this field, so not sure how to reference it. I've added an html field to write YEP if the user=author and NOPE if not, just to check this is working OK, which it is in the attached screenshot, so I just want to apply this same logic to show or hide the edit / delete (which is inside this row: <td class="cbResultSetActionCell cbResultSetData"> The only other way I can think of to do this is to completely hide the edit / delete section, and then add a new one in, in the html field where I've currently got the YEP/NOPE. But I don't know what custom link needs to go in there for edit and delete, or if this can even be done in the same way you can add a custom save / delete button in a datapage. Any help would be much appreciated! Many thanks Nikki
  2. Hi there, I have a details report datapage, where users can update information in this page. I'd like to somehow determine what has been updated every time this page is accessed, without having to list all of the fields. Caspio support suggested I do this using triggered actions, but I can't see how this is doable as there's no way to check if an element has changed, and it would mean specifying each individual field. I feel like this should be doable in JavaScript, but can't quite figure out how. My datapage reads from the table Card, but auto updates a separate table called Card_comments_and_updates, so I'd like the script to add a comma separated string to pass as a parameter listing all the field names that have changed, to this second table. Can anyone help me with this, please? TIA! Nikki
  3. This works perfectly, thank you so much @MayMusic! This issue has been with Caspio support for a week and they haven't been able to help
  4. Hi there, I have a tabular report datapage, that I am using to display calculations from my table. I want to show week number, and what has happened during that week. So far I have 2 columns other than week number, number of cards updated, and total number of updates. The calculations I am using are working fine, but it's showing each number as a separate row. So if the calculation for week 6 is 7 updates, it shows 7 rows. See attached screenshot. Below is my code. Anyone know how I only show each line once (so there's only 1 row for each week number) Number of cards updated SELECT COUNT (DISTINCT [@field:Card_ID]) FROM Card_comments_and_updates WHERE Week=target.[@field:Week] Total number of updates SELECT COUNT([@field:Card_ID]) FROM Card_comments_and_updates WHERE Week=target.[@field:Week]
  5. Hi there, I have a formula that is working fine in most instances, but it falls down every once in a while. I think I've got it figured out and then it falls down again! This is my code IsNull((SELECT sum(IsNull([@field:Optimiser_RatingX],0)+IsNull([@field:QA_Tester_RatingX],0)) FROM Card_comments_and_updates WHERE User_ID=[@field:Analyst_IDX])/((SELECT COUNT(IsNull([@field:Optimiser_RatingX],0)) FROM Card_comments_and_updates WHERE IsNull([@field:Optimiser_RatingX],0) >0 AND User_ID=[@field:Analyst_IDX])+(SELECT COUNT(IsNull([@field:QA_Tester_RatingX],0)) FROM Card_comments_and_updates WHERE IsNull([@field:QA_Tester_RatingX],0) >0 AND User_ID=[@field:Analyst_IDX])),0) I want it to display zero if it can't calculate anything! Basically my datapage displays all my users along with an average of all the star ratings they have. The calculated field looks in a different table for every instance where the user ID in this table is listed in the Analyst column. Then it checks the 2 different fields where ratings are given (QA Tester Rating and Optimiser rating) for values more than 0. Adds them together and then divides them by the count, thereby giving the average. For the most part it works fine ... EXCEPT where there are fields where either the QA Tester Rating or Optimiser Rating are zero. Help! Many thanks Nikki
  6. Hi there, I have records called Cards, which span 5 different stages. If the first part of the Card is completed, the user is in stage 1. If the first and second part is completed, they are in stage 2 etc etc. I'd like to automate this (currently they can choose their own stage via a dropdown), and have written the following script, but it's not working. <script> var count_Brief= ("[@field:Brief]").length; var count_AnalystNotes = ("[@field:Analyst_Notes]").length; var count_RecTest = ("[@field:Recommended_test]").length; var count_Result= ("[@field:Actual_result]").length; if (count_Brief > 1) { document.getElementById("EditRecordStage").innerHTML = "2. Brief"; } else if (count_Brief > 1 && count_AnalystNotes > 1) { document.getElementById("EditRecordStage").value = "3. Analysis"; } else if (count_Brief > 1 && count_AnalystNotes > 1 && count_RecTest > 1) { document.getElementById("EditRecordStage").value = "4. Test"; } else if (count_Brief > 1 && count_AnalystNotes > 1 && count_RecTest > 1 && count_Result > 1) { document.getElementById("EditRecordStage").value = "5. Result"; } else { document.getElementById("EditRecordStage").value = "1. Question"; } </script> Does anyone have any insight here? Many thanks Nikki
  7. Hi, I have a Submission form datapage and the submit button isn't working. it's quite specifically styled, so I have added a header and footer to this page in order to contain the style, as it didn't seem to work doing it by the associated style sheet (I need a background image to span the whole table and then separate background images for individual cells). When the header and footer is enabled, the submit button doesn't work. When I delete the header and footer, the submit button does work, but my layout doesn't. I've tried adding the button as a separate element in an html field, and again it doesn't work. Does anyone know why this is happening and what I can do to sort it out? Many thanks Nikki
  8. Just to let anyone know if they're interested that I got this script to work, by changing the datapage! There must have been something in the original one that stopped it from working.
  9. I've been working on this, and managed to find a solution which works in a testing environment, but not within Caspio! <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal" data-cardid="[@field:Card_ID#]">[@field:Question]</button> <div class="modal fade" id="exampleModal" role="dialog" aria-labelledby="exampleModalLabel"> <div class="modal-dialog modal-lg" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <h4 class="modal-title" id="exampleModalLabel">Card ID</h4> </div> <div class="modal-body"></div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </div> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script> <script> $('#exampleModal').on('show.bs.modal', function (event) { var button = $(event.relatedTarget) var recipient = button.data('cardid') var modal = $(this) modal.find('.modal-title').text('Card ID ' + recipient) modal.find('.modal-body').html('<iframe src="https://account.testboard.com/TEST_CARD_MODAL.php?Card_ID=' + recipient + '" style="width: 850px; height: 600px;">') }) $('#exampleModal').on('hidden.bs.modal', function () { window.location.reload(); }) </script> Can anybody help??!! Many thanks Nikki
  10. Hi, We have a datapage of a list of current records. At present, we click on a link, and the individual record opens up in a new tab / window. What we would like to do, is have the record appear in a lightbox / modal. However because there is no active "link" involved in opening up a modal (done with Bootstrap - it's simply: data-toggle="modal" data-target="#myModal") and then I would put the Caspio deploy code within div class="modal-content" - how would I ensure the correct record opens up? Many thanks Nikki
  11. Thanks so much for looking at this, @MayMusic, really appreciate it! Yes, it's definitely a head scratcher, but it seems like it should be such a simple thing, my clients are like "why haven't you done this yet"?!!
  12. Hi there, Just re-opened this with Caspio support and thought I'd see if anyone here has any ideas yet? This is a real pain, since the groups themselves don't have a Unique ID I can call (they're all called "Group 1") Any help would be much appreciated! Nikki
  13. Hi there, I am using the standard autosubmit script to send users to one form using parameters to auto fill it and autosubmit it and then on to another form. However some users get stuck in a loop if a field in the first autosubmit form are already in the table, and they never get to the second form and don't see the error message. Is there a way to write into this script "if field already exists in table [users] DO NOT autosubmit, instead show an error message? <script type="text/javascript"> if(document.getElementById("caspioform")) { document.getElementById("caspioform").style.display = 'none'; setTimeout('document.forms["caspioform"].submit()',1000); } </script> Many thanks Nikki
  14. Hi, I am using a script in an html block to detect certain criteria and display something based on that criteria. Here is my script: <script> var status = "[@field:Account_status]"; function invitepopup() { window.open("https://c3fot467.caspio.com/dp.asp?AppKey=34fe4000f38aceb2a5da4c74bea2&UserID=[@field:User_ID]", "Invite", "menubar=1,resizable=1,width=500,height=500"); } if (status === "Yes") { document.write("Active"); } else { document.write('<a href="#" onclick="invitepopup()" title="Click to invite again">Invited by [@field:OriginUserName]</a>'); } </script> The if/else works fine, it shows "Active" for all the active users and "Click to invite again" for all the invitees ... however the link doesn't send the parameter properly. https://c3fot467.caspio.com/dp.asp?AppKey=34fe4000f38aceb2a5da4c74bea2&UserID=[@field:User_ID] is passed with the wrong User_ID. It seems to be passing the ID of the last user in the table, rather than the ID of the row it is in - it's currently showing 3 invitees in my table and they all are being received by the popup with the same ID (last user in the table). However if I just put this in as a plain (<a href="https://c3fot467.caspio.com/dp.asp?AppKey=34fe4000f38aceb2a5da4c74bea2&UserID=[@field:User_ID]" title="Click to invite again">Invited by [@field:OriginUserName]</a>), it works completely fine! Is there something in the script which is removing or replacing the User ID? I'm completely stumped! Hope someone can help! Many thanks Nikki
  15. Hi there, Thanks for this, I didn't explain properly ... these aren't separate groups, it's one field, grouped by what's in the field! So my field is "status" and it is grouped by one of 3 items in this field: open, pending, archive. I would like "open" to be expanded, but pending and archive to be collapsed. Many thanks! Nikki
×
×
  • Create New...