DesiLogi

Caspio Guru
  • Content count

    137
  • Joined

  • Last visited

  • Days Won

    11

DesiLogi last won the day on October 24

DesiLogi had the most liked content!

1 Follower

About DesiLogi

  • Rank
    Advanced Member

Recent Profile Visitors

1,040 profile views
  1. 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?
  2. 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.
  3. 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...
  4. 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!
  5. 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
  6. Hi Vitalikssssss, I've posted the screenshot. As I said, I need the trigger to look up records in the same table as the Insert table, that have the same InvoiceID and CompanyID value, and then update the field 'Use This' to be 'False' (it's a Yes/No field). Thanks for any help you can give-
  7. Hi, I have a table that I need to update records related to the ID value when a new record is inserted. When a new record is created a field called 'InvoiceID' stores (via parameter passing) a value. That value might be used multiple times in the table (for example, this is a Payments table linked to an Invoice table. The InvoiceID (unique- one) from the Invoice table is stored (many) in the Payments table for each Payment record for the same invoice. So for 5 Payments records there might be InvoiceID=2 used 3 times and InvoiceID=4 used 2) . When a new record is inserted to the Payments table I need the trigger to look up all other records in that same Payments table with the same InvoiceID and update them. I tried using the Where tabs with Field=InvoiceID Equals Field=InvoiceID but the trigger doesn't work. If I manually put in a number for the 2nd InvoiceID to test it the trigger does work. So the issue is the trigger being able to match existing record's InvoiceID value with the submitted/inserted record's InvoiceID value and update them. Does anyone know how/if this can be done? It seems like it should be simple so I must be missing something basic..
  8. Hello, I have a Text field (64000) that is used to hold addresses with html markup. I need to use calculated fields to get each line's value for use in importing to another app that requires the address to be broken down to individual fields. For example, the value in the text field might be: Acme Building <br /> 22 Main Street <br /> Suite 33 <br /> Atlanta, GA 30308 I need it to take each line and put it in a calculated field: Calculated Field 1 = "Acme Building" Calculated Field 2 = "22 Main Street" Calculated Field 3 = "Suite 33" Calculated Field 4 = "Atlanta, GA 30308" There will always be a <br /> to break up the lines so I was thinking that might be used in the formula to delineate which lines are which. I have no idea of what the formulas would look like, though. Does anyone know how to do this? Many thanks!
  9. that's great- thanks MayMusic!
  10. I was using the long date for this very purpose. This shorter date format you posted might work fine for you or me (or most users) but my clients in the USA would complain and then if I changed it to fit USA then UK/AUS would complain. I've got a calculated field solution that's almost finished that I think will solve the issue. I'll post that when it's ready.
  11. Any ideas on how to make this work? The date formatting works right but it's repeating the lowest value @field:Items_ItemID date for every record in the results. I can't figure out how to make the code reset for each record. Something to do with var= divs line I think. Any insight would be greatly appreciated.
  12. Hi Vitaliksssss, Thanks for this code- I'm very much looking forward to trying to get it to work for my app. I'll need to use it on a lot of different kinds of datapages: tabular and detail especially. So far I can get it to read the authentication country and format the date differently. The problem is it is reading only the 1st record in the recordset and using that date for ALL results. It seems like it needs something sort of like target.[@field:myfield] to delineate records but I can't figure out how to put that in this code. This is what I have so far (I'm using 'Australia' for the Euro output): <div id="demo[@field:Items_ItemID]"></div> <script> var d = new Date('[@field:PurchaseOrders_PO_Date*]'); //short format should be used var options = { year: 'numeric', month: 'numeric', day: 'numeric' }; // output date only via digits if ( "[@authfield:Company_Country]" == "Australia") { var divs = document.getElementsByTagName("div"), item; for (var i = 0, len = divs.length; i < len; i++) { item = divs[i]; if (item.id && item.id.indexOf("demo") == 0) { item.innerHTML = d.toLocaleString("en-GB", options); // outputs date in UK format } } } else { var divs = document.getElementsByTagName("div"), item; for (var i = 0, len = divs.length; i < len; i++) { item = divs[i]; if (item.id && item.id.indexOf("demo") == 0) { item.innerHTML = d.toLocaleString("en-US", options); // outputs date in US format } } } </script>
  13. Sorry it took me so long to get back on this. When I say 'Host Page' I mean a 'flat' html page that I've put the Caspio deploy page onto. After much trial and error I've found a lot of 'best practices' with Caspio and one of them is to keep the web pages and navigation the datapages on as simple as possible (meaning not a lot of extras that require js and css as it really adversely affected the datapages a lot). Re bootstrap, from my understanding there's not a lot of reason to use it unless you also make the datapages responsive. My app is kind of huge and mostly used on a laptop or desktop (lots of data, needs big space) so I didn't make it responsive- except for a dedicated mobile version of some of the datapages so people could get it on their phone in limited ability. It's really a matter of prioritizing to what the users will actually be doing. Hope this helps a bit and good luck!
  14. I found the solution- really simple- if anyone needs it. Just remove the () after the url and it works fine.
  15. I've modified a Submit form datapage (accessed as a popup in a Fancy Box from a Tabular datapage) that normally closes and refreshes it's parent page (the tabular datapage). This is the code in the Destination section of the Submission datapage: <script> setTimeout(function(){ window.parent.location.reload();window.parent.jQuery.fancybox.close();}, 2000); </script> On the new Submit datapage I need it to go to a defined url (with parameters passed) but cannot get the code to work. I'm using: setTimeout(function(){ window.parent.location.href='../my-webpage?PID=[@field:PID]&PTID=[@field:PTID]'();window.parent.jQuery.fancybox.close();}, 2000); Does anyone know how to modify the second code so it directs to 'my-webpage' and also still closes the fancybox? Many thanks-