Hi,
I have set up in the General Ledger Setup Table and Form 3 new text fields, Unit of Measure 1, 2, and 3. These 3 fields can be assigned a value through the General Ledger Setup Form. If left blank then the value will default as Unit of Measure 1 etc.
These 3 fields are text fields which will hold the name of the unit of measurement e.g Kilos, People, Meters, kms, miles, cow heads, etc whatever the user specifys in the General Ledger Setup Form.
Labels from other forms and the actual fields which are replicated throughout the database as Unit of Measurement 1 but type decimal, will have there caption set as whatever was specified in the General Ledger Setup Form. I have tried doing this through the Caption Class property on the unit of measurement labels and fields linking to the unit of measurement text field in the General Ledger Setup table however have not got it to work (getting empty). Does anyone know how to get this to work through caption class or perhaps has another way of achieving what i want to do?
0
Comments
I was trying to solve Your problem on my break at work. I realized that there isn't a good solution for You (depending on my knowledge).
Unfortunately You can't change names of labels. My solution is to use TextBoxs instead:
Try to move on in my solution. OnOpenForm: Get the active name from General Ledger Setup Table, and save it into local variable(, with is a SourceExpr of a TextBox).
Textbox:
- Border: None
- Editable: No
- SourceExpr: LocalVariable
Meybe later I'll be able to help You better... I hope it will help You...
You can set the captions on the fly look at post
http://www.mibuso.com/forum/viewtopic.php?t=6746
I tried '1,5,,'+... on version 5.0 and its does work. The later post of '3,'+... works fine. Make sure you set in the captionclass property of the field and not the caption. Set the variable in the oninit trigger
Hope this helps
Dynamics Nav Add-ons
http://www.simplydynamics.ie/Addons.html
Thanks for the replies, this is what I did in the end (does not work on tables):
Create 3 global variables
txtMyCaption1
txtMyCaption2
txtMyCaption3
C/AL - Code on Form
Form - OnInit()
// FDEV-1002 GRP 090408 COD 01b
GLSetup.GET('');
IF GLSetup."Unit Of Measure Quantity 1" = '' THEN
txtMyCaption1 := FIELDCAPTION("Unit Of Measure Quantity 1")
ELSE
txtMyCaption1 := GLSetup."Unit Of Measure Quantity 1";
IF GLSetup."Unit Of Measure Quantity 2" = '' THEN
txtMyCaption2 := FIELDCAPTION("Unit Of Measure Quantity 2")
ELSE
txtMyCaption2 := GLSetup."Unit Of Measure Quantity 2";
IF GLSetup."Unit Of Measure Quantity 3" = '' THEN
txtMyCaption3 := FIELDCAPTION("Unit Of Measure Quantity 3")
ELSE
txtMyCaption3 := GLSetup."Unit Of Measure Quantity 3";
// FDEV-1002 GRP 090408 COD 01e
Form - OnOpenForm()
// FDEV-1002 GRP 090408 COD 02b
IF (txtMyCaption3 = '') OR (txtMyCaption3 = 'Unit Of Measure Quantity 3') THEN
CurrForm.UOM3.VISIBLE(FALSE) ELSE
CurrForm.UOM3.VISIBLE(TRUE);
// FDEV-1002 GRP 090408 COD 02e
Properties on Field (field that you want to have a dynamic caption for)
CaptionClass:
'3,' + txtMyCaption1
Other Notes:
The caption name is set in the General Ledger Setup Form and is simply a text field that can be entered into through a text box on the form.