Requested Filter Blank

toootooo Member Posts: 138
I'm getting a filter as below when generating a report:
filter := ReqCustLedgEntry.GET("Document Type");
But even when an option is selected in the filter 'filter' variable still contains nothing, can't understand why!?s

Answers

  • DenSterDenSter Member Posts: 8,305
    With that code you are trying to insert a record type variable into the 'filter' variable. Unless the filter is also a record variable of the same table, that is never going to work. Even if it WOULD work that way, you are not specifying primary key values in your GET.

    My guess is that 'filter' is a text variable (make sure it has a length of 250, since that is the maximum number of characters in a filter), and you want to retrieve the current filter value into this variable. For this purpose, you would use the GETFILTER command. Read the C/SIDE Reference guide for more details. To get to the C/SIDE reference guide, click help and select C/SIDE Reference Guide.
  • toootooo Member Posts: 138
    Perfect, got it 98% sorted now, can't believe i didnt spot i was using the GET function instead of teh GETFILTER, just one other small question, is there a way to convert a document type from its option value like 0,1,2,3 to the text value associated with it or vice-a-versa?
  • krikikriki Member, Moderator Posts: 9,110
    from value to text:
    "Document Type" := "Document Type"::"Invoice"; // NEVER!!!!!! use the integer value to assign a value to an option. It will work, but with merging, upgrading, bugfixing you make it yourself (and others) (very) difficult.
    txtText := FORMAT("Document Type");
    

    text to option:
    EVALUATE("Document Type",txtText); // BUT if the txtText is in English, your current language must also be in English (E.g. if txtText is "Factuur" [Dutch] and you are working in English, it will generate an error)
    
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.