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

Question

Question

How to create 3 Form but 1 Process only

asked on June 24, 2021 Show version history

Hi Everyone,

I'm planning to create a 3 form, but 1 process only.

The scenario of the process will be like this.

1. User start a form, the form contains a 2 button to start a new form, this button namely, Create A New Client or Update the existing information of the client.

2. If the button for creating new is selected the form of creating a new will pop up, if they select/click the button to update the existing information of the client, the form of update existing information of the client will pop up.

3. For the update existing information on the client form, I would like to retrieve the previous information of a client into the form.

How I can do this 3 scenario?

See the image included in this question for more information about what I want to do on update existing information client form.

Hoping you can help me to create this form.

 

Cheers!

 

 

 

0 0

Replies

replied on June 24, 2021

Hello Rafael,

Your use case is a very common yet interesting implementation to be done. 

Let me just clarify one thing, as far as I know, you cannot open a new form from an existing form within a process unless that form is a completely different process that is started on that button click. Of course, this is an answer based on my experience. 

Nonetheless, what you can do is to play with your fields rules within the same form, in order to show and hide fields depending on what value you've chosen ( because you can always make your selection represented as radio buttons) or button you've clicked.

Now, if we were to take my approach to the use case, i would use one form by doing the following:

  1. Added all the fields that must be inserted in both cases under one form.
  2. created one radio button field that has 2 values:
    1. create new, under this option you can hide the fields that you want them to appear in case of an update, and show the ones you want. 
    2. update, in this case, you show the fields related to your update and hide the ones for creation.
  3. Bear in mind that depending on your case, some fields might not need to be hidden in both cases such as email address, contact number, name ext... you might need to add some JavaScript code to allow those fields to be reverted as read-only field to keep the users from adding any random values instead of the ones that must be looked up from the database (the source that you are reading from)
  4. the field you choose that will be the base of your lookup must be your reference. For example, in your case i assume the reference number is the unique identifier of each new creation. So :
    1. in case the user chose to create, this reference number must be filled automatically by the system indicating a unique creation.
    2. in case the user chose to update, this reference number must be added by the user in order to allow the forms lookup rule to read the value and fetch the necessary information from your database (source of information) and fill the remaining fields.
  5. You might wanna use some gateways within your process diagram to identify the operation's nature (Creation or updation). These gateways if used will use the values of the radio button ( having values like New and Update) in order to decide which route to take through the lifecycle of the process.
  6. Using the help of some javascript code, you can fill the table or collection values with the corresponding links as you mentioned in your question. Use Javascript ( or Jquery of course) to loop through the table row by row, access the column where you want yo insert the link of for each row and use the coding magic to replace the whole field with an <a> element and fill with the corresponding link. 
    1. link can be returned by your source to a hidden column on the same table.

    2. This hidden column can be accessed also using jquery to replace the field in question.

 

I Hope my explanation was helpful enough to get you started.

0 0
replied on June 24, 2021 Show version history

Hi Joseph,

 

Thanks for the reply.

 

I will try your suggestion about my process.

 

In addition, what Javascript (or Jquery) code I will be used?

 

Cheers!

0 0
replied on July 1, 2021

Hello Rafeal, 

Can you further explain your question ?

Regards,

0 0
replied on July 1, 2021

Hi Joseph,

 

May question is, you an example of your suggested Javascript (or Jquery)? from your 1st reply.

 

Regards,

0 0
replied on July 1, 2021
//Checking if the laserfiche lookup rule is completed before making any changes to ensure all data
//were retreived. 

$(document).on("lookupcomplete", function () { 
      //looping over each row of the table
      $('.class-table tr').each(function(){
        let vLink;
        let vInvoiceNumber;

        //column in the table that im trying to access on each row to retreive the document field link in laserfiche
        //generated from Laserfiche Workflow and inserted in a convenient database table 
        let vLinkField = $(this).find("td[data-col='q15']");
        let vInvoiceNumberField = $(this).find("td[data-col='q8']");
        
        vLink = vLinkField.find(".cf-field input").val();
        vInvoiceNumber = vInvoiceNumberField.find(".cf-field input").val();
        
        //Hiding the the field of the column where the link is returned from the database
        //The link can represent the link of the document is Laserfiche
        vLinkField.find(".cf-field").hide();

        //replacing the hidden field with a html division holding an a Element with the link inside
        vLinkField.append('<div class="cf-field"><a class="linkClass" href="" target="_blank">'+ vInvoiceNumber +'</a></div>')
        vLinkField.find(".cf-field a").attr("href",vLink)

      });      
      //$('.class-table .cf-table-add-row').detach();
            
});

The above is a portion of the code I wrote in order to replace each column field which has a link value returned from a lookup rule, to an actual link that can be clicked and redirected to Laserfiche Client to allow the user to check it.

Class names, variable names and function can be altered /added to suit your needs from the process.  

0 0
replied on July 1, 2021

Hi Joseph,

Thanks for the code.

This code that you shared with me, I need to edit it or it's good to use?

 

Regards,

 

0 0
replied on July 2, 2021

The overall idea of the code can be the same. but depending on your class names and variables some values must be editted. 

0 0
replied on July 3, 2021

Thank you Joseph, I appreciate your kindness for helping me on my project.

 

Cheers!

 

0 0
replied on July 3, 2021

Glad i could help! 

If you don't mind marking my reply as an answer it would be great 😊👍🏽 

Good luck on your project 

Cheers! 

0 0
replied on July 4, 2021

Thanks Joseph

0 0
replied on July 19, 2021

Hi Joseph,

Sorry, but it's hard for me to implement your code to may form, because I don't know what are the values to change  from your code and class names, variable names and function in my form field, because I don't know how to program.

Can you show me your created sample form for this code?

 

Cheers! 

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

Sign in to reply to this post.