Getting error when opening list from another list form.

pushpraj1008pushpraj1008 Member Posts: 33
Hi All,

I added "Description" button on Item Card. When user clicks on this button Form1 is opening based on some filters.
User selects some records, then press "OK" button, it should open another "Form2".

I'm getting the error while opening the form, though Form2 opens but it comes with error. Following code on
"On Push" of "OK" button.


CurrForm.SETSELECTIONFILTER(lRecItemDescTypes);
lRecItemDescTypes1.COPY(lRecItemDescTypes);

lRecItemDescCommentsTemp.DELETEALL;
IF lRecItemDescTypes1.FINDSET THEN
REPEAT
lRecItemDescComments.RESET;
lRecItemDescComments.SETRANGE("Item No.",gItemNo);
lRecItemDescComments.SETRANGE(Type, lRecItemDescTypes1.Type);
IF lRecItemDescComments.FINDSET(FALSE,FALSE) THEN
REPEAT
lRecItemDescCommentsTemp :=lRecItemDescComments;
lRecItemDescCommentsTemp.INIT;
lRecItemDescCommentsTemp.INSERT;
UNTIL lRecItemDescComments.NEXT=0;
UNTIL lRecItemDescTypes1.NEXT=0;

FORM.RUNMODAL(6041107,lRecItemDescCommentsTemp);

and error is attached.

Kindly guide me in this regard.
Pushpraj
Regards
Pushpraj

Comments

  • DaveTDaveT Member Posts: 1,039
    Hi Pushpraj,

    What is the PushAction of the "OK" button?

    What I suspect is that it's LookupOK which will run the code in the OnPush trigger and then try to close the form. Change this to no push action and put a CURRFORM.CLOSE after the RUNMODAL.
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
Sign In or Register to comment.