Hi Guys,
I need to retrieve a list of records from SQL tables and display it in a table in a forms. But i only wish to display those records status that is active. How do i achieve this using javascript?
I had attached a screenshot of my forms.
Hi Guys,
I need to retrieve a list of records from SQL tables and display it in a table in a forms. But i only wish to display those records status that is active. How do i achieve this using javascript?
I had attached a screenshot of my forms.
Hi Jason,
Do you need to use JavaScript for this? You could add another field to your form called "Record Status" and set the value to "Active", then specify this field in the "When" option in the lookup rule:
This will filter it to only include active records. You could even make the Record Status field a drop down so you can toggle between Active/Inactive records.
Cheers, Dan
Hi Daniel,
really appreciate your advise on this. It work perfectly. But i got another questions.
As you can see from my attachment. I'm thinking of adding a feature in the form to be able to delete a records / update the status for the records in this form. This will also require to update the database table as well.
Do you think is possible to achieve this?
Thank you.
The most direct way that I can think to do this is to have the submitted form trigger a Laserfiche Workflow that is configured to add to the DB.
Hi Bert,
yes you are right, i can trigger the workflow to either update the status / delete the records. Cause i use this method to add job into database. But my challenge here is current all these records are retrieve from database and display in a tables, how can i trigger a workflow from this table to delete / update the records?
please advise.
Thank you,
Hmm... I'm not sure this is really what forms was designed for, and there may be better ways of doing this in LF11 when it comes out. For now the most robust way I can think of is to have an "Update" column in your table that contains a drop down with the following values (or similar):
You could then retrieve the table in your workflow and use a "For each value loop" to go through each row, reading the "Update" column and taking the necessary action.
There are probably better ways to do it but there's my two pence worth!
Cheers, Dan
Hi Daniel,
Yes. I can create a dropdownlist column for each records. But how do i trigger workflow when i update the column? Cause there will be no submit button to trigger
Ah, that makes it a bit more tricky. In that case you would have to use JavaScript, probably to send an AJAX request to a server page. Unfortunately I don't know enough about this to comment further... Sorry!