Approval Button
- jennifer.eckard
- Posts: 11
- Joined: Fri Aug 11, 2017
I want to create a button that updates a outcome field and then save the form similar to the article
http://formsdesigner.blogspot.ru/2014/0 ... point.html
However I am using a custom list and I am not using task I have a custom list that has several forms for each approver and I want a button that sets the outcome field to Approved and then saves the form. Any help would be appreciated.
http://formsdesigner.blogspot.ru/2014/0 ... point.html
However I am using a custom list and I am not using task I have a custom list that has several forms for each approver and I want a button that sets the outcome field to Approved and then saves the form. Any help would be appreciated.
- Nikita Kurguzov
- Posts: 889
- Joined: Mon Jul 03, 2017
So, you just need button that changes one field and then saves the Form? That should be fairly simple. You can just add a button and set OnClick function to change one field and click Save after it. Depending on the type of Field, the code might be different.
Here is my example. In my case, I have Yes/No field as Approved field, but you can use Choice, Lookup or anything else you need. You will just need to modify code for the correct field. This page might be useful to find the correct code to change the value of your field.
First, I've designed the Form and added my Approved field. I've also added display: hidden; to Style block of my Approved Field: Next, I've added default buttons to the Form, like Save and Cancel by clicking Buttons on top of the designer. I've added my own custom button, matched its style to the style of default buttons and finally added this code to change value of Approved field to true and to save the Form after it (here's where you might need to change first line to something else, in case it's not Yes/No field):
And that's it, nothing more. Let me know if it works for you or if you have any questions on how to do it in your case.
Here is my example. In my case, I have Yes/No field as Approved field, but you can use Choice, Lookup or anything else you need. You will just need to modify code for the correct field. This page might be useful to find the correct code to change the value of your field.
First, I've designed the Form and added my Approved field. I've also added display: hidden; to Style block of my Approved Field: Next, I've added default buttons to the Form, like Save and Cancel by clicking Buttons on top of the designer. I've added my own custom button, matched its style to the style of default buttons and finally added this code to change value of Approved field to true and to save the Form after it (here's where you might need to change first line to something else, in case it's not Yes/No field):
Code: Select all
fd.field("Approved").value(1);
fd.save().click();
Cheers
-
- Information
-
Who is online
Users browsing this forum: No registered users and 7 guests