Jump to content


Caspio Guru
  • Content count

  • Joined

  • Last visited

  • Days Won


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,186 profile views
  1. 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?
  2. 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.
  3. 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...
  4. 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>
  5. 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!
  6. 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.
  7. Hi MayMusic, Thanks for that tip- I hadn't thought about that and will give it a try. If I can show the number of signups and number of cancels over the month this way that'd be awesome. I'll post back on this thread about that-
  8. 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.
  9. Add Date to String in Formula

    Ah- that's great. Thanks Vitalikssss!
  10. 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-
  11. 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?
  12. Hi Vitaliksssss, Thanks for the help with the insert Update issue. That works well- I couldn't figure out how to get it to do that. Now the last thing I need to do is create a trigger for when the table is Updated (meaning the user updates an existing record's 'Use_This' to 'True') to update all records in the same table, with the same CompanyID and InvoiceID but NOT the same RequestID (the unique ID value)- because that would be the record being updated manually. Basically, so if a user marks one record's 'Use_This= True' then all other records in the same table (with same CompanyID and InvoiceID) are marked 'Use_This=False'. So there can be only one record with Use_This=True for any given InvoiceID. I think it would be similar to the first part of the trigger but running on Update. Problem is I keep getting 'Nested' error messages when I try to update the same table I'm running an Update trigger on. I think once I get the fundamentals worked out like in this issue the Triggers will make a lot more sense. Thanks very much for your help on this, I really appreciate it.
  13. One last question- I'm trying to set the field 'Use_This' to 'True' for the new, inserted record. I can't seem to get it to work using the Join method (the other part that sets Use_This to False works well). How can I set, still using this other part of the trigger, for the new record to have Use_This = True (I was thinking of Join Insert.InvoicePayRequest.RequestID = InvoicePayRequest.RequestID (the unique ID value) so that it updates only that specific record's Use_This to True. When I trie to do a simple 'Insert Into' I get a nested error message (attached). Surely there must be a way to make the new, inserted record's Use_This field always be True (while updating all the existing related records to False). Also, whenever a record is updated in that table it for some reason now runs the Use_This = False trigger action on itself. So if the user checks Use_This then the trigger runs and unchecks it, which it shouldn't because it should only run the trigger on records where RequestID <> RequestID (and therefor not itself). I really need some help with this...
  14. Hi Vitaliksssss, I didn't realize one could do a join to the same table as the insert. I used your method and it works great- many thanks!
  15. I got a workaround that doesn't use JS. In some ways this is quicker/easier to implement. Here it is if anyone wants it (thanks again for the above help- it's much appreciated). This is in a calculated field and references the 'Company_Country' authorization field to delineate which way to format the date. I have the 'Replace' clause there to remove the timestamp, which I don't want to show. CASE WHEN '[@authfield:Company_Country]' <> 'United States' Then CONVERT(CHAR(10),[@field:MyDate],103) ELSE Replace([@field:MyDate],' 12:00AM','') END