Jump to content

Jan

Caspio Evangelist
  • Posts

    635
  • Joined

  • Last visited

  • Days Won

    35

Everything posted by Jan

  1. Hello Stephen, It seems, I have answered in another topic Does it work for you?
  2. Hello Jess, You can create a copy of your Authentication and select the "Enable auto-login" checkbox, then you can assign all DataPages, where you want not to display Login Forms. It allows you to hide the login page of the copied Authentication, but if a user logs in with the main Authentication, he/she will see DataPages that are assigned with both Authentication. To hide Login form, edit your copied Authentication, add the "Header & Footer" element, select "Header", click the "Source" button and enter the following code: <div id="cb-auth-box"> Select "Footer", click the "Source" button and enter the following code: </div> <script> document.getElementById("cb-auth-box").style.display = "none"; </script> There is the article How to hide multiple Login forms, I have edited this solution to hide the Login Form always. I hope, it helps. Please feel free to ask details if my explanation is unclear
  3. Hi Stephen, If I understand correctly you and Barbara, you can enter the following code to your HTML Block: If you want to use a link: <script type="text/javascript"> var cb_boolean = [@calcfield:1]; if (cb_boolean>0) { document.write("<div style='margin:10px;'><a href='http://eu1.caspio.com/dp.asp?AppKey=cde830001d57b1a237854adab459&Stock_ID=[@field:Stock_ID]&Product_Description=[@field:Product_Description]' style='background:rgb(61, 130, 171); padding:7px 20px; border:1px solid rgb(221, 221, 221); border-image:none:color:rgb(255, 255, 255); font-weight:bold;text-decoration:none;white-space:nowrap;'>Create Shipment Request</a></div>"); } else { document.write("<div style='margin:10px;'><span style='background:rgb(61, 130, 171); padding:7px 20px; border:1px solid rgb(221, 221, 221); border-image:none:color:rgb(255, 255, 255); font-weight:bold;text-decoration:none;white-space:nowrap;'>Create Shipment Request</span></div>"); } </script> If you want to use a button: <script type="text/javascript"> var cb_boolean = [@calcfield:1]; if (cb_boolean>0) { document.write("<input type='button' value='Details' Name='mybutton' onclick='myfunction()'> "); } else { document.write("<input type='button' value='Details' Name='mybutton' disabled=true>"); } function myfunction() { window.location.href='http://eu1.caspio.com/dp.asp?AppKey=cde830001d57b1a237854adab459&Stock_ID=[@field:Stock_ID]&Product_Description=[@field:Product_Description]'; } </script> I hope, it helps )
  4. Hi simonponder, Maybe, cascading elements can help? If you select an item in the parent element, child elements are selected automatically. There are some more details in the article about LookUp tables. I hope, it helps.
  5. Hello Rolland, If I understand correctly, it can not be automated with Standard Features. Web Services API are available in Caspio.
  6. Hi MeganB, If I understand correctly, [@field:FIELDNAME] - is the value of the field on the Result page. You can use the Parameter Picker to add this parameter (the Data Source Field section) to a Calculated field.
  7. Hello Jess, It seems the answer in this post is similiar to yours. I hope, it helps.
  8. I had the same problem. I am not sure that it is the best solution, but maybe it will be useful. Firstly, I have grouped menu links in tags. The following code is the example for "Admin" links: <div id="menu_for_admin"> <a href="URL">first admin url</a><br> <a href="URL">second admin url</a><br> <a href="URL">third admin url</a><br> </div> Then I add tags for Authentication parameters and hide it with the "style="display:none" code. For example, for the admin role: <div id="is_admin" style="display:none">[@authfield:admin]</div> And then I have entered the script. Firstly, the script creates variables for every block, for example, for the admin block I have used the following code: var admin_menu = document.getElementById("menu_for_admin"); Then the script code that checks what is the role of the authenticated user, display her/his block and hide other. For example, for the "member" role I have used the following code: if (is_admin=="Yes") { admin_menu.style.display = 'inline'; member_menu.style.display = 'none'; guest_menu.style.display = 'none'; } else { NEXT ROLE } And now the whole code of the HTML page for three roles: <div id="menu_for_admin"> <a href="URL">first admin url</a><br> <a href="URL">second admin url</a><br> <a href="URL">third admin url</a><br> </div> <div id="menu_for_member"> <a href="URL">first member url</a><br> <a href="URL">second member url</a><br> <a href="URL">third member url</a><br> </div> <div id="menu_for_guest"> <a href="URL">first guest url</a><br> <a href="URL">second guest url</a><br> <a href="URL">third guest url</a><br> </div> <div id="is_admin" style="display:none">[@authfield:admin]</div> <div id="is_member" style="display:none">[@authfield:member]</div> <script type="text/javascript"> var admin_menu = document.getElementById("menu_for_admin"); var member_menu = document.getElementById("menu_for_member"); var guest_menu = document.getElementById("menu_for_guest"); var is_admin = document.getElementById("is_admin").innerHTML; var is_member = document.getElementById("is_member").innerHTML; if (is_admin=="Yes") { admin_menu.style.display = 'inline'; member_menu.style.display = 'none'; guest_menu.style.display = 'none'; } else { if (is_member=="Yes") { admin_menu.style.display = 'none'; member_menu.style.display = 'inline'; guest_menu.style.display = 'none'; } else { admin_menu.style.display = 'none'; member_menu.style.display = 'none'; guest_menu.style.display = 'inline'; } } </script>
  9. Hello alexeightsix, As far as I know, if you have assigned a DataPage with Authentication, and a user is not logged in, he/she will see the Login page of the Authentication. You can read more details about Authentications in the article or see the video.
  10. Hi Pearse, I have some additional questions before I can propose to a code Is it a Submission form? How does a user amend, for example, d1? I mean, if d1 is empty, it means a user does not amends it, and if the field contains any text, it means that user amends it. Is it correct?
  11. Hello spazz1421, There is also the article in the How To.
  12. Hi simonponder, Do you use Relationships and Views? If yes, please tell more details why these methods do not work and we will suggest better solutions. I hope
  13. Hello DataCobalt, I am not sure that I have found the best solution, but it seems, it works. You can use two Java Scripts. Add the following code to the Header of your DataPage: <SCRIPT LANGUAGE="JavaScript"> var site_URL = "URL_OF_YOUR_PAGE"; var is_it_reset = window.location.search; if (is_it_reset.indexOf("cbResetParam") > -1) { window.location = site_URL; } </SCRIPT> Please insert the correct URL of your site in format http://mysite.com And add the following code to the HTML block where the Reset button will be displayed: <input type="reset" value="Reset" id="reset_button"> <SCRIPT LANGUAGE="JavaScript"> function reset_data() { var site_URL = "URL_OF_YOUR_PAGE" + "?cbResetParam=1"; window.location = site_URL; } document.getElementById("reset_button").onclick=reset_data; </SCRIPT> Please insert the correct URL and make sure, that the correct sign is used in the "?cbResetParam=1" If parameters are used in your URL, it means, the "?" sign already present in the URL, then "&cbResetParam=1" If no parameters and no "&" signs is used, then "?cbResetParam=1" I hope, it helps!
  14. Hello DataCobalt, If I understand you correctly, you can use the following code: <SCRIPT LANGUAGE="JavaScript"> function ocPredefinedReports() { if (document.getElementById("cbParamVirtual1").value=='Recent (Within the last 10 days)') { var nDate = new Date(); var new_date = new Date(nDate.setDate(nDate.getDate()-10)); var d_month = new_date.getMonth() + 1; if (d_month<10) {d_month = "0" + d_month;} var d_day = new_date.getDate(); if (d_day<10) {d_day = "0" + d_day;} var d_year = new_date.getFullYear(); var str_date = d_month + "/" + d_day + "/" + d_year; document.getElementById("cbParamVirtual2").value=str_date; } else {document.getElementById("cbParamVirtual2").value="";} } document.getElementById("cbParamVirtual1").onchange=ocPredefinedReports; </SCRIPT> Does it work for you?
  15. Hi DataCobalt, Do you want to clear the data that has entered to fields and parameters? So, when a user clicks "Reset" he should see empty fields of the Search Page and all records of Results page?
  16. Hello DataCobalt, Then you can add two symbols to your JavaScrit: <SCRIPT LANGUAGE="JavaScript"> function concatenate() { var Employee_First_Name = document.getElementById("InsertRecordEmployee_First_Name").value; var Employee_Last_Name = document.getElementById("InsertRecordEmployee_Last_Name").value; var Employee_ID = document.getElementById("InsertRecordEmployee_ID").value; var Employee_Selector = Employee_Last_Name + ", " + Employee_First_Name + " - " + Employee_ID; document.getElementById("InsertRecordEmployee_Selector").value = Employee_Selector; } document.getElementById("caspioform").onsubmit=concatenate; </SCRIPT> If the Script code does not work, could you please provide the URL of your page or FoemElements of every field?
  17. Hello Parma2015, Please see the answer in another topic. I hope, it helps.
  18. Hi Jan, Let me try to write how you can work with your application. Of course, if I understand correctly, what is your goal. Three tables: The first table: tblAsset assetID (system ID; not for human use) assetName assetCode (your company's asset ID / serial number) Contains information about Assets. You have a Submission form to add new assets and a Report DataPage that allows to edit Assets on Details page. The second table tblProject projectID projectName projectAddress Contains information about Projects. One of projects is Vacant. You have a Submission form to add new Projects and a Report DataPage that allows to edit Projects on Details page. Users cannot delete neither Assets nor Projects. And the third table: tblAssignment assignmentID assetID projectID FromDate ToDate DaysOnProject You can create a View with these tables: viewAssignment First relation is tblAssignment.assetID - tblAsset.assetID tblAssignment.projectID - tblProject.projectID Please make sure that tblAssignment is selected as an editable table. * * * Fill tblAsset and tblProject tables. Create a Submission Form and add all Assets to the tblAssignment. For example, the Submission Form can contains next fields: assetID is a Dropdown, source is Lookup table; table is tblAsset; Field for display is assetName; Field for value is assetID. projectID is a Hidden, on load assign Default Value - the ID of Vacant Project. FromDate is a Hidden, on load assign System Parameter Timestamp. When a new Asset appears, it should be added to the tblAssignment with this Submission Form. * * * Create one more Search and Report DataPages, that uses view viewAssignment as a DataSource and manages Assets. On "Configure Search Fields" step, add tblAssignment_ToDate field and set Comparison Type "Is Blank" (you can set Hidden Form Element too). On the Result page, you can add fields: tblAsset assetName tblAssignment FromDate tblProject projectName On the Details page, you can add fields: tblAsset assetName - Display Only tblProject projectName - Display Only tblAssignment FromDate - Display Only Virtual Field 1 with label "Project" - Dropdown, source is Lookup table; table is tblProject; Field for display is projectName; Field for value is projectID; on exit pass [@projectID] tblAssignment ToDate - Hidden; on exit pass [@FromDate] tblAssignment DaysOnProject - Hidden Virtual Field 2 - Hidden, on load assign Data Source Fields - tblAsset_assetID; on exit pass [@assetID] Add the following code to the Footer of the Details page: <script type= "text/javascript"> function getT() { var prevValue='[@field:tblAssignment_projectID]'; if(document.getElementById("cbParamVirtual1").value != prevValue) { document.getElementById("EditRecordtblAssignment_ToDate").value = '[@cb:Timestamp]'; var v_sDate = '[@field:tblAssignment_FromDate]'; var v_eDate = '[@cb:Timestamp]'; var sDate = new Date(v_sDate); var eDate = new Date(v_eDate); var diff = new Date(eDate.getTime() - sDate.getTime()); var diffDays = diff.getUTCDate() - 1; document.getElementById("EditRecordtblAssignment_DaysOnProject").value = diffDays; } else return false; } document.getElementById("caspioform").onsubmit = getT; </script> On the "Destination and Triggers" step of the Manage DataPage, select "Go to a new page" and enter the page, where the following Submission Form is deployed: This Submission Form uses the tblAssignment table as DataSource; Three fields: assetID On load Receive value or parameter: External Parameter [@assetID] projectID On load Receive value or parameter: External Parameter [@projectID] FromDate On load Receive value or parameter: External Parameter [@FromDate] Add to Header the following code: <div align="center"> <p>Processing...</p> </div> Add to the Footer the following code: <script type="text/javascript"> if(document.getElementById("caspioform")) { document.getElementById("caspioform").style.display = 'none'; setTimeout('document.forms["caspioform"].submit()',1000); } </script> Now, when a user changes the Project, "ToDate" and "DaysOnProject" are recorded; then AutoSubmission Form creates a new Assignment. * * * You can create one more Search and Report DataPage, that uses view viewAssignment as a DataSource and allows to see History of Assets. I hope, it helps
  19. Hello Kirkman, I think, it is possible. General idea is: you create Virtual fields and then pass parameters to AutoSubmit DataPage. AutoSubmit DataPage add a new record, and passed parameters to itself again, while parameters are exist. Probably, you can add records to the table directly with API. But maybe it is a good idea to ask a Professional Service, if it works for you.
  20. Hello DataCobalt, As far as I know, it is impossible to use Autonumber of a record on a Submission Form, because the Autonumber is created only after the record is successfully created. You can use a Single Update Form and AutoSubmit to fill the Employee_Selector field. The idea is: 1) On the Submission Form a user enters Employee_First_Name and Employee_Last_Name on the "Select Fields" step, check the "On exit, pass AutoNumber ID field as parameter" checkbox on the "Destination and Triggers" step, select "Go to a new page" and select the page, where the Single Update Form is deployed. 2) On the Single Update Form on the "Single Record Update" step, enter [@InsertRecordEmployee_ID] as Parameter Name on the "Configure Fields" step, select the "Text Field" Form element for fields Employee_First_Name, Employee_Last_Name, and Employee_Selector Add Header&Footer element Add the following code to the Header element: <div align="center"> <p>Processing...</p> </div> Add the following code to the Footer element: <SCRIPT LANGUAGE="JavaScript"> var Employee_First_Name = document.getElementById("EditRecordEmployee_First_Name").value; var Employee_Last_Name = document.getElementById("EditRecordEmployee_Last_Name").value; var Employee_ID = [@InsertRecordEmployee_ID]; var Employee_Selector = Employee_First_Name + ", " + Employee_Last_Name + " - " + Employee_ID.toString(); document.getElementById("EditRecordEmployee_Selector").value = Employee_Selector; if (document.getElementById("caspioform")) { document.getElementById("caspioform").style.display = 'none'; setTimeout('document.forms["caspioform"].submit()',1000); } </SCRIPT> Now a user enters Employee_First_Name and Employee_Last_Name, then the user sees "Processing..." and the "Employee_Selector" value is added to the table. I hope, it helps.
  21. Hello DataCobalt, Maybe, you can use Lookup tables and Cascading drop-down lists to allow select the required Smith. Does it work for you?
  22. Hello AprilNAPO, So, on your Search page you have three Virtual fields - Search Phrase, Author, and Title. They pass parameters [@Phrase], [@Author], and [@Title]. On your Result page you have two fields - Author and Title. Please follow the next steps: 1) On the "Configure Filtering Fields" step add a Criteria for every field (click the "Insert" button and select "New Criteria"). Now the DataPage Elements is displayed like: Author Criteria 1 Criteria 2 Title Criteria 1 Criteria 2 2) Select Criteria 1 of every field and make sure, that they are the same: Contains [@Phrase] 3) Select Criteria 2 of every field and enter "their" parameter: Contains [@Author], Contains [@Title] Now the DataPage Elements should be like the following Schema: Author Criteria 1 Contains [@Phrase] Criteria 2 Contains [@Author] Title Criteria 1 Contains [@Phrase] Criteria 2 Contains [@Title] 4) Open the Logic tab. 4a) Make the main block "AND" 4b) Move all Criteria1 into the child "OR" block 4c) Move other Criteria in the child "AND" block The Logic tab should be like the following Schema: AND ORAuthor.Criteria1 Contains [@Phrase] Title.Criteria1 Contains [@Phrase] ANDAuthor.Criteria2 Contains [@Author] Title.Criteria2 Contains [@Title] I hope, it will work
  23. Hello Chad, As far as I know, Data Transfer is measured by day. Maybe, you can ask for some additional programming. Do you have the "User Log" feature in your account? I am not sure, if it works for you, but you can follow the next steps: 1) Create Authentications for every DataPage. 1a) Every Authentication uses the same table. 1b) On every Authentication, "Enable auto-login" is checked. It allows a user to enter credentials one time and then go through all DataPages without any additional log ins. 1c) Authentications are named by DataPages. Now User Log contains information like: 26 Jan 2015 05:33 PM user1 DP third 26 Jan 2015 05:33 PM user2 DP First 26 Jan 2015 05:32 PM user1 DP second 26 Jan 2015 05:30 PM user1 DP First Maybe it helps.
  24. Hello AprilNAPO, Sorry, I do not clear understand what is the expected result. If a user enters "Phrase", and "author", and "title" he will see all records where authors contains the "Phrase", and all records where title contains the "Phrase", and all records where authors contains the "author", and all records where title contains the "title" and so on. Is it correct?
×
×
  • Create New...