Introduction
The opportunity, quote and booking processes in MediaVelox are perfectly intertwined and this is thanks to the several automations and triggers that are included in the package.
In addition to the "static" objects such as Publication with its Issues, Issue formats and Ad Position, the rather "dynamic" object Ad Position Placement - f42_dispo__AdPosCatalog__c - plays a central role.
f42_dispo__AdPosCatalog__c is related with a master-detail relationship with the following objects:
Booking - f42_dispo__DispoBook__c (Detail)
Blocked Positions -
(Detail)
At the same time related with a detail relationship to Booking - f42_dispo__DispoBook__c.
The Salesforce Schema Builder provides a clear overview of these relationships:
The availability of an Ad Position Placement
The central field in the Ad Position Placement option is the formula field Availability- f42_dispo__countAvailable__c
API Field Name | Fomula | Formula Content |
---|---|---|
f42_dispo__countAvailable__c | if( f42_dispo__Publication__r.f42_dispo__isDigital__c = TRUE, | Physical limit of an availability:
|
The posted / reserved / blocked bookings are entered using rollup summaries for the Ad Position Placement object.
For digital publications, availability is recorded via the reserved/booked/blocked volume within a Booking / Blocked position entry.
For normal print publications, only the number of Booking / Blocked position entry.
How are Booking entries generated?
Reservations in MVX are made in the quotation process via the /wiki/spaces/OFB/pages/1708327327.
The value of Product Property, in this case the Booking information, is written as a JSON String in the Specification Export field (SF42_QuoLI_Specification_Export__c) on the Position Object (sf42_quotefx__SF42_GenLineItem__c).
→ Here the IDs contain the corresponding availability, number of reservations, corresponding blocked positions.When synchronizing the quote line items to the opportunity (creating opportunity products), the JSON string is written 1:1 to the opportunity line item in field sf42_quotefx__SF42_QuoLI_Specification_Export__c
When the quote Positions are synchronized with the opportunity, a trigger is used to create Booking entries in addition to the opportunity products in the AdSales area.
Booking Relevant Triggers
OpportunityLineItem.trigger
The central trigger for MVX
Responds to OpportunityLineItem creation from appero quote and creates new Booking entries for MediaVelox using the JSON specification sf42_quotefx__SF42_QuoLI_Specification_Export__c
If there are already Booking entries in the opportunity, these are not updated, but deleted and rewritten.
Creates new Blocked Position entries if the Booking triggers such a rule.
Dispobook.trigger
Temporal validity of Dispobook entries
If a Booking entry (f42_dispo__DispoBook__c) is no longer valid, the data record is set to "archived" using a checkbox. Archived bookings are no longer counted towards availability.
Also here a formula field is in the center:
API Field Name | Formula | Formula Content |
---|---|---|
f42_dispo__Calculated_Archive__c | if( | A Booking is set to archived if:
|
Archived bookings are no longer counted against availability. However, since rollup summaries cannot be applied to calculation fields, the value of the field f42_dispo__Calculated_Archive__c is written with the help of a simple checkbox using a trigger:
This Dispobook.trigger is triggered by OpportunityLineItem.trigger
Writes the value of the field f42_dispo__Calculated_Archive__c into the checkbox field
f42_dispo__archives__c.Updates associated Blocked Position entries.
Updates the document dispatch belonging to a Booking (no voucher copy is created for cancelled Booking), for f42_dispo__MVX_ProofOfDeliveryRule__c, Record Type Based on Dispo Books.
Booking entries are not updated when their status or content changes, but are deleted and rewritten.
It is only during archiving that a Booking entry is not rewritten, but updated using the "archived" indicator.
DispoBlockedItems.trigger
Blocked Positions f42_dispo__DispoBlockedItems__c are also marked as archived using a calculation field:
API Field Name | Formula | Formula Content |
---|---|---|
f42_dispo__Calculated_Archive__c
| f42_dispo__DispoBookEntry__r.f42_dispo__Calculated_Archive__c | The field f42_dispo__Calculated_Archive__c in the Blocked Position uses a formula to transfer the value from the triggering Booking entry. |
The DispoBlockedItems.trigger writes the value of the calculation field into the checkbox field f42_dispo__archive__c at the Blocked Position.
Opportunity.trigger
When the opportunity status changes, these changes also influence the Booking record. Here the Opportunity.trigger:
Writes new Booking and deletes existing ones when the opportunity is won and the booking status changes to confirmed.
The same proceed also for the corresponding Blocked Position
quote.trigger
As soon as a quote is rejected, the corresponding booking is set to archived (archive__c). The associated trigger is the quote.trigger.
quotelineitems.trigger
If a quotation with reservations is processed again and individual items in it are deleted, the corresponding Booking entry must be archived.
The quotelineitems.trigger checks whether a quote item is deleted and sets the corresponding Booking entry to archived (archive__c) before deletion.
Trigger für den Versand von Belegexemplaren
Issues.trigger
For Proof Of Delivery Rule (f42_dispo__MVX_ProofOfDeliveryRule__c) from the record type Based On Issues.
The Proofs of delivery, which arise from issue-based rules, are manually created using an Action from the Issue record page.
The button only sets an Issue status using checkbox f42_dispo__ProofOfDeliveriesCreated__c.
Only when the checkbox is checked will the issues.trigger run and therefore generate a Proof of Delivery record (f42_dispo__MVX_ProofOfDelivery__c).
ProofofDeliveryRules.trigger
Validation of the delivery address (when delivery address details are incomplete).
Proofsofdelivery.trigger
If issue-based Proof of Delivery records were created, the corresponding status is updated on the issue.
To ensure that the various triggers in MediaVelox run without errors, the user needs sufficient permissions for the different objects.