Skip to content

How To: Use the MAXSTRLEN Keywords in Microsoft Dynamics Business Central On Premises How to customize Dynamics Business Central or NAV using the MAXSTRLEN AL Keyword

If you’re new to Microsoft Dynamics Business Central on premises, you need to know how to easily customize it. This blog provides step-by-step instructions on how to use AL Keywords in a code unit in Microsoft Dynamics 365 Business Central. In this blog, you’ll learn how to do customizations using MAXSTRLEN keywords.

  1. Open Visual Studio.
  2. Create a Code unit for the MAXSTRLEN Keyword.

    MAXSTRLEN Keyword is used to get the maximum defined length of a string variable.

    Syntax:     Max: = MAXSTRLEN(String)

    Figure 1 – Creating a code unit for the MAXSTRLEN Keyword in Dynamics Business Central
    Figure 1 – Creating a code unit for the MAXSTRLEN Keyword in Dynamics Business Central
  3. Create a page extension.
    Figure 2 – Creating a page extension for the MAXSTRLEN Keyword in Dynamics Business Central
    Figure 2 – Creating a page extension for the MAXSTRLEN Keyword in Dynamics Business Central
  4. Click F5 or click on View, then Click on >AL: Publish. The vendor page will open; go to Navigate -> vendor-> MaxstrlenAction(Action name).
    Figure 3 – An action is added after Bank Accounts and the name of the action is MaxstrlenAction in Dynamics Business Central
    Figure 3 – An action is added after Bank Accounts and the name of the action is MaxstrlenAction in Dynamics Business Central 
  5. Final Output:
    Figure 4 – Output of the MAXSTRLEN Keyword in Dynamics Business Central
    Figure 4 – Output of the MAXSTRLEN Keyword in Dynamics Business Central

For a more general discussion of using AL keywords for Microsoft Dynamics 365 Business Central customization, see the post How to: Customize Microsoft Dynamics Business Central On Premises Using AL Keywords.

If you have any questions about this or other Dynamics NAV or Business Central questions for any version, contact ArcherPoint.

Read more "How To" blogs from ArcherPoint for practical advice on using Microsoft Dynamics Business Central or NAV.

If you are interested in NAV/Business Central development, check out our collection of NAV/BC Development Blogs.

Blog Tags: 
Read ArcherPoint's Blog Follow us on Twitter Follow us on Facebook Follow us on LinkedIn Link to our RSS feed Watch us on YouTube
Get Help Now