Skip to main content

3.2 - SetSearchISBN Function

Last updated 12/06/2023

The SetSearchISBN function will be attached to the On Click event for the Find Book process. The code will execute when a member clicks the SEARCH button on the Find Books dashboard to display the book results for the search criteria.

1. Click Logic in the menu.

2. Click Code Editor in the sub-menu.


Code Editor Menu Item
Figure 1 - Code Editor menu item


Add the SetSearchISBN Function

1. Click the Add New Code button.


Add New Code Button
Figure 2 - Add New Code button


2. Type SetSearchISBN in the Function ID field.

3. Click the lookup icon in the Language field and select JavaScript.

4. Click the OKAY button.


Add the SetSearchISBN Function
Figure 3 - Add the SetSearchISBN function


5. Highlight and delete the template in the Code Editor.


Clean the Code Editor
Figure 4 - Clean the Code Editor


6. Click the Copy button on the code block below.


JavaScript
SetSearchISBN()
function SetSearchISBN(five, context, result)  {
five.setVariable('ISBN', five.field.ISBN);
five.setVariable('Title', `%${five.field.Title}%`);
five.setVariable('UserKey', five.currentUserKey());
five.refreshTable('Book');
five.refreshTable('iUser');
return five.success(result);
}


7. Paste the code in the Code Editor.

8. Click the Save Current Tab button.


Save the SetSearchISBN Function
Figure 5 - Save the SetSearchISBN function