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
  • Do you mean data validation on QLI save?

    If the QLI record is related to any Priceline (affected by priceline), then any additional editing of quantity or discount  shouldn't be saved to QLI (cannot be valid) - at least until  QLI is unlinked from priceline or QLI Product is changed. Yes?

    Best Regards,
    Dmytro Chupylka

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

  • No. User should not be prevented to edit QLI manually, as he wishes. And it's uni directional. Just module custom_pricing has to be stopped from executing it's code if pricelines were already used (not all products use pricelines, that is why simply trying to detect if pricelines exists is not enough). Custom_pricing triggers it's magic on the click of a custom button inserted in the QLI layout.

  • Okay, could you express expected system behavior as a use case or as a user story?

    Best Regards,
    Dmytro Chupylka

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

  • 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.

Reply
  • 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.

Children
  • 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