Get the string value from the option number

toootooo Member Posts: 138
i have these pieces of code, DocTypeFilter is always returning nothing, can't figure it out!?

Is in the Report - OnPreReport() trigger.
DocTypeFilter := "Cust. Ledger Entry".GETFILTER("Document Type");
Is in the Cust. Ledger Entry - OnAfterGetRecord() trigger.
IF DocTypeFilter = "Document Type" THEN BEGIN

Comments

  • awarnawarn Member Posts: 261
    Perhaps the report is not being filtered by the user?
  • BeliasBelias Member Posts: 2,998
    IF DocTypeFilter = "Document Type" THEN BEGIN
    

    try to write
    IF DocTypeFilter = format("Document Type") THEN BEGIN
    

    anyway, if your filter is for example 'A|B' you will never obtain true from this statement...
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • toootooo Member Posts: 138
    Its is being set as im trying to do it here.

    The filter is only ever one option, its like: 'bank',payment,invoice,credit memo,receipt etc..
  • Lec11Lec11 Member Posts: 91
    Maybe you clear the filter before using GetFilter.
    Perhaps putting your code here will help us see where the problem is.
  • kinekine Member Posts: 12,562
    Try to place the code reading the filter into the OnPreDataItem instead OnPreReport.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.