No of lines on a form

aliennavaliennav Member Posts: 449
Hi
I want to restrict the user not to enter more than 5 lines in sales line while making invoice.
Kindly suggest how it can be done using COUNT function.
Thanx in advance

Comments

  • mohana_cse06mohana_cse06 Member Posts: 5,504
    in sales invoice or in order also while posting invoice?
  • SavatageSavatage Member Posts: 7,142
    Do you want to restrict or notify the entry person?

    an easy notification would be to add code to the salesline subform
    IF COUNT > 5 THEN MESSAGE('5 lines max preferred');
  • aliennavaliennav Member Posts: 449
    Savatage wrote:
    Do you want to restrict or notify the entry person?

    an easy notification would be to add code to the salesline subform
    IF COUNT > 5 THEN MESSAGE('5 lines max preferred');

    I want to restrict on sales order so it couldnt pass on sales invoice.
  • aliennavaliennav Member Posts: 449
    in sales invoice or in order also while posting invoice?

    the main aim is to restrict it on invoice.
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    Savatage wrote:
    an easy notification would be to add code to the salesline subform
    IF COUNT > 5 THEN MESSAGE('5 lines max preferred');

    u can follow this.
  • ssinglassingla Member Posts: 2,973
    I normally put the validation on release/post of sales invoice. Further I will create a field in Sales & Receivable Setup to define the value of permissible lines (Where 0 means n number of lines) and use the value in validation.

    Pre-Printed formats creates such problems. Are you facing the same?
    CA Sandeep Singla
    http://ssdynamics.co.in
  • aliennavaliennav Member Posts: 449
    ssingla wrote:
    I normally put the validation on release/post of sales invoice. Further I will create a field in Sales & Receivable Setup to define the value of permissible lines (Where 0 means n number of lines) and use the value in validation.

    Pre-Printed formats creates such problems. Are you facing the same?

    Yes i am facing the same problem.
    Also, if I want to use using COUNT as mentioned above, on which trigger it is advisable to write a code so that in invoice no. of records shouldnt exceed the required level.
  • David_SingletonDavid_Singleton Member Posts: 5,479
    aliennav wrote:
    ssingla wrote:
    I normally put the validation on release/post of sales invoice. Further I will create a field in Sales & Receivable Setup to define the value of permissible lines (Where 0 means n number of lines) and use the value in validation.

    Pre-Printed formats creates such problems. Are you facing the same?

    Yes i am facing the same problem.
    Also, if I want to use using COUNT as mentioned above, on which trigger it is advisable to write a code so that in invoice no. of records shouldnt exceed the required level.

    The best place to put this is in the Code unit Sales Order Release second place would be in Code Unit 80.

    Also NEVER hard code something like this. Add a field to Either the Location table, the User Setup table or the Sales& Rec setup table, to say hom many lines are allowed, and make sure that 0=unlimited.

    Don't put the code on the form or in triggers on the sales line table.
    David Singleton
  • aliennavaliennav Member Posts: 449
    aliennav wrote:
    ssingla wrote:
    I normally put the validation on release/post of sales invoice. Further I will create a field in Sales & Receivable Setup to define the value of permissible lines (Where 0 means n number of lines) and use the value in validation.

    Pre-Printed formats creates such problems. Are you facing the same?

    Yes i am facing the same problem.
    Also, if I want to use using COUNT as mentioned above, on which trigger it is advisable to write a code so that in invoice no. of records shouldnt exceed the required level.

    The best place to put this is in the Code unit Sales Order Release second place would be in Code Unit 80.

    Also NEVER hard code something like this. Add a field to Either the Location table, the User Setup table or the Sales& Rec setup table, to say hom many lines are allowed, and make sure that 0=unlimited.

    Don't put the code on the form or in triggers on the sales line table.


    I'll try it.
    Thanx
Sign In or Register to comment.