Jump to content

pwqehqhf32

Members
  • Content Count

    0
  • Joined

  • Last visited


Reputation Activity

  1. Like
    pwqehqhf32 reacted to jeffs88keys in Accessing Data Outside Of An Authentication   
    I have an app that records sales 40 different sales people.  Each person has access to their own sales reports and history based on an Record Level Security set to their "salesperson_id" field.
     
    Is it possible to calculate and store a ranking of each salesperson vs. their peers either at the agent authentication or at an admin level authentication?
     
    I think it would be best at the admin level to feed a table that can be drawn from at the agent level, but I'm not sure how to calculate and store the ranking data. 
     
    Thanks in advance.
  2. Like
    pwqehqhf32 reacted to caspio in JS: Show/hide A Custom Link On Results   
    JavaScript Solution: Show/Hide a custom link on results page based on a Yes/No field
    Feature Description:
    This JavaScript solution shows how to display or hide a custom link in HTML block on a results page of a Search and Report DataPage based on the value of a Yes/No field. A typical example is, to only display the custom "details" link if the field value "Yes".
    Implementation:
    This solution can be used "as-is", without any changes if
    a. It is used on a results page of a Search and Report DataPage.
    b. There is a Yes/No field named Approved in the table.
    To use this solution copy and paste the code below, inside the HTML block of the results page using the Caspio Bridge DataPage Wizard.
    <span id="cbLinkCtnr[@cbRecordIndex#]"></span> <script type="text/javascript"> /* 1 - get the Yes/No field */ var cb_boolean = '[@field:Approved]'; if (cb_boolean == 'Yes') { /* 2 - construct the custom link */ document.getElementById("cbLinkCtnr[@cbRecordIndex#]").innerHTML = '[url="http://www.google.com/"]Enter Google[/url]'; } </script> Tips for Customization
    a. To use this script with a different field name, modify the line immediately below comment 1 by replacing "Approved" with the appropriate field name.
    b. Customize the custom link in various ways. For example, to pass Unique ID field as a parameter in the URL, change the line of code immediately below comment 2 to:
    document.getElementById("cbLinkCtnr[@cbRecordIndex#]").innerHTML = '[url="http://URL&UniqueID=[@field:UniqueID]"]Custom Link[/url]'; Where URL is the real URL of the web page the custom link directs to.
    Tested Browsers
    This JavaScript solution was tested on the following platforms and Internet Browsers only.
    # MS Windows - IE 8.0, Firefox 3.6.3, Chrome 4.1, Safari 4.0.5
    # Macintosh - Firefox 3.6.3, Safari 4.0.3
    Disclaimer: Use these JavaScript solutions at your own risk! They are provided to assist you in the customization of your programs and while we believe they work properly, by using them you accept all responsibility about them and confirm that they are not a feature of Caspio's platforms and as such are provided "as is" without any warranties, support or guarantees.
  3. Like
    pwqehqhf32 reacted to caspio in JS: Concatenate/Combine two fields into one field   
    JavaScript Solution: Concatenate/Combine two fields into one field

    Feature Description:
    This JavaScript solution shows how to perform a function in a Submission Form to combine two fields' values and put them into another field. Values entered in two fields "Position1" and"Position2" are concatenated and the result is stored in the field "AllPositions" upon submission.

    Implementation:
    This solution can be used "as-is", without any changes if
    a. It is used in a Submission Form DataPage and
    b. The fields Position1, Position2, and AllPositions exist in your table and the form.
    c. The form is the only one Caspio DataPage deployed on your web page.

    To use this solution copy and paste the code below, inside the HTML Footer section of the Submission Form using the Caspio Bridge DataPage Wizard.
     
     
     
    <SCRIPT LANGUAGE="JavaScript"> function concatenate() { var position1 = document.getElementById("InsertRecordPosition1").value; var position2 = document.getElementById("InsertRecordPosition2").value; var allpositions = position1 + position2; document.getElementById("InsertRecordAllPositions").value = allpositions; } document.getElementById("caspioform").onsubmit=concatenate; </SCRIPT> Tips for Customization
    To customize this script to be used on an Update Form or a Details page of a Search and Report DataPage, replace the prefix "InsertRecord" with "EditRecord" in the code.

    Tested Browsers
    This JavaScript solution was tested on the following platforms and Internet Browsers only.
    # MS Windows - IE 8.0, Firefox 3.6.3, Chrome 4.1.249, Safari 4.0.3
    # Macintosh - Firefox 3.5.7, Safari 4.0.3

    Disclaimer: Use these JavaScript solutions at your own risk! They are provided to assist you in the customization of your programs and while we believe they work properly, by using them you accept all responsibility about them and confirm that they are not a feature of Caspio's platforms and as such are provided "as is" without any warranties, support or guarantees.
  4. Like
    pwqehqhf32 reacted to AdamH in Need Javascript To Perform A "timestamp Check" On Submission To Create One-Time-Use Form   
    I have a Single Record Update form where once a user has submitted data on Record #123, I want any other users subsequently trying to update Record #123 to be "locked out" from submitting via that form.
      In other words, I need to be able to disable a form after it's been used once, or when Some_Field = Whatever.   You could just disable it with Rules, but if 2 people arrive on the form before either has submitted, then the 2nd User rewrites over the 1st User's data. I need to prevent that from happening.   Caspio Support recommends:  In order to prevent the next users to submit/edit the same record, the "timestamp check" should be done upon form submission. A solution would be to write a JavaScript function to perform the "timestamp check" and then call the function on the form submission event.    Can anyone please assist with this? I'm JavaScript illiterate. Thanks!
  5. Like
    pwqehqhf32 reacted to docmgt in Authentication Logouts - Windows 7/IE9 vs. Windows XP/IE8   
    Hi all,
    I'm deploying Caspio Bridge on an Intranet. For datapages that include a secondary details link - we consistently experience authentication errors with IE - depending on the OS or browser version. For Windows 7/IE9 - I get booted out; XP/IE8 - I can get to detail pages fine.
    Has anyone else encountered this? Using Chrome and Firefox - I do not get a boot out issue for detail links - HOWEVER, because we link to files on a server for the intranet - the preferred browser must be IE. The plugins for Chrome/Firefox don't correct our file linking.
    I don't want the end user experience to be bad - having to use 2 browsers is not acceptable. Any suggestions?
  6. Like
    pwqehqhf32 reacted to caspio in JS: Select multiple values from a listbox in a WebForm   
    JavaScript Solution: Select multiple values from a listbox in a Submission Form

    Feature Description:
    This JavaScript solution shows how to enable the selection of multiple values from a listbox form element in a Submission Form DataPage.
    Multiple values in a listbox can be selected by holding the Ctrl key on the keyboard while clicking on the required values simultaneously.
    When the form is submitted, the values selected in the listbox are recorded as a series of all selected choices separated by commas.

    For example, assume that a listbox named States in a Submission Form contains names of all the different states in the United States.
    If the following three states California, Nevada and Oregon are selected in this listbox, the value stored in that field will be "California,Nevada,Oregon".

    Implementation:
    This solution can be used "as-is", without any changes if
    a. It is used in an Submission Form DataPage and
    b. The listbox field to enable multiple selection is called States.

    To use this solution copy and paste the code below, inside the HTML Footer section of the DataPage using the Caspio Bridge DataPage Wizard.
    <SCRIPT LANGUAGE="JavaScript"> document.addEventListener('DataPageReady', assignMultiple); function assignMultiple() { /* "fieldName" is the variable name for the listbox type form element field. */ let fieldName = "InsertRecordStates"; let x=document.getElementsByName(fieldName); x[0].multiple=true; } </SCRIPT> Additional Considerations
    To use this script with a field not named as States, change all occurrences of the text States in the script to the appropriate field name. If the States field is used in the Search page of a Report DataPage, configure it as a Text Field with contains as its comparison operator. Only then, a search initiated with even one of the three state names will return all records where those state names are found, including those containing multiple state names.
    Tested Browsers
    This JavaScript solution was tested on the following platforms and Internet Browsers only.
    # MS Windows - IE 11, Firefox 74.0, Chrome 81.0, MS Edge 42.0
    # Mac OS - Firefox 74.0, Chrome 81.0, Safari 13.1
    # Android - Firefox 74.0, Chrome 81.0
    #iOs - Firefox 74.0, Chrome 81.0, Safari 13.1

    Disclaimer: Use these JavaScript solutions at your own risk! They are provided to assist you in the customization of your programs and while we believe they work properly, by using them you accept all responsibility about them and confirm that they are not a feature of Caspio's platforms and as such are provided "as is" without any warranties, support or guarantees.
  7. Like
    pwqehqhf32 reacted to caspio in JS Guide: Caspio Form Elements   
    JavaScript Tips: Caspio Form Elements
     
    JavaScript is a client-side scripting language that is commonly used in HTML pages. JavaScript can be used in Caspio Bridge DataPages to extend capabilities outside the standard features. This page provides a guideline for referencing Caspio form elements using JavaScript. It is an advanced topic and you should have prior knowledge of JavaScript programming.
     
    Referencing Caspio Form Elements
     
    A common way to access a form element using JavaScript is by referencing the element's ID attribute using:
              -   document.getElementById("id")
    The value in the field can be referenced using:
              -   document.getElementById("id").value
    In the following sections, we will list the ID attributes for Caspio form elements in various DataPages.
     
    Submission Forms
    Text Field/Text Area/Dropdown/Checkbox/Listbox/Hidden:           -   InsertRecordFIELDNAME
              -   FIELDNAME should be replaced with your field name.
              -   For example: document.getElementById("InsertRecordFirst_Name")
    Radio Button: A radio button includes multiple options and each option has an associated ID. The ID is a name followed by a number:           -   InsertRecordFIELDNAMEX
              -   X is the radio button option order, which starts at 0 and increments based on the order of each radio option.
     
             For example if your radio button has three options: Red, Blue, Green
              -   Red is InsertRecordFIELDNAME0
              -   Blue is InsertRecordFIELDNAME1
              -   Green is InsertRecordFIELDNAME2
    Virtual Field: cbParamVirtualX           -   X is the virtual field in the form, which starts at 1 and increments based on the number of the virtual fields in the form.
              -   For example: document.getElementById("cbParamVirtual2") is referring to the second virtual field.
    Cascading Dropdown: Cascading dropdown and its parent dropdown are referenced by name since the ID changes on every page load. To reference cascading dropdown and its parent dropdown, use the following format:           -   document.getElementsByName("InsertRecordCompany_Name")[0]
              -   Note that in the above format, the number 0 never changes.
    Display Only: These are not fields but span tags, therefore they don't have an ID. Details and Update Forms
     
    Details and Update Forms use the same rules and naming conventions as Submission Forms (in previous section), except that InsertRecord is changed to EditRecord.
              -   EditRecordFIELDNAME
              -   For example: document.getElementById("EditRecordFirst_Name")
              -   Note that Virtual Fields and Display Only rules are the same as Submission Forms (in previous section).
     
    Search Forms
    Text Field/Text Area/Dropdown/Checkbox/Listbox/Hidden:           -   ValueX_Y
              -   X is the form element order, which starts at 1 and increments based on the order of the element in the form.
              -   Y is the criteria. It starts at 1 and increments based on the criteria order. It is always 1 if the field has no extra criteria.
    Radio Button: ValueX_Y[Z]           -   Z is the radio button option order, which starts at 0 and increments based on the order of the each radio option.
    Virtual Field: The rules are the same as Submission Forms (in previous section) Cascading Dropdown: This element should be referenced by name as explained in the previous section. The name of the element is ValueX_Y. Distance Search By ZIP/Postal Code:           -   Center of Search: cbDsField1
              -   Distance: cbDsField2
    Distance Search By Coordinates:           -   Center Latitude: cbDsField1
              -   Center Longitude: cbDsField2
              -   Distance: cbDSField3
     
    Authentication/Login Forms
    Text Field: xip_FIELDNAME           -   FIELDNAME should be replaced with your field name.
     
     
    Referencing Forms
    To access Caspio Forms/DataPages, you can reference the ID using:           -   document.getElementById("caspioform")
     
    Note that all Caspio DataPages share the same id as "caspioform". Therefore if there are multiple DataPages deployed on the same page, you need to reference them in a different way such as:
     
              -   document.forms[X]
     
    X starts at 0 which refers to the first form on the page and increments based on the order.
     
    To access Caspio Authentication or Login Forms, use:           -   document.getElementById("xip_DataSourceName")
              -   Replace "DataSourceName" with the name of data source used in your Authentication.
     
     
    Referencing Buttons
    Submit Button: Submit Update Button: Mod0EditRecord Delete Button: Mod0DeleteRecord Search Button: searchID Back Button: Mod0CancelRecord Login Button: xip_datasrc_DataSourceName           -   Replace "DataSourceName" with the name of data source used in your Authentication.
     
    Where to Place the JavaScripts
     
    In Forms, place your code in an HTML Block. The HTML Block should be the last element in the list.
     
    In Results, place the code in the Header or Footer unless you want the code to be executed for every record.
     
    Quick Tips
     
    If you need to reference an element that is not listed in the above document, try using F12/Developer Tools available from most browsers such as IE, Firefox, and Chrome. Developer Tools help web developers inspect the elements on the web page to find the related ID and also debug JavaScript code if necessary using the Console tab. For more information, check online for available tutorials using your browser's Developer Tools.
    In the meantime, you can see examples of JavaScript solutions in the community forum.
  8. Like
    pwqehqhf32 reacted to caspio in JS: Multiselect Listbox In Update Datapage   
    JavaScript Solution: Select multiple values from a listbox in an Update DataPage
     
    Feature Description:
    This JavaScript solution shows how to enable the selection of multiple values using a listbox form element in an Update or Details DataPage.
     
    When the DataPage is submitted, the values selected in the listbox are stored in the table as a comma-separated string.
     
    For example: A field named state in a table contains US states. If three states California, Nevada and Oregon are selected in this listbox, the value stored in that field will be "California, Nevada, Oregon".
    When the DataPage is opened, the current values will be preselected in the listbox.

    Implementation:
    This solution can be used "as-is", without any changes if
    a. It is used in an Update or Details DataPage and
    b. The field name state exists in the DataPage.

    To use this solution, copy the code below and paste inside the HTML Footer section of the Update/Details DataPage using the Caspio Bridge DataPage Wizard.
     
    <script type="text/javascript">  var v_state = "[@field:state]" ;  var o_state = document.getElementById("EditRecordstate") ;  o_state.multiple = true ;  function f_listbox() {   if ( v_state.indexOf(",") > 0 ) {    for (var i=0 ; i < o_state.options.length; i++ ) {     if(o_state[i].value == v_state) {      o_state.remove(i);      break ;     }    }    var o_st = v_state.split(", ") ;    for (var j=0 ; j < o_st.length; j++) {     for (var i=0 ; i < o_state.options.length; i++ ) {      if(o_st[j]== o_state.options[i].value){       o_state.options[i].selected = true ;       break ;      }      }    }   }  } document.addEventListener('DataPageReady', f_listbox); //You can also use the line below instead of the eventlistener // setTimeout(f_listbox, 20); </script>  
    Tips for Customization
     
    To customize this script to enable the same feature for the additional field, duplicate the first three lines using your second field name. Then duplicate the code inside the f_listbox function.
     
    Tested Browsers
    This JavaScript solution was tested on the following platforms and Internet Browsers only.
    # MS Windows - IE 10, Firefox 25.0.1, Chrome 31.0.1650.57, Safari 5.1.7

    Disclaimer: Use these JavaScript solutions at your own risk! They are provided to assist you in the customization of your programs and while we believe they work properly, by using them you accept all responsibility about them and confirm that they are not a feature of Caspio's platforms and as such are provided "as is" without any warranties, support or guarantees. 
  9. Like
    pwqehqhf32 reacted to supra01 in API in JAVA   
    How to integrate the web service profile in Caspio Bridge and integrate it with Java API. Do we have to download Eclipse and Tomcat in our local system, configure everything and then use WSDL to call my Caspio account.
    Please advise.
×
×
  • Create New...