Options

Select order without using form

imurphyimurphy Member Posts: 308
Is there any way to use a list form such as '45 Sales List' as a picklist to select a sales order reference? ... only using code and not a bound field?

This is the form which pops up when you press F5 from the order window.

I'd like to add a button to a form which the user presses to select an order. I then pull some info from that order into the current form.

Reusing form 45 would seem to make sense - but only if there was some way of getting a return value from it.

Ian

Comments

  • Options
    krikikriki Member, Moderator Posts: 9,098
    Something like this:
    recSalesHeader.RESET;
    recSalesHeader.SETCURRENTKEY(....); // the key you want
    recSalesHeader.SETRANGE("Document Type",recSalesHeader."Document Type"::Order);
    recSalesHeader.SETRANGE or SETFILTER : other filters if needed
    IF FORM.RUNMODAL(FORM::"Sales List",recSalesHeader) = ACTION::LOOKUPOK THEN
      "Some Field" := recSalesHeader."No.";
    
    BTW : this codes is for the OnLookUp-trigger
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Options
    imurphyimurphy Member Posts: 308
    Thanks, I think that makes sense. I'll have a go an see if it works for me.
Sign In or Register to comment.