Replacement Text and Functions
headley27
Member Posts: 188
I am having trouble passing replacement text strings into text constants when using functions. For example:
Text Constants
Text Constants
-
Text001 = SomeText %1.
Text002 = SomeText %1 %2 SomeText.
Text003 = SomeText %3.
IF CONFIRM(Text001 + '\\' + Text002 + '\\' + Text003, 'ReplaceText1', 'ReplaceText2', 'ReplaceText3') = TRUE THEN BEGINThe Dialog I would like to see is:
-
SomeText ReplaceText1.
SomeText ReplaceText1 ReplaceText2 SomeText.
SomeText ReplaceText3.
-
Type conversion is not possible because 1 of the operators contains an invalid type.
Boolean := Text
-
IF CONFIRM(Text001 + '\\' + Text002 + '\\' + Text003,
-
Ok := Dialog.CONFIRM(String
//I realize this will not work but it will provide an example of my need txtConfirm := Text001 + '\\' + Text002 + '\\' + Text003, 'ReplaceText1', 'ReplaceText2', 'ReplaceText3') IF CONFIRM(txtConfirm) = TRUE THEN BEGINThank you for your assistance.
0
Answers
-
You were so close!!

just add either True or false where the default is and you should have it
true means yes is the button with focus, false makes No the button with focus
so it's
if confirm('blah %1 blah %2 blah',TRUE,textone, texttwo) then
OR
if confirm('blah %1 blah %2 blah',FALSE,textone, texttwo) then
CONFIRM
Use this function to create a dialog box which prompts the user for a yes or no answer. The system centers the dialog box on the screen for you.
Ok := CONFIRM(String [, Default] [, Value1] ,...)
Ok
Data type: boolean
This return parameter reflects the user's selection.
Ok will be...
If you entered...
TRUE
Yes
FALSE
No
String
Data type: code or text constant
The system displays this string in the dialog box. Use a back slash (\) to indicate a new line. The string can be a multilanguage enabled text constant.
Default
Data type: boolean
Describes what the computer should use as the default button. If you do not specify a default, the system uses No.
Comments
The system sizes the message window for you. The height of the window corresponds to the number of lines and the width corresponds to the length of the longest line.
OR
The help:
CONFIRM
Use this function to create a dialog box which prompts the user for a yes or no answer. The system centers the dialog box on the screen for you.
Ok := CONFIRM(String [, Default] [, Value1] ,...)
Ok
Data type: boolean
This return parameter reflects the user's selection.
Ok will be...
If you entered...
TRUE
Yes
FALSE
No
String
Data type: code or text constant
The system displays this string in the dialog box. Use a back slash (\) to indicate a new line. The string can be a multilanguage enabled text constant.
Default
Data type: boolean
Describes what the computer should use as the default button. If you do not specify a default, the system uses No.
Comments
The system sizes the message window for you. The height of the window corresponds to the number of lines and the width corresponds to the length of the longest line.0 -
Crap.
I can't believe how easy that was.
I've used the Default property many times before but never in combination with replacement text.
I was banging my head against the wall with this one. ](*,)
Thanks so much !!!0 -
Just remember there are no multiple overloads in NAV. Only parameters at the end of the parameter list may be optional. As soon as you use one of them, you have to use all previous ones.0
-
Good to know.
Thanks.
0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 611 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
