1

how to approach this? Change the value of unit price in the Sales line on changing its size, As far as I know the default unit price comes from trade agreements. In this case there would be no size, but for my requirement I should assign value from trade agreements for sizes 1,2,3,4 and for 5 and 6 the the value from trade agreements should be incremented with 1. i.e

For example sizes 1,2,3,4 -> 13$ and sizes 5,6 -> 14$

I am thinking to approach this making changes in the modified field method on InventSizeid in SalesTable form, is this the right approach or is there a better way to do this. Any help appreciated, thanks in advance

Jonathan Bravetti
  • 2,228
  • 2
  • 15
  • 29
Prasad Koppu
  • 23
  • 1
  • 7

2 Answers2

0

Check SalesTable form go to Data Sources/InventDim/Fields/InventSizeId/Methods/Modified open modified method, you need add your logic in the end of this method.

For example (this is standar method modified):

public void modified()
{
    SalesCalcAvailableDlvDates salesCalcAvailableDlvDates;

    super();

    salesLine.modifyInventDim(inventDim, fieldNum(InventDim,InventSizeId), !salesLine.MatchingAgreementLine);

    if (salesLine.DeliveryDateControlType)
    {
        salesCalcAvailableDlvDates =  SalesCalcAvailableDlvDates::newCommonSalesDlvDateType(salesLine,0,inventDim);
    salesCalcAvailableDlvDates.modifiedFieldBeforeInsert(salesLine);
    }
    salesLine_DS.cacheCalculateMethod(tableMethodStr(SalesLine,itemName));

    //Your logic
    ...
    ...
    ...
    SalesLine.SalesPrice = 999; //Your new sales price.
    //Your logic END
}

you probably need to perform salesLine_DS.reread(); or salesLine_DS.refresh(); to see new price (else press F5 in form).

Jonathan Bravetti
  • 2,228
  • 2
  • 15
  • 29
0

You can specify prices for product variants based on size, color etc. using the trade agreements. Please check the following link.

enter image description here

Aliaksandr Maksimau
  • 2,251
  • 12
  • 21