Hi guys,
How do i set caption of the field based on location code given that we have different countries with each countries had their own location code.
thus my field caption would like to name after those location code
eg: China: Singapore, Location Code: SH, GZ, BJ
Table:
SH QTY | GZ QTY | BJ QTY
878 | 10,913| 9807
0
Comments
|To-Increase|
thanks for replying.. i try not to modify anything in the codeunit 1
Just a happy frood who knows where his towel is
much appreciate your reply..
i used a function to return code of location:
so in my table field
Eg: Location1, caption class i place: GetName(1)
Location2, caption class i place: GetName(2)
Result? When I run my table... the field caption is missing?!
Below is my GetName function
GetName(LocationNumber)Text:30
Location.SetRange(Code);
Location.Next(LocationNumber);
Exit(Location.Code);
And don't forget to call currform.updatecontrols.
(And F1 is the helpfunction, not codeunit 1)
|To-Increase|
Wouldn't it be great if all new developers found out about the F1 key. [-o<
|To-Increase|
I ran a Developer training course last week. I made very sure that the students pressed F1 at every possible opportunity. The developer online help in Navision is very good, and could probably answer half the questions that people post on MiBuSo. I just can't understand why developers are so afraid to hit that button.
Just a happy frood who knows where his towel is
thanks for replying i will try it out. sorry to sounds so stupid.
i had used the F1 key in caption class which it says below:
if there isnt any modification of the above codes, guess my understanding is it returns a blank.
i tried suggested methods using variables:
Location[1] in my caption class properties too, i still turns out blank.
sorry that it triggers annoyance to you guys.
I normally modify codeunit 1 to set the caption. If you do not want to modify the codeunit 1, there is another way to do it. Try putting this on the CaptionClass : '1,5,,' + txtCaption
Just a happy frood who knows where his towel is
as suggest, i modified my caption class to: '1,5,,'+codelocation[1]
in my table, i have a function setLocation()
intI:=1;
Location.SETRANGE(Code);
IF g_Location.FINDSET THEN BEGIN
REPEAT
codeLocation[intI] := Location.Code;
intI +=1;
UNTIL Location.NEXT=0;
END;
When I run my report to insert sales, purchase history, i add following on report-initreport
ItemHistory.setLocation();
after report complete its running, i open up my table, the caption is blank.. :roll:
If you want to change the caption of a label in a report, use a textbox instead and place the preferred caption in it.
Captionclass is used in runtime on a form/page , not on a report, table, ... . Which means init form, run function, open form, see correct caption.
Next time, read the help, don't skip to the part where you think the problem is.
|To-Increase|
noted..will go try it out..thanks a lot..