Hello,
Lookup function doesn't work correctly every where in Navision !
In fact, From the Form 104 - Account Schedule, making lookup on the "Totaling" field doesn't bring the cursor on the right record when displaying the list of G/L accounts.
when controlling Table 85 - Acc. Schedule Line : field 5 - Totaling, these properties are set :
TableRelation =
IF (Totaling Type=CONST(Posting Accounts)) "G/L Account" ELSE IF (Totaling Type=CONST(Total Accounts)) "G/L Account"
ValidateTableRelation and TestTableRelation are now at <Oui> ! [= yes ! ]
in the other side, there is a code in the totaling textbox (in the form)
IF "Totaling Type" IN
["Totaling Type"::"Posting Accounts","Totaling Type"::"Total Accounts"]
THEN BEGIN
GLAccList.LOOKUPMODE(TRUE);
IF NOT (GLAccList.RUNMODAL = ACTION::LookupOK) THEN
EXIT(FALSE)
ELSE
Text := GLAccList.GetSelectionFilter;
EXIT(TRUE);
END;
EXIT(FALSE);
p.s. : I'm using french version
how to solve this please ?
Thank you for answers.
Do it your self
0
Comments
Declare a glAcc record for table 15. THEN:
IF "Totaling Type" IN
["Totaling Type"::"Posting Accounts","Totaling Type"::"Total Accounts"]
THEN BEGIN
GLAccList.LOOKUPMODE(TRUE); IF NOT (GLAccList.RUNMODAL = ACTION::LookupOK) THEN
EXIT(FALSE)
ELSE
Text := GLAccList.GetSelectionFilter;
EXIT(TRUE);
END;
EXIT(FALSE);
Simple and efficient =D>
Have a good day sir
Keep in mind that there other issues about this. For example, if the code does not specify which record to show, the form can open at the last record you were viewing the last time you opened it, or at the first record, or... depending on the properties you have setup on the form.