Scriptcase filter on click ajax3/19/2024 The last step is to code the event onValidateSuccess so that it inserts the payments that the user will have to make taking into account the months and the amount with interest to pay during that period. ![]() In the field so that it updates the data every time the number of months changes. ![]() The next step is to mark as required the fields: User, Amount and Months And as read-only the fields: Interest and Total (option located in Control -> Edit Fields). Īccording to the above the application will have 5 (five) fields, for this we click Control -> Fields -> “New Field”, enter the number of fields to create and click “Next”.įinally, we click on “Create” in order to save the configurations of each created field. Once we have these data the application will query the table Parameter and return the percentage of interest to apply for the amount of quotas selected and the total to be paid. The next step is to create the necessary fields for the user to enter their name, desired amount and number of installments. We create a Control application in order to add the fields we want to show the user and from which we will then carry out the process that will calculate how much the user will have to pay and how much he will pay each month including interest. Once inside our project in the Scriptcase, we create the connections that we will need to consult the table in PostgreSQL (conn_Parameter) and then insert into the MySQL table (conn Sales). Within the table “Parameter” we have the percentage of interest that the user will pay based on the number of months that he chooses in our application. The process that we will do will calculate the percentage of interest that the user will have to pay based on the amount desired and the number of installments (months) that he needs to pay back. The table “Parameter” in a PostgreSQL database. In terms of Database structure, we have two tables which are shown below: We will use the following Scriptcase Macros to make our work easier: ![]() On the other hand the user will enter some parameters and then complete the calculation and insert the result into the Database. The data processing that we will show as an example here is the one done at the Application level, to execute this example we will take certain parameters from the Database. Depending on how big the volume of data to handle are and the interaction that the user must have, one or the other may stand as the best option in some cases. I’d be happy to share the code if anyone wants to try to adapt it to their own use.Data Processing in Control Forms: Using Macros to query and insert into Databaseĭata processing can be done at the Database level (with Stored Procedures, Triggers, Functions and so on) or Application level. I either found it here on this forum or put it together from other sources online. I’m sure I didn’t come up with this myself - some of the comments in the code were definitely written by someone else. It uses the percentage to update the progress bar and displays the message below it. The first blank app refreshes every 250ms and it reads from the JSON array in the text file. “.csv”) to a JSON encoded array in a text file. On each loop the PHP in the second control runs a stored procedure on the SQL server to import the CSV, passing a filename parameter that is based on the dates in the array.ĭuring each loop, the second blank app writes the percentage complete and a message to be displayed on the screen ("Currently processing file ". ![]() The total number of files to be processed is the count of members of the array, so the current progress percentage is the counter divided by the total. In increments a counter each time it loops. The second blank app has a ‘foreach’ loop that goes through each date in the array that was passed from the original control. The control redirects to the first blank app which contains HTML/AJAX, and that calls the 2nd blank app that runs the PHP to do the task. That matches the date format in the csv filenames. So if the user selected 3/28 as the start and 3/30 as the end, the array would be ~. The onValidate of the control sets all of the dates between the start and end date in a global variable containing an array of each date. The use case is to loop through a set of daily csv log files and load the data into a temp table to do some database operations and display the results in a grid.Ī user selects a start date and an end date in a control application along with some other parameters that will be used to filter the data from the csv. I was able to do this using two blank applications.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |