Option field dataport export

rhpntrhpnt Member Posts: 688
Maybe a stupid one but I'll give it a shot...

Just found out (the hard way) that by default NAV exports option captions instead of strings!? Is this real?

I searched for any property settings but with no success.

Anyone?

Answers

  • krikikriki Member, Moderator Posts: 9,086
    There isn't a property for it.
    The best way is to export the integer-values of it.
    To do that, you have to put the option in an integer variable and export that one.

    If you want to export the option-values, you need to manually program that.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • SavatageSavatage Member Posts: 7,142
    Shouldn't be too hard - create a text variable & export that in the dataport

    ex/
    CASE "Document Type" OF 
     "Document Type"::"Credit Memo" :  DocTypeText := 'Credit Memo';
     "Document Type"::"Invoice" :  DocTypeText := 'Invoice';
     "Document Type"::"Payment" :  DocTypeText := 'Payment';
    
  • MBergerMBerger Member Posts: 413
    You can get the optionstring of a field via a recordref -> fieldref. Then use SelectStr ( don't forget to add 1 to the value of the field, an option starts at 0, but SelectStr starts at 1 ) to get the correct value.
  • kinekine Member Posts: 12,562
    It is much easier...

    Just view the column Format in the DataPort Field Designer window, enter 2 and you are done (standard format 2 for option is the integer representation of the option)... ;-)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • rhpntrhpnt Member Posts: 688
    kine wrote:
    It is much easier...

    Just view the column Format in the DataPort Field Designer window, enter 2 and you are done (standard format 2 for option is the integer representation of the option)... ;-)

    Wow, thank you all for your responses! Kine, great info I'll keep that in mind (resolved the issue the primitive way though...) :whistle:

    Well, what can one say, NAV - always good for a surprise or dissapointment - depends on the viewing angle.
Sign In or Register to comment.