My 2p about ERP Solutions, Information Worker Solutions and other software products (mainly Microsoft Dynamics AX and Microsoft SharePoint).

28 August 2012

Enable trade agreement evaluation on new SalesLine fields

Business requirement: show overwrite prices and discounts dialog for new SalesLine field

If you add a new field to the SalesLine or SalesQuotationLine table, and this field is important for trade agreement evaluations, you should add some code for this field, to enable the Trade Agreement Evaluation functionality. Else, the dialog asking to Overwrite Prices And Discounts won’t appear upon changing this new field.


Add the new field to the Map PriceDiscResultFields and configure the necessary Mappings with the SalesLine and or SalesQuotationLine table.

In method isTriggerFieldChanged from Map PriceDiscResultFields, add following code for your new field:

boolean lineFieldChanged()
    return _priceDiscResultFields.SalesPurchQty        
!= priceDiscResultFieldsOrig.SalesPurchQty
|| _priceDiscResultFields.SalesPurchUnit     
!= priceDiscResultFieldsOrig.SalesPurchUnit
|| _priceDiscResultFields.CurrencyCode       
!= priceDiscResultFieldsOrig.CurrencyCode

          || _priceDiscResultFields.RecieptDeliveryDate
!= priceDiscResultFieldsOrig.RecieptDeliveryDate
          || _priceDiscResultFields.Price
!= priceDiscResultFieldsOrig.Price
          // BEGIN
|| _priceDiscResultFields.YourNewField
!= priceDiscResultFieldsOrig.YourNewField;
// END

In Class SalesLineType, method validateField, add following code:


case fieldNum(SalesLine, YourNewField):

    ok = salesLine.runPriceDiscPolicyDialog();


// END

Continue reading......

by Patrik Luca 0 comments

Patrik Luca, Ieper, BELGIUM
Feel free to use or spread all of the content on my blog. In return, linking back to my blog would be greatly appreciated. All my posts and articles are provided "AS IS" with no warranties.

Subscribe feeds via e-mail
Subscribe in your preferred RSS reader

Subscribe feeds rss Most Read Entries


Recommended Books

Subscribe feeds rss Recent Comments

This Blog is part of the U Comment I Follow movement in blogosphere. Means the comment field of this blog is made DOFOLLOW. Spam wont be tolerated.

Blog Archive

My Blog List