Jump to content

rrushton

Members
  • Posts

    10
  • Joined

  • Last visited

Recent Profile Visitors

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

rrushton's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I am creating a sales form which produces an error if there is not enough available quantity. I am using virtual fields and the below script is successful. The script below produces the error when Virtual 8 is > either Virtual 7 OR Virtual 3. I need to add to it to produce the error when Virtual 8 is greater than Virtual3 OR Virtual7 OR Virtual11 OR Virtual14. NOTE: Virtual3 will always have a value, while only one of Virtual 7, 11 or 14 will ever have a value. <script> document.addEventListener('BeforeFormSubmit', function(ev) { var virtual3 = +document.querySelector(`[action*="[@cbAppKey]"] [id*=cbParamVirtual3]`).innerText; var virtual7 = +document.querySelector(`[action*="[@cbAppKey]"] [id*=cbParamVirtual7]`).innerText; var virtual8 = +document.querySelector(`[action*="[@cbAppKey]"] [id*=cbParamVirtual8]`).innerText; if (virtual8 > virtual3 || virtual8 > virtual7 ) { ev.preventDefault(); alert("Error: Not enough spaces! Please chose a tour with more availability"); } }) </script> Would anyone be able to help with this script?
  2. Hi. It is a tabular report, please see screenshot. I am trying to replace the two HTML blocks links "Settle Ruby" and "Settle OTCs" with one link. OTC is SHIP_ID 53 and it has a different settlement process report than all the other ships.
  3. The HREFs do work as links in separate HTML blocks with RECORD_ID and SHIP_ID fields - those are accurate. HTML Editor is unchecked.
  4. Thank you George. Unfortunately, I still am not getting any result off the script.
  5. Hello! Thank you for your assistance with the script. I tried to implement the example for my script but did not have success with the following. Would you kindly point out where I've gone wrong? <button type="button" id="button[@field:RECORD_ID#]">Settle</button> <script type="text/javascript"> document.addEventListener('DataPageReady', function (event) { document.getElementById('button[@field:RECORD_ID#]').addEventListener('click',()=>{ if(+'[@field:SHIP_ID]'==53){ //window.location.href = 'app.mysite.com/admin/settlement/otc/?SHIP_ID=[@field:SHIP_ID]&RECORD_ID=[@field:RECORD_ID]&PORT=[@field:PORT]&DATE=[@field:DATE*]'; }else{ //window.location.href = 'app.mysite.com/admin/settlement/ship/?SHIP_ID=[@field:SHIP_ID]&RECORD_ID=[@field:RECORD_ID]&DATE=[@field:DATE*]'; } }); }); </script>
  6. Hello. Hoping some JS experts here on the forum can help with script for two very similar requests. I am trying to re-direct the user to different pages based on the an record ID in both scenarios. 1. Redirect based on SHIP_ID. If the ship is SHIP_ID # 53, redirect to page x, if the SHIP_ID is not #53, redirect to page y. 2. Redirect based on TOUR_SITE_ID. Tour sites 1, 2, 3, 4, 6 & 8 use one type of report (..../food-plan/..... and Tour Sites 5 & 7 use a different type of report (...../food-grid/.....). I have attempted the following without success: <button onclick="myFunction()">Click me</button> <script> function myFunction() { if(" [@field:TOUR_SITE_ID] " = 1){ window.location = "https://www.myapp.com/system/food-plan/?RECORD_ID=[@field:RECORD_ID]"; } else if (" [@field:TOUR_SITE_ID] " =2){ window.location = "https://www.myapp.com/system/food-plan/?RECORD_ID=[@field:RECORD_ID]"; } else if (" [@field:TOUR_SITE_ID] " =3){ window.location = "https://www.myapp.com/system/food-plan/?RECORD_ID=[@field:RECORD_ID]"; } else if (" [@field:TOUR_SITE_ID] " =4){ window.location = "https://www.myapp.com/system/food-plan/?RECORD_ID=[@field:RECORD_ID]"; } else if (" [@field:TOUR_SITE_ID] " =6){ window.location = "https://www.myapp.com/system/food-plan/?RECORD_ID=[@field:RECORD_ID]"; } else if (" [@field:TOUR_SITE_ID] " =8){ window.location = "https://www.myapp.com/system/food-plan/?RECORD_ID=[@field:RECORD_ID]"; } else if (" [@field:TOUR_SITE_ID] " =5){ window.location = "https://www.myapp.com/system/food-grid/?RECORD_ID=[@field:RECORD_ID]"; } else (" [@field:TOUR_SITE_ID] " =7){ window.location = "https://www.myapp.com/system/food-grid/?RECORD_ID=[@field:RECORD_ID]"; } } </script>
  7. Thanks MayMusic. I'm not sure if that solution will work for my report. Kindly see the attached screenshot. If possible, I would like.... The hyperlink in the first column of HTML blocks, i.e. "Settle Solstice" should only visible when the SHIP NAME value is not OTC. The hyperlink in the second column of HTML Blocks i.e. "Settle OTC's" should only be visible when the SHIP NAME is OTC. The links lead to different URLs as the reports for Settling OTC's vs other SHIPs is quite different. Best, Ryan
  8. Hello! Looking for help with the following functionality with a tabular report. I have a tabular report with the field name of SHIP_NAME and two different HTML Blocks with hyperlinks to direct the user to different URLs/reports. What I'm trying to accomplish is to have only one HTML Block / Link visible based on the value of the SHIP_NAME field. If [SHIP_NAME] includes 'OTC', Hide HTML Block 1 If [SHIP_NAME] does not include 'OTC', Hide HTML Block 2 Caspio Support has directed me to the Forums for a script.
  9. In my application, each user has a profile which they can access / edit. Their placeholder profile image is an avatar and then they can edit/add a profile picture. Their profile image will appear in various places/pages on the app including the header menu, notes, and in their profile page. Query: I would like their picture to be automatically formatted to center, be circular in shape and add a border. I submitted a support ticket and the Caspio support agent pointed me to the forums for solutions. Many thanks.
×
×
  • Create New...