Dimension Flowfilter Issue

tarkmylertarkmyler Member Posts: 57
My mission is to add Shortcut Dimension 3,4,5 to the GL Entry table and, modify codeunit 12 to post from the general journal. The goal is to provide the functionality of the Global Dim 1/2 to Shortcut 3,4,5. It should allow flow-filtering at the Chart of Accounts level. So... I've learned a lot about CaptionClass, Codeunit 1.

I'm about 4 hours in and it all seems to be working except one thing.... When I'm on the Chart of Accounts form I can't select the new dimensions from a lookup. They show up with thei correct captions in the flow filter list. When you perform a lookup in the flow filter form they present a lookup form with the correct heading, and with the correct dimension values. However, when you press {Enter] to select a value the form closes, you return to the flowfilter form and the field is blank. You can copy/paste.... not very elegant.

Here's the questionable code ...

OnLookup Shortcut Dimenstion 3 Filter
CodeReturned := LookupAndReturnDimCode(3); //>> To easily trace the value returned
SETFILTER("Shortcut Dimension 3 Filter",CodeReturned);

Function[LookupAndReturnDimCode] - G/L Account Table
EXIT(DimMgt.LookupDimReturnCodeValue(FieldNumber));

Function in Dimension Management Codeunit [LookupDimReturncodeValue]
GetGLSetup;
IF GLSetupShortcutDimCode[FieldNumber] = '' THEN
ERROR(Text002,GLSetup.TABLECAPTION);
DimVal.SETRANGE("Dimension Code",GLSetupShortcutDimCode[FieldNumber]);
IF FORM.RUNMODAL(0,DimVal) = ACTION::LookupOK THEN BEGIN
EXIT(DimVal.Code);
END;

I'm stumped.... the lookup passes a value back to the table OnLookup trigger code, but the SetFilter fails. Hmmmmm.....

Thanks.
Mark Tyler
Pacific City, OR

Comments

  • AlbertvhAlbertvh Member Posts: 516
    Hi Mark

    Try SETFILTER(("Shortcut Dimension 3 Filter",'%1',CodeReturned);


    Regards
    Albert
  • MbadMbad Member Posts: 344
    Did you add numbers 3 and 4 and fill them in table 349 field Global Dimension No.(dont know if you need to modify filters in addition, but probably)?

    If you auto-fill global dim values from your own code this is a field a lot of developers forget to fill.
  • tarkmylertarkmyler Member Posts: 57
    I am using table 349, Global Dimension No. 3,4,5 respectively and it doesn't help. Also tried the '%1' filtering suggestion, with out success. This one really frys my burger.

    The only difference to the flowfield definitions (Global to Shortcut) in the modified G/L Account table is the caption class. As I said, the lookup works, but doesn't successfully set a flowfilter when it returns a value. There is no onlookup code on the Global, so this has to be an Application Management codeunit (1) issue. I've traced it through there a few times, but realized if I changed the code for globals to add 2,3,4 it get's deep quick.

    Still searching...
    Mark Tyler
    Pacific City, OR
Sign In or Register to comment.