Journal Batch Lookup

SambSamb Member Posts: 18
I have created two new fields on a setup table. These new fields are Journal Template Name and Journal Batch Name. These will be for automatically sending information to a particular Gen. Journal. I have the lookup on the Journal Template Name working correctly, but the Journal Batch Name will only show the batches for the Journal Template Name = Assets. I am using the table relationship property on the field. My current relationship is:

"Gen. Journal Batch".Name WHERE (Journal Template Name=FIELD(Journal Template Name))

The object compiles correctly and I can manually enter the correct batch name.

Comments

  • DenSterDenSter Member Posts: 8,304
    I'd check the lookup list form to see if that has a filter in the form design.
  • SambSamb Member Posts: 18
    I have looked at both the Gen. Journal Template and the Gen. Journal Batch Tables. They both have the LookupFormIDs populated with the standard NAV lookups.

    I found some code that was written in the 5.0 SP1 version and it works both classic and SQL. But after transfering it to the NAV 2009 client it is still only looking at the ASSETS template. I am placing the code on the field itself on the OnLookup section. I have tried both the lookup section of the table and form.

    My code is:
    GenJnlBatch.SETRANGE("Journal Template Name","Cash Recpt Jnl Template");
    GenJnlBatch.FILTERGROUP := 0;
    IF FORM.RUNMODAL(0,GenJnlBatch) = ACTION::LookupOK THEN
      "Cash Recpt Jnl Batch" := GenJnlBatch.Name;
    

    I have run the debugger with a breakpoint at the start and it looks like the SETRANGE is not holding my Gen. Journal Batch variable.
Sign In or Register to comment.