Using the CreateCustomer function in the standard library's LibrarySales codeunit (130509), our CreateCustomer creates a useable customer record and makes this helper function a straightforward exercise. Have a look at the following code:
local procedure CreateCustomer(var Customer: record Customer)
begin
LibrarySales.CreateCustomer(Customer);
end;
As with the LibraryUtility variable, we will declare the LibrarySales variable globally.
You might wonder why we create a helper function that only has one statement line. As we've already mentioned, using helper functions makes the test readable for non-technical peers, and makes it reusable. What we haven't mentioned is that it also makes it more maintainable/extendable. If we need to update the customer record created by the CreateCustomer function in the Library - Sales codeunit, we only need to add that to our local CreateCustomer function.