Jump to content

DesiLogi

Caspio Guru
  • Content count

    152
  • Joined

  • Last visited

  • Days Won

    11

DesiLogi last won the day on October 24 2017

DesiLogi had the most liked content!

1 Follower

About DesiLogi

  • Rank
    Advanced Member

Recent Profile Visitors

1,274 profile views
  1. DesiLogi

    Bulk Edit Redirect on Update

    The last CB update broke the code I was using for this. Apparently, (document).ready doesn't work anymore. This is the code Caspio recommended to use now. It will select all records in the results and automatically open the Bulk Edit form. <script> document.addEventListener('DataPageReady', function (event) { if (event.detail.appKey == 'c2104000906ceabdc5f14cef8726') { setTimeout( function() { $( '#ToBulkDelete > input[type="checkbox"]' ).click(); $("[data-cb-name='BulkEditButton']").click(); }, 10 ); } }); </script>
  2. Hi Vitalikssss, Thanks for the tip- I know how to do that for a normal field. The question is for a field in an html tag (actually the footer but same thing basically) where you use [@calcfield:1%] to pull the result. That's where I need to make the percentage round to 0 decimal points.
  3. Hello, I've been trying to find a solution to this for awhile. Does anyone know how to limit/round the decimal places on a field and calculated field, over-riding whatever the setting is in the Localization. I need to do this because in some places I need the localization to show 3 decimal points for percentages and sometimes 0 decimal places (rounding whatever the value is). This is because I have multiple fields on the same datapage that use percentages for display and one needs 3 decimal places and the other needs 0. It makes it sloppy looking to always have .000 after the values for the field and/or calculated field that should normally so none. Thanks for any help.
  4. Hi Douvega, Thanks for the tip- I had tried firing the script on the change for the element and still had the same issue. I ended up changing the overall process and datapage for what I was doing and got a solution that way.
  5. Hi Greg, To do this use a Virtual field to get the calculated field's value. Set the Virtual field to Hidden and use the Default Value to get the calculated field's value. Then in the footer use this script: <script> var v_virta = document.getElementById("cbParamVirtualField").value; if(v_virta=="whatevervalue") { document.getElementById('section1').style.display = "block"; } else { document.getElementById('section1').style.display = "none"; } </script> The "v_virta" is getting the value of the virtual field and making it a variable so the js can use it. The 'if' section uses the variable (that comes from the virtual field, that itself comes from the calculated field) to decide what to do based on the value.
  6. Hello all, I have an Update datapage where, on Submit, I need to 1) show a popup message saying the changes were saved and 2) close the window or tab of the host page. I set the 'destination' of the datapage to 'Close Window' and put the below js in the footer to show the message. <SCRIPT LANGUAGE="JavaScript"> function myFunction() { alert ('Your updates have been saved') } document.getElementById("caspioform").onsubmit = myFunction; </SCRIPT> The problem is the js seems to block the 'Close Window' function and the page just refreshes to 'same form' and shows the standard 'data has been updated' message. So it seems to me I could put some kind of 'close window' function in the above js and put that in the 'message' section of the Destination wizard. I tried the below but it doesn't actually close the window/tab. <SCRIPT LANGUAGE="JavaScript"> function myFunction() { alert ('Your updates have been saved'); window.close(); } document.getElementById("caspioform").onsubmit = myFunction; </SCRIPT> Basically, I need, on Submit, the tab/window to close and a message to pop up saying data has been saved. Does anyone know how to do this?
  7. DesiLogi

    Show or Hide a div based on virtual field in html block

    Hi Douvega- the variable was gotten correctly for Virtual13's value, even with the capital 'D'. I did overlook that and changed it to lowercase 'd' but it did not fix the issue. As I've said, the variable is correctly saved, it's the other code that's not working in terms of show/hide the div. Hi ThirdCharm- thanks for the code on this. Only issue is the window.onload doesn't work with Caspio's new deploy code. Finally got this to work: I had another html block with a div 'Section1' in it and that was blocking this code from working. Totally overlooked it- it's a complicated datapage. But the code is working now. Thanks all for your help on this, sometimes one just has to dig in further to find the solution and advice like this always helps.
  8. DesiLogi

    Show or Hide a div based on virtual field in html block

    Hi MayMusic, Thanks for the tip- unfortunately I still can't get it to work. I checked to make sure the variable is reading the virtual field's value and it wasn't- so I changed it to document.getElementsByName("cbParamVirtual13")[0].value; and used an alert box to test it. Now it gets the virtual field value correctly so that's not an issue. I've used the code to show/hide a div before so I'm not sure what could be different here. The 'table' method didn't work either. Unfortunately I can't link to the page because it's heavily authenticated in the app. Maybe the quotes need to be singles? Not sure what to try...
  9. Hi, I have an html block in a Details page where I'm trying to show/hide a div based on the value of a Virtual field. The virtual field is set to Hidden and gets an Authentication value on load for data (a country name, in this case). I can't quite get the show/hide to work. I've used this code before and it works well so there must be some syntax mistake in this example. Does anyone have an idea with that might be? Thanks! <div id="section1">Print AUS Version</div> <script> var v_virt = document.getElementByID("cbParamVirtual13").value; if(v_virt=="Australia") { document.getElementById('section1').style.display = "block"; } else { document.getElementById('section1').style.display = "none"; } </script>
  10. Hello, I have some code running in the footer of an Update datapage that on change of one virtual field (Virtual 4: drop down) gets the value of another virtual field (Virtual 7: cascading text, with Virtual 4 as the ParentID) and copies that value of Virtual 7 into a text64000 field. The problem is it keeps getting the 'previous' value of Virtual 7 and not the current one, when Virtual 4 is updated. Meaning the code runs the 'copy' function BEFORE Virtual 7 is updated. I need to get the 'updated' data from Virtual 7 and copy that into the text64000 field. The code I'm using is: $("[name='cbParamVirtual4']").change(function(){ f_copy_print_address('cbParamVirtual7', 'cke_EditRecordShipToAddress'); }); So if there's some way to 'refresh' or 'update' Virtual 7 before the f_copy_print_address code runs that'd be great. Many thanks!
  11. DesiLogi

    How To Provide App Navigation

    Hi MayMusic, Just got the notification for this threat- it's been quite a while since I first posted it. Thanks for addressing this as I imagine a new Caspio user will need to know this. I ended up created navigation in a python project using standard html/css in Sublime Text. It worked really well to do that for all outside-of-caspio navigation.
  12. DesiLogi

    Calculated Field to get individual lines in Text Field

    Hi, Thanks for posting this but I'm not seeing this get the results I laid out and I'm not sure why. What's the calcfield:4 in your code for? In the initial query I put that I wanted to use calculated fields to get the results, so I need the code for each calculated field. I.E. calcfield:4 should show the words after the last <br /> (which would be City. State Zipcode). So what I need is formulas for: Calcfield:1 to show whatever text is before the 1st <br /> Calcfield:2 to show whatever text is between the 1st <br /> and the 2nd <br /> Calcfield:3 to show whatever text is between the 2nd <br /> and the 3rd <br /> Calcfield:4 to show whatever text is after the last<br /> I'm not sure what the 7 means in your code- the values will never have a fixed character length as they are addresses which will always be different. I think you've laid out the basic way to work this out but I can't seem to get it to do, in calculated fields, exactly what I've laid out above. It'd be great if you can look this over. Many thanks! EDIT: I got this to work for the 2nd line (calcfield:2 in my example) SUBSTRING( '[@field:add]', Len(SUBSTRING( '[@field:add]', 0,Charindex( '<br />','[@field:add]'))) + 7, Charindex('<br />', SUBSTRING( '[@field:add]', Len(SUBSTRING( '[@field:add]', 1,Charindex( '<br />','[@field:add]'))) + 7, LEN('[@field:Ship_To_Entity]')) ) ) When I try the 3rd line code it splits all the text up and doesn't choose between the <br /> parts. Since the 2nd one works it must be close to working for the other lines with a few tweaks.
  13. DesiLogi

    Add Date to String in Formula

    Ah- that's great. Thanks Vitalikssss!
  14. Does anyone know how to add a Date field's value into a text string, in a formula, where the other fields are text? The two different data types won't work together in the same formula and I need to add a date field's value to the end of a string of other fields. Thanks for the help-
  15. That's what I'd thought. So to be clear, if a record is updated in a table it's impossible to update another field in that record OR other records in the same table?
×