Filtering sales price in sales order

julkifli33julkifli33 Member Posts: 1,092
hi all i want to filter customer sales price in sales order
lets say i set item A, B and C for Customer 001
so when i create sales order for customer 001
the lookup for Item no at detail part only show item A, B,C
how to do that?
thanks

this is my code
but still wrong :(
SalesPrice.FILTERGROUP(4);
SalesPrice.SETRANGE(SalesPrice."Sales Type",SalesPrice."Sales Type"::Customer);
SalesPrice.SETRANGE(SalesPrice."Sales Code",'10000');
SalesPrice.FILTERGROUP(0);
IF FORM.RUNMODAL(0,SalesPrice) = ACTION::LookupOK THEN 
BEGIN
  //"My Code
END;

Answers

  • vijay_gvijay_g Member Posts: 884
    Where you have written this code?
    julkifli33 wrote:
    the lookup for Item no at detail part only show item A, B,C
    What is your detail part in sales order? is this sales line?

    Do you want to lookup only those items in No. field of line table?
  • julkifli33julkifli33 Member Posts: 1,092
    vijay_g wrote:
    Where you have written this code?
    page sales order subform
    i create new field to filter this
    or do you think it's better if I filter directly to Sales Line Table , field = No.??
  • vijay_gvijay_g Member Posts: 884
    Have you written this code on onlookup trigger of your customized field?

    don't disturb the No. field of line.
  • julkifli33julkifli33 Member Posts: 1,092
    vijay_g wrote:
    Have you written this code on onlookup trigger of your customized field?

    don't disturb the No. field of line.
    exactly....
    i create new field named Item Number
    here is the full code
    customer price group TEST, i do it using hardcode first
    Item Number - OnLookup(VAR Text : Text[1024];) : Boolean
    SalesPrice.FILTERGROUP(4);
    SalesPrice.SETRANGE(SalesPrice."Sales Type",SalesPrice."Sales Type"::"Customer Price Group");
    SalesPrice.SETRANGE(SalesPrice."Sales Code",'TEST');
    SalesPrice.FILTERGROUP(0);
    IF FORM.RUNMODAL(0,SalesPrice) = ACTION::LookupOK THEN 
    BEGIN
      //My code
    END;
    
  • vijay_gvijay_g Member Posts: 884
    Do reset to your salesprice first.
  • julkifli33julkifli33 Member Posts: 1,092
    vijay_g wrote:
    Do reset to your salesprice first.
    hi vijay
    it seems like because i forgot to put
    if salesprice.find('-') then

    now it works
    thanks for your help
Sign In or Register to comment.