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

Question

Question

Laserfiche forms Mult-line vs single line field using lookup rule

asked on January 22 Show version history

I'm going in circle trying to use lookup rules to retrieve data from a database source.  so far, i'm able to create a lookup rule to populate with single-line field, havent' been successful with a multi-line field.  however, when retrieving the results, there are multiple results where i want all of the notes to all be inputted in the lookup-field.  so far it's only letting me select 1 item instead of multiple or all items.  i found some javascript that might work but i'm having a hard time trying to get it to work.  what am i doing wrong?

 

0 0

Answer

SELECTED ANSWER
replied on February 5

using sql as a stored procedure worked.  i was able to use lookup rule to pull in all data in the format that i needed.  

0 0

Replies

replied on January 23

For your lookup rule, it sounds like you need a condition to narrow down your results.  Typically, you would use the value of another field to match with a row in SQL to pull back only a specific value.  How is your lookup rule setup?

0 0
replied on January 26 Show version history

so each row in sql is matched by sequence #.  currently i have my look-up rule that is set up to look like this, however we have notes that can go up to 20-30 lines.  i dont want to keep replicating 30 + rules.  is there an easier method to grab all of the notes and sort it by asc order according to the squence # when using a lookup rule?

0 0
replied on January 26

If you sequence number is an input of another field, you would use that field variable as your when and have it match the row in SQL.  This way you would not need have a lookup per sequence number.  How is the sequence number being selected on the form?

0 0
replied on January 26

since i couldn't get anything else to work, i created 10 boxes for sequence and 10 boxes for each line for comments.  so for example, my lookup rule is stated that if there's a call # and sequence 1, then line for notes 1 will appear.  2nd lookup, if theres a call # and sequence 2, then line for notes 2 will appear, etc... i went all the way up to line 10  (all of these boxes are hidden). 

 

although these sequence/line is for 1 paragraph for completed comments, not sure why the application is built on sequence/lines on each notes. 

 

i added a main field labeled completed comment (mult-line) box where i've Concatenate each sequence/line in asc order. so when i enter the call number, it'll capture each line by sequence.  the only problem i see here is if there's 30 or more lines.. then i'll have to recreate each line by a lookup rule.  was wondering if there's an easier way using jquery or JS

 

0 0
replied on January 28

How should the Call No and Sequence be input into the form?  Is a user putting in a number?  I see you defaulted the Sequence, can these not be entered manually and put in a table to add more than one Call and Sequence?

0 0
replied on February 5

 i did some digging around.  looks like lookup rules will only pull in 1 field at a time and not multiple from a datasource unless i add conditions to the "fill" statement. 

so looking at the data i want to pull in, the complete comment paragraph can range from 1 to even over 100+ lines for 1 comment.  I'm looking into creating a stored procedure using SQL to aggregate the lines then add that as a datasource to the forms.  

i read that we can then create a lookup rule and add that data source to the field to pull in the notes as a whole paragraph.  

have you had any experience using stored procedure?

0 0
SELECTED ANSWER
replied on February 5

using sql as a stored procedure worked.  i was able to use lookup rule to pull in all data in the format that i needed.  

0 0
replied on February 4 Show version history

I couldn't seem to write the correct js code for this.  so the only thing i came with is to aggregate these lines by sequence_no.  I created a set of numbers and a set for fields for the notes.  using a lookup rule, if the lookup rule sees sequence_no 1-10, it'll aggregate all of the notes in sequence_no from 1-10.

So my original inquiry was to see if there's a js method to aggregate these notes into 1 comment in sequence_no ASC without having to create so many fields?

 

 the example below has about 50 lines for 1 comment. to get it to flow into 1 paragraph, i have to create 50 fields and aggregate them in sequential order.  i have a rule that if there's sequence 1, then fill notes 1, if there's squence_no 2, then it fills notes 2.. etc... these boxes are hidden.  in the completed comment box (visible/not hidden), i have a rule that aggregate all of the lines in sequential order to make it flow like 1 full paragraph.

hope that make sense.

This is what the comment looks like in the application. we want the whole comment to use a lookup rule and transfer into laserfiche forms (in a multiple-line field):

 

 

same completed comment, Here's how it looks like using ssms:

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

Sign in to reply to this post.