Jump to content

kpcollier

Caspio Rockstar
  • Content Count

    390
  • Joined

  • Last visited

  • Days Won

    16

Everything posted by kpcollier

  1. Yeah, I haven't been able to find any other way other than a List DataPage. I too went with embedding the word document... but in the print out it was really funky. The entire datapage was small enough to only take up half of the PDF page, even with the List results set to 100%. I was trying to make it look right in the HTML block but noticed it was totally different in the PDF, so I was changing stuff all around to make it fit in PDF page. It looks all messed up in the HTML block, but its working fine. One limitation of a List DataPage is that you cannot edit a single record on the results page. Only bulk edit. I previously was trying to figure out a way to track what pages were downloaded/printed out. I was going to use a checkbox in the background that was clicked automatically when the DownloadDataButton was clicked, but I couldn't figure it out due to the inline edit.
  2. The way Caspio tells you to set up a multi step form leads to an app that looks outdated by 7 years. I have been trying to make a form that looks as if it was actually made in 2019. Here is what I have been working on. https://codepen.io/kpcollier/pen/gOOMBQe How can I get my datapages to work in this workflow? I am stuck on a few things: How to make the first step of the form 'submit' when you press the Next button. How to make the 2nd step of the form (single record update) pull up the just submitted record, also while that Next button was clicked. The ability to go back with a 'Previous' button. Of course, Caspio tells me that this is possible with their datapages but I need custom coding that will come at a $2,000 charge. Can anyone help me out with this, and if so recommend a way to make caspio multi step forms look good?
  3. I don't believe you can use cascading with a multi-select list box datatype. And, with regular list box, the multi select feature isn't included in Submission forms. I should have mentioned that I was using a sub form.
  4. I have a multi-select list box. This is used for configuring what type of glass shower you want. Most of these selections can work together - but there are a few combinations that I would like to limit the user from selecting. What is the best way to 'grey out' a selection based on already selected values in a list box? The Multi-Select Listbox field name is Shower_Layout, with the following options: Inline, Door Only, Door And Panel, Door + Multiple Panels, 90 Degree Return, Other Degree Return, Step Up/Notch, and Transom. In example, if the user first selects 90 Degree Return, I would like the 'Door Only' and 'Inline' to be non-selectable. I tried with JS, but I couldn't get anything to work. I need a little kickstart, please!
  5. I'm trying to think of a way to do this. I can do Bulk Edit on a List Report, which I think miiiiiiight work. I'm trying to make a script that, upon the click of the DataDownloadButton, opens the bulk edit and checks the Print_Checkbox with an auto-submit button, then opens up the PDF generator. I'll update this post with what I find out. *Edit I've pulled in a lot of information and different scripts to get this going on the right track. I think. I used DN31337 auto select all script for both selecting all records on the results page and also for clicking the Print_Checkbox. I then used another script I found here to click the the Bulk Edit button. I am now trying to get this all wrapped in a click event for when the Print/Download button is clicked. I was thinking I might create a fake button to overlap the download button, then have an auto-click script to click the actual print/download link after the bulk edit is done. //Needs to happen before Print Button Is Clicked //Automatically select all for bulk edit var check_all = document.querySelector(`[action*="[@cbAppKey]"] [type=checkbox][id*="HCB"]`); setTimeout(checker, 500); function checker() { check_all.click(); } //When Print Button Is Clicked Need wrapped in click event //Open Grid Edit automatically - changed for Bulk Edit function openBulkAutomatically(delay) { setTimeout( function() { var bulkEditButton = $("[data-cb-name='BulkEditButton']")[1]; if (bulkEditButton) f_dispatchEvent(bulkEditButton, "click"); }, delay ? delay : 500); } function f_dispatchEvent(v_element, v_type){ if(v_element.dispatchEvent) { //var v_e = new Event(v_type); var v_e = document.createEvent('MouseEvents'); v_e.initEvent(v_type, true, true); v_element.dispatchEvent(v_e); //new Event(v_type, {"bubbles":true, "cancelable":true}) } else if(v_element.fireEvent){ v_element.fireEvent('on' + v_type); } }; openBulkAutomatically(); //Afer Print Button Is Clicked //Click Printed Checkbox var check_print = document.querySelector(`[action*="[@cbAppKey]"] [type=checkbox][id*="EnableBulkEditPrint_CheckboxCkb"]`); setTimeout(checker, 500); function checker() { check_print.click(); } Right now, this script will select all records, bring up the Bulk Edit screen and select the printed checkbox as soon as the page loads.
  6. I only have one datapage, and it is a List Report. I never thought of the Inline Edit (which, I see now is probably effecting the way I am calling the checkbox element) because I didn't need it. All this page does is fill in a couple fields into a document to be printed - nothing is edited, and the only thing a user can do on this page is click on the print button. *Edit Now I am understanding this more. Since there is no inline edit, which I originally thought I didn't need, I cannot change the value of the checkbox. Alright, now this sucks. Lol.
  7. I've also tried this little guy, with no luck. Also no errors whatsoever in the console. document.getElementsByClassName('DataDownloadButton').onclick = function clickThis() { document.getElementById('EditRecordPrint_Checkbox').value = true; }
  8. @Fleshzombie, I think this would be easier with Triggered Actions. I have this setup for a lot of my apps using timestamps. You'll want to set this on an Update trigger. You'll want to set the block to UPDATE #inserted to make sure it is only going to set a timestamp for the record that was updated. You'll use the CASE block from Logic. In the WHEN section, use a AND block. Inside the AND block, you'll use 'Auction_Status equal Cancelled', as well as 'Timestamp is Blank' (more on this in a moment*). For the THEN part on the WHEN section, use the Account Timestamp field from the Date on the side toolbar. This is where it will stamp the current time. *In the ELSE section of the CASE block, set it to your timestamp field. The reason for this, along with the 'Timestamp is Blank' part, is to prevent users from corrupting this data. Without this, the Timestamp would be reset every time the Status was set to Cancelled. So, if someone wanted to fake the time is was actually cancelled, they could quickly just update the record's status to cancelled again to change the time. Setting ELSE to the timestamp field itself will prevent this. Picture below to show the setup.
  9. I'm trying to make a simple 'counter' style workflow on my page. It is a Letter Style page that is meant to be downloaded and printed out. What I am trying to do is differentiate what records have been printed and what records have not been. I've created a field in my table called Print_Checkbox that I was going to use for this. I wrote a little script trying to get it to work, however I freakin suck at this compared to you guys. I can't get it to work, but I feel it is something simple in my script that needs to be changed. var clickHere = document.querySelector('[id*=DataDownloadButton]'); // id of download button var pCheckBox = document.getElementById('EditRecordPrint_Checkbox'); // id of newly made Print Checkbox clickHere.onclick = function (){ pCheckBox.value = true; }; I don't get any errors in the console, but the checkbox is not being checked. Any help is appreciated!
  10. Thanks, @DefinitelyNot31337. I came into this project with it already done and with many problems - I am trying to fix it the best I can. I don't think the Client side and the Work Order side were originally made to work together, so they seem to be completely different. I have since changed the workflow so they both use first name and last name, and the same for Addresses. I was looking for an easy way and ended up just changing it to the way it should be. I'll keep this trigger info in the back of my mind, though. I appreciate it.
  11. I think it may have something to do with KeyUp event listener. Looking at the Console when typing in values leads me to think this. When I type in 1 for Hour and 10 for Rate, the Subtotal shows 11. Which, is because before I could type in the second 1 for 11, it added the first 1 to the subtotal. Making it 11. I believe this is also calculating when backspace is pressed. Also, it doesn't set back to null when the element value is empty. I have tried changing the event listener to input, and subtotal still isn't updating on deleted values. I am now trying to figure out if the subtotal event is being called on every input or not.
  12. Hey @Vitalikssssss, maybe you can help me out. When using this workflow, it works great if you do not make any mistakes entering in the values. However, if you enter in a value in Hours or in Rate, and then backspace to change it, the 'SubTotal' adds the previously inputted value with the newly inputted value. Sorry, it is hard to explain. But, say I start with 2 in Hours and 5 in Rate. The subtotal is 10, like it should be. But, if I change Rate from 5 to 6, it adds the 5 to the total and then the 6 to the total as well. So, changing 2 Hours 5 Rate (=10) to 2 Hours 6 Rate (=12) shows a subtotal of 22 (10 + 12), which should be just 12.
  13. Haha, wow. Your code looks SO nice, specially compared to the way I did it. Thank you @Vitalikssssss it works great.
  14. Thank you, @SunakoChan! I appreciate this. It was driving me crazy trying to get everything aligned right.
  15. Excuse the long ugly script. There is definitely a better way to write this out I am sure, but this is what I have for now. When all of the fields have a value, this script works. However, the Labor_Totals are all showing 'NaN' until each and every field in the script has a value. At the end, the Labor_SubTotal shows 'NaN' until every field has a value as well. We will very rarely use all of these Labor fields - but I need them there just in case. How can I get this script to work with only the fields that have values in them? function calculate() { var labrA = parseFloat(document.getElementById("InsertRecordLabor1_Rate").value); var labhA = parseFloat(document.getElementById("InsertRecordLabor1_Hours").value); var labrB = parseFloat(document.getElementById("InsertRecordLabor2_Rate").value); var labhB = parseFloat(document.getElementById("InsertRecordLabor2_Hours").value); var labrC = parseFloat(document.getElementById("InsertRecordLabor3_Rate").value); var labhC = parseFloat(document.getElementById("InsertRecordLabor3_Hours").value); var labrD = parseFloat(document.getElementById("InsertRecordLabor4_Rate").value); var labhD = parseFloat(document.getElementById("InsertRecordLabor4_Hours").value); var labrE = parseFloat(document.getElementById("InsertRecordLabor5_Rate").value); var labhE = parseFloat(document.getElementById("InsertRecordLabor5_Hours").value); var labrF = parseFloat(document.getElementById("InsertRecordLabor6_Rate").value); var labhF = parseFloat(document.getElementById("InsertRecordLabor6_Hours").value); var labrG = parseFloat(document.getElementById("InsertRecordLabor7_Rate").value); var labhG = parseFloat(document.getElementById("InsertRecordLabor7_Hours").value); var labrH = parseFloat(document.getElementById("InsertRecordLabor8_Rate").value); var labhH = parseFloat(document.getElementById("InsertRecordLabor8_Hours").value); var labrI = parseFloat(document.getElementById("InsertRecordLabor9_Rate").value); var labhI = parseFloat(document.getElementById("InsertRecordLabor9_Hours").value); var labrJ = parseFloat(document.getElementById("InsertRecordLabor10_Rate").value); var labhJ = parseFloat(document.getElementById("InsertRecordLabor10_Hours").value); var labrK = parseFloat(document.getElementById("InsertRecordLabor11_Rate").value); var labhK = parseFloat(document.getElementById("InsertRecordLabor11_Hours").value); var labrL = parseFloat(document.getElementById("InsertRecordLabor12_Rate").value); var labhL = parseFloat(document.getElementById("InsertRecordLabor12_Hours").value); var labrM = parseFloat(document.getElementById("InsertRecordLabor13_Rate").value); var labhM = parseFloat(document.getElementById("InsertRecordLabor13_Hours").value); var labrN = parseFloat(document.getElementById("InsertRecordLabor14_Rate").value); var labhN = parseFloat(document.getElementById("InsertRecordLabor14_Hours").value); var labrO = parseFloat(document.getElementById("InsertRecordLabor15_Rate").value); var labhO = parseFloat(document.getElementById("InsertRecordLabor15_Hours").value); var labT1 = document.getElementById("InsertRecordLabor1_Total").value = (labrA) * (labhA); var labT2 = document.getElementById("InsertRecordLabor2_Total").value = (labrB) * (labhB); var labT3 = document.getElementById("InsertRecordLabor3_Total").value = (labrC) * (labhC); var labT4 = document.getElementById("InsertRecordLabor4_Total").value = (labrD) * (labhD); var labT5 = document.getElementById("InsertRecordLabor5_Total").value = (labrE) * (labhE); var labT6 = document.getElementById("InsertRecordLabor6_Total").value = (labrF) * (labhF); var labT7 = document.getElementById("InsertRecordLabor7_Total").value = (labrG) * (labhG); var labT8 = document.getElementById("InsertRecordLabor8_Total").value = (labrH) * (labhH); var labT9 = document.getElementById("InsertRecordLabor9_Total").value = (labrI) * (labhI); var labT10 = document.getElementById("InsertRecordLabor10_Total").value = (labrJ) * (labhJ); var labT11 = document.getElementById("InsertRecordLabor11_Total").value = (labrK) * (labhK); var labT12 = document.getElementById("InsertRecordLabor12_Total").value = (labrL) * (labhL); var labT13 = document.getElementById("InsertRecordLabor13_Total").value = (labrM) * (labhM); var labT14 = document.getElementById("InsertRecordLabor14_Total").value = (labrN) * (labhN); var labT15 = document.getElementById("InsertRecordLabor15_Total").value = (labrO) * (labhO); document.getElementById("InsertRecordLabor_SubTotal").value = (labT1) + (labT2) + (labT3) + (labT4) + (labT5) + (labT6) + (labT7) + (labT8) + (labT9) + (labT10) + (labT11) + (labT12) + (labT13) + (labT14) + (labT15); } document.getElementById("InsertRecordLabor1_Hours").addEventListener("keyup", calculate); document.getElementById("InsertRecordLabor1_Rate").addEventListener("keyup", calculate); document.getElementById("InsertRecordLabor2_Hours").addEventListener("keyup", calculate); document.getElementById("InsertRecordLabor2_Rate").addEventListener("keyup", calculate); document.getElementById("InsertRecordLabor3_Hours").addEventListener("keyup", calculate); document.getElementById("InsertRecordLabor3_Rate").addEventListener("keyup", calculate); document.getElementById("InsertRecordLabor4_Hours").addEventListener("keyup", calculate); document.getElementById("InsertRecordLabor4_Rate").addEventListener("keyup", calculate); document.getElementById("InsertRecordLabor5_Hours").addEventListener("keyup", calculate); document.getElementById("InsertRecordLabor5_Rate").addEventListener("keyup", calculate); document.getElementById("InsertRecordLabor6_Hours").addEventListener("keyup", calculate); document.getElementById("InsertRecordLabor6_Rate").addEventListener("keyup", calculate); document.getElementById("InsertRecordLabor7_Hours").addEventListener("keyup", calculate); document.getElementById("InsertRecordLabor7_Rate").addEventListener("keyup", calculate); document.getElementById("InsertRecordLabor8_Hours").addEventListener("keyup", calculate); document.getElementById("InsertRecordLabor8_Rate").addEventListener("keyup", calculate); document.getElementById("InsertRecordLabor9_Hours").addEventListener("keyup", calculate); document.getElementById("InsertRecordLabor9_Rate").addEventListener("keyup", calculate); document.getElementById("InsertRecordLabor10_Hours").addEventListener("keyup", calculate); document.getElementById("InsertRecordLabor10_Rate").addEventListener("keyup", calculate); document.getElementById("InsertRecordLabor11_Hours").addEventListener("keyup", calculate); document.getElementById("InsertRecordLabor11_Rate").addEventListener("keyup", calculate); document.getElementById("InsertRecordLabor12_Hours").addEventListener("keyup", calculate); document.getElementById("InsertRecordLabor12_Rate").addEventListener("keyup", calculate); document.getElementById("InsertRecordLabor13_Hours").addEventListener("keyup", calculate); document.getElementById("InsertRecordLabor13_Rate").addEventListener("keyup", calculate); document.getElementById("InsertRecordLabor14_Hours").addEventListener("keyup", calculate); document.getElementById("InsertRecordLabor14_Rate").addEventListener("keyup", calculate); document.getElementById("InsertRecordLabor15_Hours").addEventListener("keyup", calculate); document.getElementById("InsertRecordLabor15_Rate").addEventListener("keyup", calculate);
  16. I have been trying to get a letter-style datapage to work. First, I was using Details page and found out PDF doesn't work there. So, I thought a List Results page would be the next best bet. When you view the datapage on preview or on a webpage, it looks full screen. I've made the height and width full. However, when I go to pull them for a PDF, they are shrunk to about a quarter size of the datapage. I pretty much want to take what is in the HTML block and make it the size of a piece of paper - we will be printing these out with Caspio data filled in. DataPage and Dependencies below. If anyone has the time to check this out for me, I would greatly appreciate it! CaspioData_2019-Oct-04_0826.zip
  17. Thank you, @Vitalikssssss! That worked great. I appreciate the help.
  18. I am having some problems trying to build a Letter-Style DataPage. I could easily make this in a Details DataPage, but I need to be able to download and print them via PDF. I have a Word document that I am trying to replicate in a datapage. I have tried this forum post about pasting from Word, however when I try using it with a List Results page, it looks nothing like my word document. It looks right in the WYSIWYG editor, but when you preview the page, the results are about a 5th of the page in height and construe the entire document. The Word document I am trying to replicate is attached. I need it to be like that, with Caspio data fields filling in the lines. If anyone has any idea how I can do this, I would appreciate the help. CGWOWord.docx
  19. I was using a script I found here that I modified a little bit to get working for my app. I am using a Virtual Field as a checkbox to copy the value of a Street Address. If the Billing Address is the same as the Job Address, clicking this checkbox will copy the Job Address contents over to the Billing Address. This was working fine until I had to switch the Job Address fields to Cascading Text Boxes. As some of you may know... using 'Special' elements in Caspio gives the element a dynamic class name, making it so you cannot call that element in a normal way. I tried to update my script to querySelector and still having trouble. If anyone could help me out with a workaround, it would be greatly appreciated! function f_address(){ if(document.getElementById('cbParamVirtual4').checked) { document.querySelector('#InsertRecordBilling_Address').value=document.querySelector('#InsertRecordPrimary_Address').value; document.querySelector('#InsertRecordBilling_City').value=document.querySelector('#InsertRecordPrimary_City').value; document.querySelector('#InsertRecordBilling_State').value=document.querySelector('#InsertRecordPrimary_State').value; document.querySelector('#InsertRecordBilling_Zip').value=document.querySelector('#InsertRecordPrimary_Zip').value; } else { document.querySelector('#InsertRecordBilling_Address').value=""; document.querySelector('#InsertRecordBilling_City').value=""; document.querySelector('#InsertRecordBilling_State').value=""; document.querySelector('#InsertRecordBilling_Zip').value=""; } } document.getElementById('cbParamVirtual4').onclick= f_address; Before, I was using getElementById for it all. Then I tried querySelector with both the '#' and ' . ' signs, getting an error that the virtual param couldn't be found. Those aren't special elements, I don't believe, so I switched them back to getElementById. Fixed that error, but now I get one again for 'f_address'.
  20. Thanks, @Andrew. What do you mean by split the Work Order submission form?
  21. It works the same as if you put just a space in Display and delete the space in Value. This gives the dropdown a 'blank' display by only showing the space, and the value is set to nothing since you deleted it in the configuration.
  22. You may be able to format these by using JS. I found this Stack Overflow link that is similar to this issue. The accepted answer may work, but the answer below it looks like it will cover all bases.
  23. I have a Client Table and a Work Order Table. The Work Order table has a form where you select a client, which provides that client information such as name and address, and says what work needs to be done. I am working on a workflow where if you're filling out a Work Order Form for a client that is not in the Client Table, a trigger will create a new record for that client. In the Client Table Form to manually add a new client, there are fields for First Name and Last Name and fields for Address, City, State, etc. There are also formula fields on the table level that concatenate these into one field - Full Name and Full Address. This is where my problem starts with this new workflow. When entering in new customer info on the Work Order Form, they enter in a full name and a full address. I need to be able to split up these values into multiple fields. In example, the Work Order Form will record a Full Name value, and I need the trigger to split it into First Name and Last Name. I could do this on the table level and make First and Last Name fields a formula, but then they are non editable and totally cancels out the way my Client Table form and Client Update form works. Tldr; I need to be able to create a formula in a trigger that will split a field into multiple fields, and I cannot do it on the table level because it makes those fields uneditable. If there is a better way, please let me know!
  24. Thanks @Vitalikssssss! I figured out how to do this with a trigger. However, I think I am going to try and take this a little bit farther. I'm going to try and make this workflow using an auto-submit page. The main goal now is trying to get a prompt to pop up upon form submission, asking if the user wants to create a new Client Profile for the user inputted. That way the user has some say in if the new client should be added or not. The hard part, once again, is the query to see if the record already exists in the table. I'll update this post with my findings!
×
×
  • Create New...