Skip to content
✦ Made with Docsie · generated from video

How to Create a Formatted Search (FMS) in SAP Business One

This guide shows you how to create a formatted search (FMS) in SAP Business One that displays a customer's phone number on the Sales Order form. You create a user-defined field (UDF) for the phone number and write a saved query that retrieves it. You then link the query to the field so it fills in automatically when you select a customer.

SAP Business One 15 steps 15 screenshots 1112 words Source video 6:33 Generated cost $2.45

Video: How to Create a Formatted Search Query in SAP Business One | Step-by-Step Guide by Maruf Rahman (2020). All credit for the demonstration goes to the creator; watch the original on YouTube. The written guide below was generated from this video by Docsie. Creator? Request a change or removal.

This guide shows you how to create a formatted search (FMS) in SAP Business One that displays a customer's phone number on the Sales Order form. You create a user-defined field (UDF) for the phone number and write a saved query that retrieves it. You then link the query to the field so it fills in automatically when you select a customer.

Prerequisites

Before you begin, make sure you have:

  • SAP Business One launched and running.
  • The Sales Order window available under Sales - A/R.
  • The table and field names you need. This guide uses the OCRD table and its Phone1 and CardCode fields.
1

Open the Sales Order window and identify the missing information

  1. Launch SAP Business One.
  2. In the left navigation pane, expand Sales - A/R.
  3. Click Sales Order to open the Sales Order window.
  4. Review the form. The customer phone number isn't displayed by default.
SAP Business One main screen with Sales - A/R expanded and Sales Order about to be selected
SAP Business One main screen with Sales - A/R expanded and Sales Order about to be selected
2

Open User-Defined Fields – Management

  1. Close the Sales Order window.
  2. In the top menu, click Tools.
  3. Select User-Defined Fields – Management.
  4. In the User-Defined Fields – Management window, expand Marketing Documents.
  5. Expand Title under Marketing Documents.
User-Defined Fields – Management window with Marketing Documents and Title expanded
User-Defined Fields – Management window with Marketing Documents and Title expanded
3

Add a new user-defined field

Click Add at the bottom of the window. In the Field Data dialog, enter the following values:

  • Title: PhoneNo
  • Description: Phone No
  • Type: Alphanumeric
  • Length: 15
  • Structure: leave as Regular
  • Validation: leave as None

Don't select Set Default Value for Field or Mandatory Field.

Field Data dialog for the new UDF with Title PhoneNo, Description Phone No, Type Alphanumeric and Length 15
Field Data dialog for the new UDF with Title PhoneNo, Description Phone No, Type Alphanumeric and Length 15
4

Confirm and add the field

Review the field settings to make sure they match:

  • Title: PhoneNo
  • Description: Phone No
  • Type: Alphanumeric
  • Length: 15

Click Add to create the user-defined field.

You have now created a user-defined field for the customer phone number in the Sales Order module. Next, you assign a formatted search query to this field so it displays the phone number for the selected customer.

Field Data dialog with all settings filled in, ready to add the new UDF
Field Data dialog with all settings filled in, ready to add the new UDF
5

Verify the UDF placement and technical name

  1. Open the Sales Order window.
  2. On the right side of the form, find the Phone No field under the Demo UDFs section.
  3. Hover your mouse over the Phone No field.
  4. Check the bottom left corner of the screen. The system information displays the UDF technical name, for example U_PhoneNo.
Sales Order window with the cursor over the Phone No UDF and the system information bar showing U_PhoneNo
Sales Order window with the cursor over the Phone No UDF and the system information bar showing U_PhoneNo
6

Find the item number of the Customer field

  1. In the Sales Order window, hover over the Customer field.
  2. Check the system information bar at the bottom. It displays:

Form=139 Item=4 Pane=0 Variable=1 ORDR,CardCode

  1. Note that the item number is 4. This number matches the dynamic reference you use in your query.
Sales Order window with the cursor over the Customer field and the system information bar showing item number 4
Sales Order window with the cursor over the Customer field and the system information bar showing item number 4
7

Check the table and field names in Business Partner Master Data

If you're unsure about the table or field names, open Business Partner Master Data from the left navigation pane under Business Partners.

  • The Telephone 1 field corresponds to Phone1 in the OCRD table.
  • The Code field corresponds to the business partner's unique identifier (CardCode).
Business Partner Master Data window showing the Tel 1 and Code fields
Business Partner Master Data window showing the Tel 1 and Code fields
8

Open the Query Generator

  1. Close the Sales Order window if it's open.
  2. In the top menu, click Tools.
  3. Hover over Queries.
  4. Select Query Generator from the submenu.
Tools menu open with Queries and Query Generator highlighted in SAP Business One
Tools menu open with Queries and Query Generator highlighted in SAP Business One
9

Open the query editor

  1. In the Query Generator window, click Execute at the bottom left.
  2. Click the pencil icon to open the query editor, where you write a custom SQL query.
Query Generator window with the Execute button highlighted, ready to write a query
Query Generator window with the Execute button highlighted, ready to write a query
10

Write the query with a dynamic condition

In the Query Preview window, make sure your SQL statement uses a dynamic reference for the customer code:

SELECT OCRD."Phone1" FROM OCRD WHERE OCRD."CardCode" = $[$4.0.0]

The placeholder $[$4.0.0] is built as follows:

  • 4 is the item number of the Customer field in the Sales Order form. You saw it in the system information bar in Step 6.
  • The first 0 refers to the column index. CardCode is the first column, so the index is 0.
  • The second 0 refers to the data type. Alphanumeric is also indexed at 0 in SAP Business One.

This reference makes the query pull the customer code from the active Sales Order form.

Query Preview window with SQL that uses a dynamic placeholder for CardCode
Query Preview window with SQL that uses a dynamic placeholder for CardCode
11

Save the query

  1. In the Query Preview window, click Save.
  2. In the Save Query dialog, select the appropriate query category, for example General.
  3. Choose the query you want to replace, for example fms_phone. If you're creating a new query, enter a new name instead.
  4. Click Save to store the query.
Save Query dialog with fms_phone selected in the General category
Save Query dialog with fms_phone selected in the General category
12

Open User-Defined Values – Setup

  1. Open the SAP Business One application and go to the main workspace.
  2. In the top menu, select Tools.
  3. Hover over Customization Tools.
  4. Select User-Defined Values – Setup. The shortcut is Shift + Alt + F2.
The Tools menu open with Customization Tools highlighted and User-Defined Values – Setup selected, with a Sales Order form in the background
The Tools menu open with Customization Tools highlighted and User-Defined Values – Setup selected, with a Sales Order form in the background
13

Link the saved query to the field

In the User-Defined Values – Setup dialog, configure the formatted search:

  1. Choose Search in Existing User-Defined Values according to Saved Query.
  2. Enter fms_phone in the field provided.
  3. Click Open Saved Query to select or review the saved query.
  4. Make sure Auto Refresh When Field Changes is selected.
  5. In the dropdown below it, select Customer/Vendor Code as the field that triggers the refresh.
  6. Choose Refresh Regularly so the values update as needed.
  7. Click OK to save the setup.
The User-Defined Values – Setup dialog with the saved query option selected, fms_phone entered, Auto Refresh When Field Changes selected and Customer/Vendor Code chosen
The User-Defined Values – Setup dialog with the saved query option selected, fms_phone entered, Auto Refresh When Field Changes selected and Customer/Vendor Code chosen
14

Test the formatted search

Once setup is complete, the Phone No UDF fills in automatically with the phone number of the customer you select in the Sales Order form.

  1. In the Sales Order form, click the Customer field.
  2. In the List of Business Partners dialog, select a customer, for example BP Code C20000, Name Maxi-Teq.
  3. Click Choose.
  4. Check that the Phone No field in the Demo UDFs panel updates with the phone number of the selected customer.
The List of Business Partners dialog showing BP Codes and Names while a customer is selected
The List of Business Partners dialog showing BP Codes and Names while a customer is selected
15

Repeat with another customer and review the form

  1. Select a different customer, for example BP Code C23900, Name Parameter Technology.
  2. Confirm that the phone number updates to match the new customer.
  3. Review the Sales Order form. Check that the relevant fields (Customer, Name, Contact Person, and so on) and the Phone No UDF are populated correctly.
The Sales Order form filled with customer details and the Phone No field populated for the selected customer
The Sales Order form filled with customer details and the Phone No field populated for the selected customer

Summary

You now know how to create a formatted search (FMS) in SAP Business One that displays a customer's phone number on the Sales Order form. You created the PhoneNo user-defined field and wrote and saved the fms_phone query. You then linked the query to the field in User-Defined Values – Setup so it refreshes whenever the customer changes.

Generation details: cost, quality tiers

Docsie billed 3,500 credits ($2.45) to analyze this 7-minute video at standard quality. The rewrite, template fill and Word/PDF exports were included. The same video at each quality tier:

QualityFrames sampledCreditsApprox. cost
Draftevery 16-30 s1,750$1.22
Standard (this guide)every 8-15 s3,500$2.45
Detailedevery 4-7 s7,000$4.90
Ultraevery 1-3 s14,000$9.80

Credits priced at $0.70 per 1,000; plans include a monthly allowance. Enterprise customers on on-premise or bring-your-own-model deployments run this on their own inference and pay no per-video credits.

Generated by Docsie Video-to-Docs on 2026-11-01 from a 6-minute video. Screenshots are frames from the source video and belong to their creator, Maruf Rahman, whose original is embedded above. If you own this video and want the guide removed or credited differently, contact us and we will act within one business day.

Turn your own training videos into guidesJoin teams that save hours, reduce documentation work and scale training with Docsie.
See Docsie in action. No commitment.

Ready to Transform Your Documentation?

Start creating professional documentation that your users will love