B1 Usability Package Sample
Date:04/10/2016
Line Loop – Samples – Select multiple Invoices in Incoming Payment
Window according to specific values.
Summary
Module Universal functions
Level Advanced
Requirements B1UP 2015.08 or higher
Description
This sample will show you how to automatically select multiple documents in the Incoming Payment
window based on the values user put on User-Defined fields.
PreRequisites
1. Create two User-Defined fields: one for AR Invoice Number and one for AR Down Payment Invoice
for users to input the values. Then system to loop and find and select the relevant documents.
You can choose to move these UDFs to the main window or not. In this example we have moved
it to the main window’s footer.
Copyright 2011 – Boyum IT A/S Page 1
B1 Usability Package Sample
2. Create a button on the Incoming Payment Window called ‘Find Invoice’
B1 Validation Configuration
We will first create a Validation that triggers every time when user presses the ‘Find Invoices’ button.
We don’t need to put any condition here because the condition will be written within the Macro for
the Line UF.
NOTE: Please remember to uncheck Ignore last line and select ‘No Condition’.
Copyright 2011 – Boyum IT A/S Page 2
B1 Usability Package Sample
Universal Functions
Then in the Line UF we create the following Macro with the Built-in Condition
The syntax for the Marco is as follows:
IF(($[$20.1.0]=$[$BOYX_2.0.0]) OR ($[$20.1.0] = $[$BOYX_1.0.0]))
//if Document number is equal to the value in the two UDFs AR Invoice or DownPayment
Invoice
BEGIN
SET($[$20.10000127.0]|Y); //Select the invoice.
END
This condition checks line by line if the Document number is equal to the UDF value, if yes, then
select the invoice.
Copyright 2011 – Boyum IT A/S Page 3
B1 Usability Package Sample
Result
After user input the doc numbers in the two UDFs, they can just press the ‘Find Invoice’ button then
system will search for the relevant documents and select it automatically.
Copyright 2011 – Boyum IT A/S Page 4