Skip to content

On demand · Product video

Create ad hoc quality tests in Quality Inspector

For quality teams that run most inspections automatically but still need to start a one-off test by hand.

Recorded May 31, 2023 · 10 minutes

Quality Inspector ad hoc tests video thumbnail

Summary

Quality Inspector can create a test when a person asks for one, alongside tests created automatically. The video starts with the permissions that control who can create tests manually and automatically, then creates a test from a purchase order line with no prompts, using the test generation rules to pick the template. It also creates tests from a quality inspection template and from the test list, choosing the record and lot number. Finally, it adds a Create Test action to the lot number information card two ways: with one line of code in an extension, and with a Power Automate flow.

Key topics

  • Set who can create tests manually and automatically
  • Create a test from a purchase order line, a template, or the test list
  • Add a Create Test action with one line of code
  • Create a test from a Power Automate flow
Read the transcript

We’re going to walk through a variety of different ways to create ad hoc tests, also called one-off tests or manual tests. This is when a person creates the test explicitly through an action, versus having the test created automatically through an indirect action. For example, if you wanted a test whenever something was posted, that would be an automatic action, versus clicking a button to create that test. You can combine ad hoc or one-off tests with automation. If your primary use case is automated tests, but you also need to create these one-off tests occasionally, you can definitely combine them.

The first thing to review is the permissions. If you navigate to Quality Inspection Permissions, you’ll see that you can refine who’s allowed to create tests manually and automatically. Again, automatically in this context means it’s done through an indirect action, and manually means it’s done by a user explicitly pressing a button.

The first way of doing it is on some forms. We ship with several actions out of the box for the primary use cases we tend to see. A good example is purchase orders. If we navigate to a purchase order and go to a line, we’ll see Quality Inspection and this option to create a test. We have these actions in a few spots throughout the system for the more typical examples. If you create a test here, you’ll notice it immediately creates that test, with no prompts.

Which test it decides to use is based on your rules. For example, we see here that it’s using the receiving template. If we take a look at the test generation rules on that receiving template, we’ve basically said that any purchase line at all, under any circumstance, uses this receiving test. If you wanted item-specific tests, you could configure that here by putting in the item number.

The other way of doing it is from the template itself. Instead of going through the document, we find the test plan we’re trying to execute. Let’s say we want to create an instance of this receiving example. We can use the Create Test action here. This is a little different, because now we need to choose what to connect it to. These are all the possibilities based on our configuration. We’ll tell the system to use the purchase line, then choose our record.

Since this is configured to look at purchase lines, it shows the available purchase lines in the system. We’ll choose an Athens desk, and if it were lot tracked or serial tracked, those fields would be choosable as well. We create that quality inspection test, and there’s our test.

Another way to create a quality inspection test is from an existing quality inspection test list. From here, you can create a test directly. The template defaults to whatever template you happen to have selected, and it’s the same general flow as the action from the quality inspection template. You choose your record. We’ll choose an item, an ethernet cord, and in this case the item is lot tracked, so we see how it opens up the lot number to be editable. Then we choose the lot number we’re creating this test against from the several lot numbers in my system, and it creates the test for that lot number.

So far we’ve created a test from the page itself, which is definitely the fastest way since it saves you a prompt, from the test list, and from the template. Now let’s say you want to quickly add an action to the system. There are two ways of doing it: one is through an extension, and the other is through Power Automate. We’ll go through both examples.

To have code that creates a test for you, acting similarly to the action we saw on the purchase order, it’s really one line of code. We have a codeunit for creating tests, and there are several options depending on what you have: a record ref, multiple variant records, a single one, and things of that nature. The easiest one is Create Test with a variant, because you can pass in whatever you have, whether it’s a record, a record ref, or a variant.

In this case, we’ve added this action to the lot number information card. We publish this, open any lot number information, and find our example Create Test action. It acts very similarly to the action on the purchase order subform. So with very low code, if there’s an action you need that’s not there out of the box, it’s still doable. In both the Power Automate case and this action, you’ll notice it still found the template the same way it did with the purchase order. You still had the template, and it had a test generation rule to help the system figure out which test to create under that circumstance.

The final way is with Power Automate. I’ve got an example called Create Test on Lot Number. If we edit it, we see it’s really two simple actions. You’d want Power Automate instead of a simple extension if you need to integrate with other workflows: maybe send a Teams message or an email, or do something where you’re integrating with external systems. If it’s really as simple as a button that says Create Test, with no other workflow associated with it, then that simple extension, a one-line method call, is probably the way to go.

All you’re doing is putting in the selected record and the page you want that action on. The action itself is inside your system, so I’ll connect this up to my system, choose Quality Inspection, and you’ll see there’s Create Test on Record. You pass in the system ID from the dynamic content for the selected record, and you’ll also see the table ID, so you put those in and save it. This creates the test behind the scenes. An important difference is that you can’t get that test opened immediately with Power Automate, because it’s all behind the scenes.

If we create that test on the lot number, it asks to run a flow. We run that flow, and it lets us know that it’s successful. Behind the scenes, this created a quality inspection test, and if we navigate back, we can see it. There’s the one we created earlier with a button, and there’s the one we created with Power Automate. So those are several different ways of creating tests ad hoc, one-off, or manually, and again, you can combine these with automation.

Questions about this webcast?

Send your question and the Insight Works team will reply by email. Ready to plan a project? Contact your Microsoft Partner.

Ask a question

Webcast Questions