How to use FieldCaption and FieldRef.Caption in SetView of CAL Code

I've a code written like this,


RecRef.SETVIEW(
  'SORTING(Document No.,"Line No.") WHERE(Document No.=CONST(' + DocNoFilter +
    '),Posting Date=CONST(' + PostingDateFilter + '),Line No.=CONST(' + FORMAT(LineNo1) + '))')

 

Now I'm trying to use the same SetView to happen in in German so I need to use fieldcaption or it can also be done using  FieldRef.Caption for the above code I guess.

I'm not used to FieldRef.Caption so I couldn't get through that.

 

Can someone guide me how to achieve this above code in different language apart from ENU?

some how I tried to manage this way as shown below, But still I couldn't get through exactly.


RecRef.SETVIEW(STRSUBSTNO('SORTING("%1","%2")'
,SICaption.FIELDCAPTION("Document No."),SICaption.FIELDCAPTION("Line No.")))

 

Let me know if any good suggestions.

  • Hi Harikiran,

    Remember I had similar issues. Couldn't get SETVIEW to work with my local language.
    So what did I do???

    In the code, where I'm using the SETVIEW I was able to get it to work by shifting to ENU (change GLOBALLANGUAGE) and then back again after the code has run.
  • In reply to Erik P. Ernst:

    Yeah. Thanks for the reply. I resolved this issue yesterday only :)
  • Didn't any of you consider looking at the online help? :-)
    Both RecordRef.SETVIEW and RecordRef.GETVIEW supports using field numbers.
    You'll quickly get the syntax by messaging RecordRef.GETVIEW(FALSE) of a recref with filters.

    A prettier solution could be to use KeyRef and FieldRef and set the individuel filters just like you would do with a Record.
Related