Skip to main content

Notifications

Business Central forum
Suggested answer

Create record from lookup field if record is not found

Posted on by 209
Hello!
 
I am currently working with a lookup field, and is on the lookout for a solution to a problem I have, or at least see if there is a way to make it smoother for the user.
Working with other lookup fields, I am able to press the "New" button in the little popup table, and create a new record that way, but in the current lookup, I am facing an issue.
 
As you can see in the pictures below, I am not able to insert a value that does not exist in the table. In this case, that is the Dimension Value table. I know I can insert data into that table, but that is not what I am asking.
Is it possible to run a procedure, or anything before or after that error occurs, where I can ask the user if they want to insert the value into the table? Are there any triggers or anything I can listen to?
 
The field itself is just a normal Code[20] field with a TableRelation. It also has an OnValidate trigger, but I am pretty sure I don't get that far unless the value is okay.
 
 
Categories:
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 71,232 Super User 2024 Season 2 on at
    Create record from lookup field if record is not found
    Hi, try the following method to bypass the current error message.
    Dynamics 365 Business Central: How to use Try methods/functions (TryFunction Attribute)
     
    Hope this helps.
    Thanks.
    ZHU

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,807 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,135 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans