i need to restrict the items in the SalesLine . One customer should not order more than three items

RubendarRubendar Member Posts: 7
How should i do it can anyone tell .


  • SanderDkSanderDk Member Posts: 362
    Per sales order or in total?

    Are there a specific reason that you need to limit the number of item instead of the amount ?
    For help, do not use PM, but use forum instead, perhaps other people have the same question, or better answers.
  • RubendarRubendar Member Posts: 7
    . Per sales Order
  • pradipradi BrusselsMember Posts: 15
    On release of the sales order you can write a new function and call it, to check whether more than three items are added in the sales line and pop up a error.
  • RubendarRubendar Member Posts: 7
    SalesLine2.Setrange("Document Type", SalesHeader."Document Type");
    SalesLine2.Setrange("Document No.", SalesHeader."No.");

    if SalesLine2.Count > 3 Then
    ERROR('You can only insert 3 lines into an Order');

    this is my coding
  • gycsiakgycsiak Member Posts: 13
    In your case I would also filter for SalesLine2.SETRANGE(Type,Type::Item); as if there would be any other type of lines on the sales order (Item (Charge) or G/L Account for any discount, etc.), then you order would surely have at most 3 lines, but not 3 item lines.
Sign In or Register to comment.