You are viewing limited content. For full access, please sign in.

Question

Question

How to display records that have active status in LF forms

asked on April 25, 2017

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.

Capture.PNG
Capture.PNG (71.02 KB)
0 0

Replies

replied on April 26, 2017

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

3 0
replied on April 26, 2017

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.

 

 

 

Capture.PNG
Capture.PNG (48.82 KB)
0 0
replied on April 26, 2017

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.

0 0
replied on April 26, 2017

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,

0 0
replied on April 27, 2017

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):

  1. Toggle Status (Active/Inactive)
  2. Remove Record

 

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

0 0
replied on April 27, 2017 Show version history

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

0 0
replied on April 27, 2017

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!

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.