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
0
Comments
Try SETFILTER(("Shortcut Dimension 3 Filter",'%1',CodeReturned);
Regards
Albert
If you auto-fill global dim values from your own code this is a field a lot of developers forget to fill.
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...
Pacific City, OR