Requisition Worksheet

tompynationtompynation Member Posts: 398
As you all know, the Requisition worksheet works with Journal Batch names...

For a customer, we will create a different batch for each user in NAV (no problem so far)

Now, there should also be a Journal Batch Name (= 'ALL') which shows all requisition Lines inside all
the different Journal Batch Names.

SO for example:
I have 3 Journal Batch Names:
1. PRODUCTION
2. STANDARD
3. ALL

Imagine that:
The PRODUCTION Batch contains 1 Req. Line
The STANDARD Batch contains 1 Req. Line

Now i open the Requisition Worksheet, the Batch PRODUCTION is selected by default
and it shows the correct Req. Line

Then i select the Batch STANDARD, it now shows the Req. Line from the STANDARD batch
still no problem

Now i select the Batch ALL, this shows 2 Req. Lines: 1 from the PRODUCTION Batch & 1 from the STANDARD Batch
still no problem

But now i would like to select the PRODUCTION or STANDARD Batch again. But this gives me the following error:

The filter '<>ALL' on the Journal Batch Name field in the Requisition Line table should specify an interval.

There are 2 permitted formats for the filters that specify an interval:

*A This filter selects values equal to A.
*A..Z This filter selects values between A and Z (inclusive).


#-o

I changed only 2 things inside CodeUnit ReqJnlManagement:
OpenJnl(VAR CurrentJnlBatchName : Code[10];VAR ReqLine : Record "Requisition Line")
CheckTemplateName(ReqLine.GETRANGEMAX("Worksheet Template Name"),CurrentJnlBatchName);
IF CurrentJnlBatchName <> 'ALL' THEN BEGIN
  ReqLine.FILTERGROUP := 2;
  ReqLine.SETRANGE("Journal Batch Name",CurrentJnlBatchName);
  ReqLine.FILTERGROUP := 0;
END
ELSE BEGIN
  ReqLine.FILTERGROUP := 2;
  ReqLine.SETFILTER("Journal Batch Name",'<>ALL');
  ReqLine.FILTERGROUP := 0;
END;

AND
SetName(CurrentJnlBatchName : Code[10];VAR ReqLine : Record "Requisition Line")
IF CurrentJnlBatchName <> 'ALL' THEN BEGIN
  ReqLine.FILTERGROUP := 2;
  ReqLine.SETRANGE("Journal Batch Name",CurrentJnlBatchName);
  ReqLine.FILTERGROUP := 0;
  IF ReqLine.FIND('-') THEN;
END
ELSE BEGIN
   ReqLine.FILTERGROUP := 2;
   ReqLine.SETFILTER("Journal Batch Name",'<>ALL');
   ReqLine.FILTERGROUP := 0;
   IF ReqLine.FIND('-') THEN;
END;

The error above comes from the following code:

LookupName(CurrentJnlBatchName,ReqLine)
COMMIT;
ReqWkshName."Worksheet Template Name" := ReqLine.GETRANGEMAX("Worksheet Template Name");
ReqWkshName.Name := ReqLine.GETRANGEMAX("Journal Batch Name");
ReqWkshName.FILTERGROUP := 2;
ReqWkshName.SETRANGE("Worksheet Template Name",ReqWkshName."Worksheet Template Name");
ReqWkshName.FILTERGROUP := 0;
IF FORM.RUNMODAL(0,ReqWkshName) = ACTION::LookupOK THEN BEGIN
CurrentJnlBatchName := ReqWkshName.Name;
SetName(CurrentJnlBatchName,ReqLine);
END;

How could i solve this one, so that i can select another Journal Batch again after looking at the 'ALL' Journal Batch :?:

Comments

  • DaveTDaveT Member Posts: 1,039
    Hi,

    This line of code is to set the batch to the current select batch on lookup. Try commenting out this line and you should be ok. Have you tested if the user tries to post with ALL selected?
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
  • tompynationtompynation Member Posts: 398
    OK, the switching between the batch jobs works fine now

    Hi,

    This line of code is to set the batch to the current select batch on lookup. Try commenting out this line and you should be ok. Have you tested if the user tries to post with ALL selected?
    yes, i did, it doenst work #-o

    It says, 'There is nothing to create'

    Any idea about this one?
Sign In or Register to comment.