CaptionClass property

BGI
Member Posts: 176
<img border="0" title="" alt="[Confused]" src="images/smiles/icon_confused.gif" /> Is there someone outthere that can explain me in brief how the captionclass property works, so i can use it to change the caption of a button during runtime ?
Rgds
Benny Giebens
Benny Giebens
0
Comments
-
I don't know if the CaptionClass works for menubuttons. Here is an example for renaming a caption of a field in a table.
In Codeunit 1, you'll find a function CaptionClassTranslate. Change this as follows:
</font><blockquote><font size="1" face="Verdana, Arial">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">CaptionClassTranslate(Language : Integer;CaptionExpr : Text[80]) : Text[80]
CommaPosition := STRPOS(CaptionExpr,',');
IF (CommaPosition > 0) THEN BEGIN
CaptionArea := COPYSTR(CaptionExpr,1,CommaPosition - 1);
CaptionRef := COPYSTR(CaptionExpr,CommaPosition + 1);
CASE CaptionArea OF
'1' : EXIT(DimCaptionClassTranslate(Language,CaptionRef));
'2' : EXIT(VATCaptionClassTranslate(Language,CaptionRef));
END;
END;
ltxtCaption := '';
IF UPPERCASE(CaptionExpr) = 'TESTCAPTION'
THEN ltxtCaption := 'New caption';
EXIT(ltxtCaption);
//EXIT('');</pre><hr /></blockquote><font size="2" face="Verdana, Arial">Now insert a new field 'Testfield' in a table, and fill in the CaptionClass-property with 'TESTCAPTION' (including the ').
When you run the table, or place the field on a form and run that form, you'll see the name 'New caption' instead of the name 'Testfield'.
In codeunit 1 you'll have to add code for multi-language.
With Attain 3.01, I tried to rename a menu that way, but it wasn't possible. Maybe they have changed this with Attain 3.60?No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0 -
Thnx for the info.
Now at last i know how it works, but it isn't realy the thing i'm looking for.
Thnx anywayRgds
Benny Giebens0 -
Here are all secrets to Caption Class
</font><blockquote><font size="1" face="Verdana, Arial">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">[Procedure]CaptionClassTranslate (<LANGUAGE>;<CAPTIONEXPR>)
LANGUAGE
<DataType> := [Integer]
<DataValue> := // Automatically mentioned by the system
CAPTIONEXPR
<DataType> := [String]
<Length> <= 80
<DataValue> := <CAPTIONAREA>,<CAPTIONREF>
CAPTIONAREA
<DataType> := [SubString]
<Length> <= 10
<DataValue> := 1..9999999999
// 1 for Dimension Area
// 2 for VAT
CAPTIONREF
<DataType> := [SubString]
<Length> <= 10
<DataValue> := IF (<CAPTIONAREA> = 1) <DIMCAPTIONTYPE>,<DIMCAPTIONREF>
<DataValue> := IF (<CAPTIONAREA> = 2) <VATCAPTIONTYPE>
DIMCAPTIONTYPE
<DataType> := [SubString]
<Length> <= 10
<DataValue> := 1..6
// 1 to retrieve Code Caption of Global Dimension
// 2 to retrieve Code Caption of Shortcut Dimension
// 3 to retrieve Filter Caption of Global Dimension
// 4 to retrieve Filter Caption of Shortcut Dimension
// 5 to retrieve Code Caption of any kind of Dimensions
// 6 to retrieve Filter Caption of any kind of Dimensions
DIMCAPTIONREF
<DataType> := [SubString]
<Length> <= 10
<DataValue> := IF (<DIMCAPTIONTYPE> = 1) 1..2,<DIMOPTIONALPARAM1>,<DIMOPTIONALPARAM2>
IF (<DIMCAPTIONTYPE> = 2) 1..8,<DIMOPTIONALPARAM1>,<DIMOPTIONALPARAM2>
IF (<DIMCAPTIONTYPE> = 3) 1..2,<DIMOPTIONALPARAM1>,<DIMOPTIONALPARAM2>
IF (<DIMCAPTIONTYPE> = 4) 1..8,<DIMOPTIONALPARAM1>,<DIMOPTIONALPARAM2>
IF (<DIMCAPTIONTYPE> = 5) Dimension.[Field]Code,<DIMOPTIONALPARAM1>,<DIMOPTIONALPARAM2>
IF (<DIMCAPTIONTYPE> = 6) Dimension.[Field]Code,<DIMOPTIONALPARAM1>,<DIMOPTIONALPARAM2>
DIMOPTIONALPARAM1
<DataType> := [SubString]
<Length> <= 30
<DataValue> := [String]
// a string added before the dimension name
DIMOPTIONALPARAM2
<DataType> := [SubString]
<Length> <= 30
<DataValue> := [String]
// a string added after the dimension name
VATCAPTIONTYPE
<DataType> := [SubString]
<Length> = 1
<DataValue> := '0' -> <field caption + 'Excl. VAT'>
'1' -> <field caption + 'Incl. VAT'></pre><hr /></blockquote><font size="2" face="Verdana, Arial">®obi0
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