The Released Products -> Released Product Details form is bound to the InventTableModule table (Inventory module parameters) in 3 different roles: Purch (Purchase), Sales (Sell) and Invent (Manage costs) – this table acts as 3 different data sources.
The field InventTableModule.Price appears in the fast tabs Purchase, Sell and Manage costs on the form Release product details.
In general, alert rules are created for a table field but through a form data source by iterating through all form controls. This is why the Create a custom alert form is opening so slowly from the Release product details form that contains many form controls bound to the fields from many data sources.
Two Bugs
We wanted to create an alert rule for the Price field for each of 3 sections: Purchase, Sell and Manage costs. But surprise 🙊, there is a bug when creating an alert rule over the form where the same table acts as multiple different data sources at once. Namely, you’ll see that you will be able to select just the first one.
In our case, this is the Inventory module parameters table always providing the fields as it is always in its Purch role.
However, no matter which of these tables we select in the Table name combobox, we will always see the list of the same fields, i.e. from Inventory module parameters (Purch).
At the same time, the Price field (control) from the PRICES group is missing in the combobox. This is the Bug #2 we fixed.
In our case, the data field Price from the same data source Invent module parameters (Purch), with the same label Price, is bound to the control from the PRICES form group and marked as the Fast Tab Summary field. The first is skipped when populating the Field combobox on the Create a custom alert form.
So, we fixed the Bug #2👇
Note that in the Field combobox there are offered the table fields with the form control labels (usually equal to the field labels), decorated with the numbers if there are more than one such form control label on the form, and in the brackets is either the caption of the belonging Group or Fast tab.
Btw, we couldn’t change anything in the Table name combobox because the logic behind its population is too heavy and delicate.
Now back to the Bug #1. We fixed it so when you select the second and third Inventory module parameters table, you will see the fields belonging to the table in the Sell and Manage costs fast tab.
But there is more! (More issues 🙃)
The Workaround
Once you succeed to select the wanted field, let’s say Price from the Purchase fast tab, the created alert rule will be triggered and create an alert every time when the InventTableModule.Price field is changed, no matter if you selected it within the Purchase, Sell or Manage Costs fast tab when creating the alert rule.
If we want to pinpoint the particular role of the Price field and get the alert only when, for example the Purchase > Price value has changed, we need to change the Alert rule condition.
We will edit the query behind the alert rule so it will create alerts only when Purchase > Price value is changed. To achieve this, we will add the criteria for the Module type field for each of the selected data sources, meaning Inventory module parameters (Purchase -> Purchase order), Inventory module parameters 1 (Manage costs -> Inventory) and Inventory module parameters 2 (Sell -> Sales order).
We need to configure all 3 criteria, otherwise we’ll get multiple alerts whenever the Price field is changed. This is because the Inventory module parameters table (InventTableModule) is linked to the main data source Items (InventTable) on the Released product details form with the outer join.
We couldn’t fix this behavior to work OOTB because all hidden ranges are removed from the Alert table before the alert rule is created, and in our case the Alert table (Inventory module parameters) differs from the Primary table (Items). This is why we need to apply this workaround manually.
Unfortunately, because of the same reason, we can’t configure these criteria in any other way (the Module type field is not offered in the Field combobox in the Alert rule condition form) but by using our new functionality Create alert in a single click. Keep reading to find out more 🤩
Create Alert in a Single Click
In v3.4.7 we delivered a smart functionality Create alert in a single click, which enables you to create alert rules from the context menu opened with the right click on a form control. Supercool 😎, right? In our case, you would simply position your mouse at the Price field in the Purchase tab, right click and select Create a custom alert menu item from the context menu. The Create a custom alert form will open, populated with the right field selection. Nevertheless, you would still need to apply just described workaround 😀
See Also
Create Alert in a Single Click >>
Create Conditional Alert Rules and Notify a User Group with a Single Alert Rule >>
Send Alert Summary Notification Emails >>