How to interact with a module from a different module

Hello. I have 2 modules, pricelines and custom_pricing both interacting with the Line Item (so Product) in Quotes. The idea is that the first one offers a list of alternative prices for a product based on an identifier and the other offers a list of alternative prices based on quantity (basically a discount). And the business logic I need to implement is: IF the line item has been ALREADY "affected" by the pricelines module, do not let the quantity based thing be applied. So.. how could I from file "A" mark the line item as "touched already" so from file "B" I can make an if statement among the lines of if (touch mark present) { skip everything }. I hope I was clear enough in my explanation :)

Parents Reply Children
  • What do you mean?

    When I select a product using the thing circled with blue, it automatically applies the "price lines" it has a price line associated to it. If this happens (not all products have price lines associated), that the button circled with red should detect this and NOT apply it's own calculations.

  • If I remember correctly if the user populates QLI.LineItem with a value from  ProductCatalog in QLI editing interface, SugarCRM relates the QLI record with ProductCatalog record specified by the user and copies ProductCatalog.UnitPrice to QLI.UnitPrice

    Therefore, expected behavior might be the following: in case QLI.UnitPrice is not equal to 0, and the QLI.LineItem is populated, do disable the "Calculate" button in the QLI editing view

    AFAIK, developers can implement such the use case requirement in JS Sidecar 

    Best Regards,
    Dmytro Chupylka

    integroscrm.com
    We make work in Sugar CRM system faster, more convenient and efficient