Learn how to create a custom toolbar within the ABBYY FlexiCapture Verification Station.
Hello. Today we're going to learn a little bit about stage tools within ABBYY FlexiCapture. And what we're going to do is, we're going to use these stage tools to add a custom toolbar to our verification station. So, that's what you see in front of me. I have the verification station in the front here and in the back I have our project setup station. So, what we're going to do is, we're going to just modify, and I'll open the project just so you can see it. We're going to open our invoice demo project, just to pick a random project here, and we're going to add a toolbar here, so that in verification, there's our own custom toolbar that we can modify and use for our custom work or development within our business process. That's what our goal is, and I'll show you how that's done here in this video.
The very first step in the video is, I want you to add a dot net reference to the system, that dot windows, dot form. The reason why we're doing that is because I'm going to be using a message box to report back some data to us and that's just what we need in order to do that. That's just, kind of, a heads up, and that is not needed to do every single stage tool, it's just for this specific demo. We're going to need it in order to perform a message box report back to us.
What we have is, we have stage tools and what we're going to do is, we're going to modify the verification stage. We're going to hit edit and then you can see here, we have different things that happen upon different events, and we can control, based on an event, when things happen and write our own script around that. In today's case, we're going to have both. We're going to have an event and then we're going to also have skin settings. The skin is what's going to change that user interface for us on the verification station.
I'm going to hit edit skin, and you can see here, we have toolbars and you can look at the help files and understand which toolbars these are, but if we look at our verification station, you can kind of guess which is standard, which is the navigation, which is the view, and these are the different toolbars that we have. So, what we want, is we want our own toolbar, and we're going to call this, maybe our custom toolbar. In the custom toolbar, you can rename, delete it, add another one if you'd like, but if we go over to commands, you can see we can actually modify that custom toolbar. We can say, create a new user command and we're going to call this one something, an intelligent name here, that says "show invoice number", and the tool tip will be "show invoice number". And, of course, you can obviously pick an icon, upload your own icon, or in this case, I'm just going to show the name on the toolbar.
I'm going to go ahead and hit okay. I'll go ahead and hit okay. So, the toolbar will actually just show this button. We're going to click that. We're going to back out of this and hit apply. Now, what happens is, when I double click, the first batch, or the first task, you can see now I have a new toolbar here, that says "show invoice number". The reason it's deactivated in this case is because we don't have an event that is meant to be triggered when that is clicked. So, what we're going to do is, we'll reject this real quick, and we'll head back to our project setup station, where we're going to, once again, modify the verification station. But, since we have the skin settings in place, we're going to add an event that's called on user command. Actually, I'm going to save this, just so that you see that is what enables this button here, so that's going to be the idea. The fact that we have a user command event is what's going to enable that. That way you can understand how that logic is placed there.
On user command, we're going to do something intelligent. Now, you can see we have a few objects, or arguments, that we can reference. The command ID is what tells us what specific button was pushed, so if we would have added multiple buttons, we would obviously be able to control that logic by using this on command argument that was passed to us. The other thing that's important to see is that we have the main window argument and this is really the object set that will get us deep into the document, or even the images themself. In this case, what we're going to do is, we're going to write just a script that is going to show us what the invoice number is for, or what the invoice number is on the document. You can see here, I'm just going to write a message box. Oops. Excuse me. And now I'm going to reference that main window object, and of course, as I hit the IntelliSense here, you can see we'll just get more information here for us. We can kind of start diving down into that editor window, so that we can get the current document and then, of course, we have our fields at that point.
And now, this is obviously just a demo video, but what you would do with a button is, you could reference this object with some intelligence to do something custom that you want to do in your organization. In this case, we're going to reference the invoice layout, and we'll look at the invoice number field. We'll say, give us the value and we should be good. Now, of course, what you always want to do when you do a script is, you just want to check the script and make sure that that is correct before we save it. So, now we're going to save it. We'll exit out of here, make sure we apply our changes and now when we go into the verification station, now that we've populated a script, you can see that I now have this button activated and so, if I dive into an object or a document here and I hit the show invoice number button, you can see here it's reporting back the invoice number, so you can see that there here. Obviously, you can reference any field on any type of document. The fact that this is an invoice and we're reporting the invoice number is really just for the purposes of the video.
That's how you can add multiple different pieces of logic. There's a lot of different ways we can customize the application to do what your business process wants and adding a toolbar is a very safe and common approach to doing that. It gives you the ability to make things very organized, so that you don't have to clutter up your document editor screen down here, where the user is actually performing modifications to the extracted data. I just wanted to show you real quick how you can add some custom toolbars and add some custom toolbar logic. Then obviously, that logic is based on what you need to do in your business process, but this is just a first step to get you dangerous enough to write that for you.
Hope you enjoyed the video. If you have any questions, we would love to answer them. Look forward to hearing from you. Thank you so much.