How to rename the error?

MarharytaMykytenko
Member Posts: 53
For example I have an error

And I have to change text in this error: "Unit Price LCY" to "Unit Cost"
How can I do it?

And I have to change text in this error: "Unit Price LCY" to "Unit Cost"
How can I do it?
0
Best Answer
-
Hello MarharytaMykytenko,
if you use the TESTFIELD, you cannot change the error message directly.
But TESTFIELD shows the field caption in the current language.
So if you can change the field caption in the table, do this.
And then you should remove the field caption in the page, so that the page shows the new table field caption.
Otherwise you have to throw the error by code:IF PurchaseRequestDetails."Unit Price LCY" = 0 THEN ERROR('Unit Cost must have a value in Purchase Request Details: Request No.=%2, Line No.=%3. It cannot be Zero or empty.', PurchaseRequestDetails."Request No.", PurchaseRequestDetails."Line No.");
But you should use a text constant for the error message.
Kindly regards
s_keims_keim (Germany)
inhouse developer on NAV2016 (9.00.47838) NAVDE5
Answers
-
Hello MarharytaMykytenko,
How do you throw the error?
If your record is "Purchase Request Details" and your Field is "Unit Cost" ...
TryPurchaseRequestDetails.TESTFIELD("Unit Cost")
Kindly regards
s_keims_keim (Germany)
inhouse developer on NAV2016 (9.00.47838) NAVDE0 -
Hi s_keim ,
I use this code for catch error when "Unit Price LCY" is empty.
I can not use this code PurchaseRequestDetails.TESTFIELD("Unit Cost") because the field in table named "Unit Price LCY" but on the page this field rename to "Unit Cost". And if "Unit Cost" on page is empty I have to catch this error. But in this error "Unit Price LCY" have to be changed to the "Unit Cost". How I can do it?
0 -
Hello MarharytaMykytenko,
if you use the TESTFIELD, you cannot change the error message directly.
But TESTFIELD shows the field caption in the current language.
So if you can change the field caption in the table, do this.
And then you should remove the field caption in the page, so that the page shows the new table field caption.
Otherwise you have to throw the error by code:IF PurchaseRequestDetails."Unit Price LCY" = 0 THEN ERROR('Unit Cost must have a value in Purchase Request Details: Request No.=%2, Line No.=%3. It cannot be Zero or empty.', PurchaseRequestDetails."Request No.", PurchaseRequestDetails."Line No.");
But you should use a text constant for the error message.
Kindly regards
s_keims_keim (Germany)
inhouse developer on NAV2016 (9.00.47838) NAVDE5
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions