Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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,
(f42_dispo__physicalLimit__c - ( f42_dispo__blockedSumReserved__c + f42_dispo__blockedSumBooked__c + f42_dispo__DispoBookSumVolumeConfirmed__c + f42_dispo__DispoBookSumVolumeReserved__c )),
(f42_dispo__physicalLimit__c - ( f42_dispo__blockedCount__c + f42_dispo__blockedCountBooked__c + f42_dispo__confirmedCountRollup__c + f42_dispo__reservedCountRollup__c )))

Physical limit of an availability:

  • Minus blocked positions in reserved/posted status

  • Minus Booking entries with the status reserved/posted

Note

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.

...

Also here a formula field is in the center:

API Field Name

Formula

Formula Content

f42_dispo__Calculated_Archive__c

if(
OR(TEXT(f42_dispo__Order_Processing__c) = 'canceled' || TEXT(f42_dispo__Order_Processing__c) = 'rescheduled',
AND(
OR(
IF(RecordType.DeveloperName = '

Fixed Publication Date

FixedPublicationDate', f42_dispo__Issue__r.f42_dispo__ClosingDate__c < TODAY(),f42_dispo__Issue__r.f42_dispo__PublicationDateUntil__c < TODAY() ),
f42_dispo__Quote__r.sf42_quotefx__SF42_QuoValidThruDate__c < TODAY()
),
f42_dispo__Opportunity__r.IsClosed != true
)
),
true,false)

A Booking is set to archived if:

  • Booking canceled (status of the Booking entry)

  • Booking rescheduled (status of the Booking entry)

  • The publication period is in the past:

    • For Print: f42_dispo__Issue__r.f42_dispo__ClosingDate__c

    • For Digital: f42_dispo__Issue__r.f42_dispo__PublicationDateUntil__c

  • Quote Valid Date is in the past and Opportunity is still open

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:

...

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


at the Blocked Position

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.

...