Leigh Posted November 30, 2016 Report Share Posted November 30, 2016 (edited) Hello, I have very little Java experience and am relatively new to Caspio. I have read through all the postings on this forum and have tried as much as I can. My problem is this: I need to display a link on a line of a tabular report results page based on the value of a field in the line. Description: The line consists of information about members in a family. The family can have any number of members. One of the members is the primary member and that is indicated by a value of 'Yes' in a checkbox stored in the database. I want only the primary member to have the link to the pantry page and the other member lines to just display a blank space. This is to prevent pantry items being added for all the members when there can be only one pantry item per day for the group. I would like to see: John Smith Yes link_to_pantry Jane Smith No blank Jimmy Smith No blank Is this even possible? Thank you for any help you can provide. I am really stuck. Leigh Additional Info: I have tried the following in a calculated field, but can't get it to display a link: CASE WHEN [@field:Primary_Client] = 1 THEN '<a href="https://c3afw034.caspio.com/dp.asp?AppKey=a2dc40005863d83f783a4981a28b&GBurg_Household_ID=[@field:GBurg_Household_ID]">Pantry</a>' WHEN [@field:Primary_Client] = 0 THEN ' ' ELSE 'OKAY' END It displays the link code for the correct entry, but doesn't just display Pantry with a line under it. Edited November 30, 2016 by Leigh Additional Info Quote Link to comment Share on other sites More sharing options...
Leigh Posted November 30, 2016 Author Report Share Posted November 30, 2016 I have resolved this by putting the code in an HTML block: <script> if ("[@field:Primary_Client]" == "Yes") { document.write("<a href='https://c3afw034.caspio.com/dp.asp?AppKey=appkeyhere&Household_ID=[@field:Household_ID]'>Pantry</a>"); } else { document.write(" "); } </script> Quote Link to comment Share on other sites More sharing options...
MayMusic Posted December 6, 2016 Report Share Posted December 6, 2016 Since you are using document.write you need to make sure to disable Ajax on your report Quote Link to comment Share on other sites More sharing options...
Meekeee Posted March 25, 2022 Report Share Posted March 25, 2022 Hi - sharing this new post! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.