I want to display the value of the OptionString instead of the deafult OptionCaption in a Report. This means I've a field which I use in SourceExpr and it displays on my report the value in OptionCaption, but I would rather have the value from the OptionString. Is there a way to get the OptionString or to indicate which one should be used?
0
Comments
RIS Plus, LLC
MVP - Business Apps
OptionString has the values 2,4,5
OptionCaption has the values text2,text4,text5
and then in OptionCaptionML are text2,4,5 in the other languages
In some forms I need the text, it's more obvious and more readable. In the report I must have the number and not the text.
Maybe there is another way to solve that problem. I hope I could explain in understandable
thanks for helping me out :-)
RIS Plus, LLC
MVP - Business Apps
If there is another way, I would prefer that one. ;-)
http://www.mibuso.com/forum/viewtopic.p ... tionstring
Is there a way to get the selected value from the OptionString field?
Create a function called GetOptionValue
Variables in this part are:
RecRef: RecordRef
FRef: FieldRef
OptVal: Text 200
Then use the following code:
The variables are:
Val: Text 200
Result: Text 100
OptNo: Integer
i: Integer
Seperat: Integer
FieldName is the option field you are using.
TableNo is the no. of the table, FieldNo the no. of the field.
As "result" you should receive the value of the option field instead of the caption. This should work! If not: ask again! :-)
[Edit: the option value is the option string. I mixed the words up. Sorry for that!]
Greetz
Nicole
Microsoft Dynamics NAV Partner
Bad Nauheim, Germany
http://www.protakt.de
http://twitter.com/protakt
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
You are really my hero, I was very astonished that such a function doesn't exist already in navision.
@kriki: that would be a nice solution, but unfortunately the values aren't like that in my case. thank you anyway
I then analysed it with the debugger and found out that
OptNo is always 0!
I have a table VarJnlLine and the filed Correction Code with the number 140
I call the function now: is that wrong?
I've also tried with the FILEDNAME function: and then use your function, but then I get an error that an
Either I've wrongly interprete your code or there must be some kind of a mistake in the code.
thanks
Greetz
Nicole
Microsoft Dynamics NAV Partner
Bad Nauheim, Germany
http://www.protakt.de
http://twitter.com/protakt
thanks
One more thing if someone is interested in:
if the function gets the last option, there was an error with the COPYSTR caused by the missing comma! I changed the coding:
Now it is supposed to work!
Greetz
Nicole
Microsoft Dynamics NAV Partner
Bad Nauheim, Germany
http://www.protakt.de
http://twitter.com/protakt
in our case, we have a need to interface with a 3rd party warehouse management system. we need to send something called an NMFC code to the WMS. In Navision, we want friendly names like Plastic Parts, Cardboard Parts, etc., but we want to send the numeric equivalent to WMS (156600, 152660 respectively in this example). By using this, i can have an option presenting the friendly name in Navision, but send the actual option value to WMS.
Thanks! \:D/