i need to have the Captions of subform lines to be variables that depends on the Header fields of the form. How can this be done?
did you take a look to attain. The Line amount field and the dimension field have variable captions. Take a look, maybe the answer to your question is hidding in standard Navision.
Hi Kamalb, you can modify codeunit 1 to do what you want. 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)); // Add this line here '50000' : Exit(captionref); END; END; EXIT('');
Now in your form, you can pass a value… In the CaptionClass of the field, add the following : GetFieldHeader create a function in the table GetFieldHeader, and return a text string. The return value should look like: exit(‘50000,’ + MyFieldHeader); That’s not all, you will need to play with the Filed updates and a few other things, but it is simple once you get it working. If you need to I can send you a sample object. Also think carefully about translations etc, to decide which level to put the function. Good luck.
Thank you very much ; that is what i’m looking for. yesss
quote:
Originally posted by David Singleton
Hi Kamalb, you can modify codeunit 1 to do what you want.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)); // Add this line here '50000' : Exit(captionref); END; END; EXIT('');
Now in your form, you can pass a value… In the CaptionClass of the field, add the following : GetFieldHeader create a function in the table GetFieldHeader, and return a text string. The return value should look like: exit(‘50000,’ + MyFieldHeader); That’s not all, you will need to play with the Filed updates and a few other things, but it is simple once you get it working. If you need to I can send you a sample object. Also think carefully about translations etc, to decide which level to put the function. Good luck.