We have an invoice approval process built in Laserfiche Workflow (on premise, ver. 10.4) where we have a metadata field for vendor name. This is a list that is maintained manually through the Metadata Management portion of the Administration Console. I'm looking for a way to build a form that allows users in the Finance Department to submit new vendor names on their own and have it add it to the list. Right now I am the only one that maintains the list and I'm hesitant to grant access to the Administration Console for others to manage these vendors. We are aware we could have a field that does a database lookup for a vendor list but that's not going to work for us right now. Is there a way I can build this form, have it call a Workflow process that can insert the form submission as a new entry in the list? I'll also need to re-sort the list alphabetically like you can in the Administration Console (Sort Options/Ascending). Any ideas are greatly appreciated!
Question
Question
Building a form that can insert a list entry into metadata field
Answer
Direct modifications to SQL are not supported. Please use the Append List Choices activity in Workflow.
Replies
Hi Glenn,
I understand you being reluctant to provide User access to the Admin Console which in fact recommended for obvious security reasons.
I do believe that if you are maintaining a list for the Vendor Name as metadata, it should be okay for you having the same information in a db(table) to host these information on your SQL DB hosting your Laserfiche Repository. In doing so, you will be able to have an fields mapped as dynamic fields. (External table).
Then you can proceed with your form for the creation of new vendor added to the table. You will eliminate the hassle of maintaining a static list, sorting etc.
As a side note, just to make sure that you have a good vendor database, i would suggest before writing the vendor to the db, allow workflow to query the database to see if the vendor already exist and in the meantime lookup the vendor db to the form as lookup for maximum efficiency.
Thanks.
Hi Mahesh, thanks for your reply. As I stated in the initial question, we can't use an external DB connection to populate the vendor list...the particular reasons we cannot are a little too convoluted to discuss here, internal complications within the department. Therefore I have to maintain the vendor list in the manner that I originally described. I'm just hoping I can make it a little less labor intensive (it's not that much work but it would be much faster if they could just put the vendor name into a simple form field and click submit). I'm still hoping someone might know how to accomplish this?
Hey Glen,
It looks like the list values are stored in the [lup] table in your repository database. You could push the information directly into that table but doing things like alphabetizing might be difficult. And since this isn't a supported method of inserting data to field lists, you'll want to take backups of your environment early and often.
I know you said you can't use an external DB, but that really is the only good way to do what you need. Since you already have a SQL server on premises to host Laserfiche, you might be able to get away with adding a new DB to that server or even adding a simple table to an existing DB on that server for your dynamic field.
Direct modifications to SQL are not supported. Please use the Append List Choices activity in Workflow.
Miruna, thank you! This is what I was looking for on the Workflow side. The only thing I would need to do now is to somehow re-sort the list after it's appended so the vendors are listed alphabetically. I suppose that's what Brian was referring to above. There's no means that anyone knows of to do this without manipulating the database? If this is not possible currently I'd suggest LF looks into adding that as a function to the Append List Choices in a future release...it would be great to have this built in for my purposes here!
You can use an SDK Script activity to Sort your field list. In your workflow, after the Append List Field Choices activity, add an SDK Script activity. Add the following code to the Protected Overrides Sub Execute() and change YourListFieldName to the name of the list field to sort. You can even populate the ListFieldName value from a token if you want to.
Dim ListFieldName As String = "YourListFieldName" Try Dim fi As FieldInfo = Field.GetInfo(ListFieldName, RASession) Dim fil As FieldItemList = fi.GetItemList() fil.Sort() fi.SetItemList(fil) fi.Save() Catch ex As Exception WorkflowApi.TrackError(ex.Message) End Try
Bert, that worked! Thank you!
Miruna, thanks for your assistance as well. This community is always incredibly helpful. I built out a form and corresponding workflow in about 10 minutes and it all works beautifully. Thanks to all for your suggestions!