R28640 Offer - Generate Deal

Code R28640
Entity Crm.Presales.Offers Entity
Name GenerateDeal
Attribute Deal
Layer Back-End
Events Releasing +
Priority Normal
Modify YES
Action Validate that:

if (Offer.oldState < 30 && Offer.newState >=30 && Offer.Deal == null && Offer.DocumentType.OfferOption.DealDocumentType != null)

(

new Deal is created as follows:

Deal.DocumentType = DealDocumentType

Deal.Notes = Offer.Notes

Deal.Party = Offer.Customer.Party

Deal.LeadingSalesPerson = Offer.SalesPerson

Deal.ExpectedRevenue = Sum(OfferLines.LineAmount)

Deal.ExpectedRevenueCurrency = Offer.DocumentCurrency

Deal.RevenueStartDate = Offer.DocumentDate

Deal.RevenueEndDate = Offer.DocumentDate

Deal.SuccessProbability = 1

Deal.DealStatus = Successful

)

&&

(

Offer.Deal == Deal //the newly created Deal

Offer.PrimeCauseDocument = Deal

)
Description The current business rule give the user an option to automatically create deal for the current offer, if none is created by now. This keeps the data consistency when the company has model where salesman work on deals and create offers based on those deals.

If for some reason there is an offer with no deal, such is automatically created.
Message Problem occurred while automatically creating deal for the current offer. The Sales Person attribute must have a value.
Introduced In Version 2018.2
Revocable NO

* For more information about the Business Rules Documentation Template and a short explanation of each column, see topic System Business Rules.