Hi Team,
Was wondering if anyone know a way to customize what happens after you hit save save to draft and type in your email. Is it possible to change the thank you message? Or Run a workflow after this action, or redirect user to another link? I'm sure there has to be a file somewhere on the form server that has the code to this.
Thanks guys
Question
Question
Customize "Save to Draft" actions in Forms
Replies
You can change it. The file is drafts.cshtml under Views/Form. The relevant part is lines 55-59:
<div id="draft-confirm-box" class="cf-formwrap"> <div id=""> @Model.ThankYouMsg </div> </div>
@Model.ThankYouMsg is the message you see by default. It's basically a variable that's coming from inside the compiled application. There isn't an out-of-the-box way to change it (yet), but you can replace it with any valid HTML snippet you want. Back when we were still using drafts, we re-used the existing markup (which you can find by viewing the page source of the thank you page) and just changed the wording:
<div style="text-align: center;"> <div style="margin: 25px auto"> <h1 style="font-size: 150%; margin-bottom: 30px;">I love Laserfiche!</h1> <div>Your draft has been saved. <br><br>If you do not receive a link to the draft in an email, check your spam or junk folder.</div> </div> </div>
Result:
Note that you should back up the originals of any files before editing them like this. And when you do edit them, you should always document your changes because they can be overwritten when you apply patches or updates.
You can change what the draft email says from the Process Modeler.
Ahh Yes,
Sorry, I over looked that feature. That was just an example of why I wanted to find the code that programs the save to draft logic.
What I need to do in the end is either send out another email at the same time or run some code to write information into a database. I'd figured since these files are sitting server side, establishing a sql connection will be fine, I just need to know where to define my action.
Thanks!
The files that control the program's logic are compiled DLL files. You can't just open and edit them.
What exactly are you trying to do? If you give some details I can offer suggestions.
Thanks Ege,
So i'm trying to create a pseudo dashboard for public form users. Imagine a very simple page with a Applicant_Id field at the top and two html buttons below it with a status field next to each button that says "incomplete, in-progress, or complete".
Each applicant needs to fill out form 1 and form 2, so naturally, the link behind each button will redirect them to form 1 and form 2.
Since i'm trying to create a dashboard feel, in the javascript side, I want to dynamically set the link behind the button to their draft, if they choose to save as draft. I'll have a sql table that holds all Applicants IDs, and their button links, and will do a db lookup when the applicant ID field is filled in and then show the button and set the links behind them. At first, the button links in the sql table will be the general public form links, but if they save as a draft, I wan to update that link in the sql table with their draft link. Constructing a draft link is pretty simple, but i'll need their submission ID. So this is where my questions arise as, I've come up with 2 potential solutions
1. Write code to do actions when user types in email and saves as draft. Best action would be a direct sql update, but I considered sending another email because our share point can monitor emails and update sql tables on a set internal. (The more we discuss this the more I dont think solution this will work)
2. Have sql monitor the [Forms].[dbo].[cf_submissions] table for new rows, and if the action = "__SaveDraft" then I can have sql cross reference the submission ID with the [Forms].[dbo].[cf_bp_data] table in order to get the applicant ID and then update the necessary table/row with the submission ID that my forms lookup rule will pull from for the button coding. (This idea I came up with recently, but don't know enough about sql to know if it is doable)
Thanks Ege, I hope I make sense. Alot of customers been asking for a dashboard like feel for public forms and this was he idea we came up with. I'm sure there are many security issues we will have the handle, but will cross that bridge if we get that far.
Ege Ersoz, thanks for posting! I was madly scrambling to find where to change the Save as Draft email message today because I realized that something I had saved in the past was now being saved on all my new forms, since I began using that first one as a new starting point for all new forms.
Your view of where to make the change is an older view of LF Forms, however, it was enough to help me find where I needed to go to change mine. LF Forms 10.3 has an edit button further down rather than a tab at the top of that window:
Hi Blake,
Thanks for your reply. I always see you asking the good questions. I wasn't looking for out of the box. Just wanted to know if LF would share the location of the script that runs to display that thank you message. I naturally assume it is somewhere in this directory C:\Program Files\Laserfiche\Laserfiche Forms\Forms
Ege,
Thanks for the update my friend. You directions worked, I was able to check the message displayed. That is 1 step towards the right direction.
I was wondering if you had any more insight about some of the other things that happen in the background when choosing to save as draft. Do you know where the code that sends the email out is located? I'd like to see if I could alter that message or send out a second email at the same time. I know there was anther posting on answers for it, but no solution was presented there.
Thanks!