So you want to get error when you press Set Applies-to ID?
I tried your code in 6.0SP1 base cronus database..I didnt get after 26th line also..
how can you get for each line? :-k
The reason is GenJnlLine."Account No." blank so I used ApplyingVendLedgEntry."Vendor No."
MaxLines := 0;
recVendorLedgerEntry.RESET;
recVendorLedgerEntry.SETCURRENTKEY("Vendor No.",Open,Positive);
//recVendorLedgerEntry.SETRANGE("Vendor No.",GenJnlLine."Account No.");
recVendorLedgerEntry.SETRANGE("Vendor No.",ApplyingVendLedgEntry."Vendor No.");
recVendorLedgerEntry.SETRANGE(Open,TRUE);
recVendorLedgerEntry.SETRANGE("Applies-to ID",USERID); //Added new Line
IF recVendorLedgerEntry.FINDSET THEN
REPEAT
MaxLines := MaxLines + 1;
UNTIL recVendorLedgerEntry.NEXT = 0;
IF MaxLines > 25 THEN
ERROR('You Can not select 26th line');
Comments
Friend, what did you try till now?
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
<Control32> - OnPush()
MaxLines := 0;
recVendorLedgerEntry.RESET;
recVendorLedgerEntry.SETCURRENTKEY("Vendor No.",Open,Positive);
recVendorLedgerEntry.SETRANGE("Vendor No.",GenJnlLine."Account No.");
recVendorLedgerEntry.SETRANGE(Open,TRUE);
IF recVendorLedgerEntry.FIND('-') THEN BEGIN
REPEAT
MaxLines := MaxLines +1
//MaxLines := recVendorLedgerEntry.COUNT;
UNTIL recVendorLedgerEntry.NEXT = 0;
END;
IF MaxLines > 25 THEN
ERROR('You Can not select 26th line');
IF i getting the count proper
but the error message is executed everytime.
i think i need more filters
can some one suggest me more filters.....
Stivan D'souza
I tried your code in 6.0SP1 base cronus database..I didnt get after 26th line also..
how can you get for each line? :-k
The reason is GenJnlLine."Account No." blank so I used ApplyingVendLedgEntry."Vendor No."
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
but then too i m not getting error when i select more then 25 lines......
Stivan D'souza
I can give sample code not the 100% code..
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
but coming...... :-k
Stivan D'souza
Is it coming or not coming? :?:
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
its not coming
Stivan D'souza
Did you write this code after SetVendApplId; function only?
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
if i select more then 25
Stivan D'souza
Stivan D'souza
Very funny...
Are you applying entries from payment Journal or vendor Card?
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
Stivan D'souza
SetVendApplId;
MaxLines := 0;
recVendorLedgerEntry.RESET;
recVendorLedgerEntry.SETCURRENTKEY("Vendor No.",Open,Positive);
recVendorLedgerEntry.SETRANGE("Vendor No.",GenJnlLine."Account No.");
//recVendorLedgerEntry.SETRANGE("Vendor No.",ApplyingVendLedgEntry."Vendor No.");
recVendorLedgerEntry.SETRANGE(Open,TRUE);
//recVendorLedgerEntry.SETRANGE("Applies-to ID",USERID);
IF recVendorLedgerEntry.FINDSET THEN
REPEAT
MaxLines := MaxLines +1
//MaxLines := recVendorLedgerEntry.COUNT;
UNTIL recVendorLedgerEntry.NEXT = 0;
//END;
IF MaxLines > 25 THEN
ERROR('You Can not select 26th line');
Stivan D'souza
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
with that additional filter its done.......
=D> :-({|=
Stivan D'souza
Welcome and Make sure you done with all possible testing combinations before move to live..
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
Stivan D'souza