User, with the correct profile and permissions, can access to the Pricing Campaign feature through the top menu:
![Pricing Front End - 11240 > FD - [iCARe] Pricing Campaign > image2022-3-16_12-54-49.png](/download/attachments/758818308/image2022-3-16_12-54-49.png?version=1&modificationDate=1647549623785&api=v2)
Otherwise, they can also access to the Pricing Campaigns through the App Launcher:
![Pricing Front End - 11240 > FD - [iCARe] Pricing Campaign > image2022-3-16_12-55-49.png](/download/attachments/758818308/image2022-3-16_12-55-49.png?version=1&modificationDate=1647549624115&api=v2)
A. First table 'Pricing Campaign CPC'
Pricing campaign CPC records are displayed in the LWC below.
![Pricing Front End - 11240 > FD - [iCARe] Pricing Campaign > image2022-3-16_12-57-10.png](/download/attachments/758818308/image2022-3-16_12-57-10.png?version=1&modificationDate=1647549624158&api=v2)
The main goal of these filters on this LWC for users were to be as useful and helpful as possible.
![Pricing Front End - 11240 > FD - [iCARe] Pricing Campaign > image2022-3-16_13-3-37.png](/download/attachments/758818308/image2022-3-16_13-3-37.png?version=1&modificationDate=1647549624202&api=v2)
User must easily find CPCs with key information. Due to this requirement, we implemented logic explained below:
At the bottom of this LWC, Pricing campaign layout is available with Pricing Campaign key information:
![Pricing Front End - 11240 > FD - [iCARe] Pricing Campaign > image2022-3-16_12-58-39.png](/download/attachments/758818308/image2022-3-16_12-58-39.png?version=1&modificationDate=1647549624242&api=v2)
B. Second table 'Related'
![Pricing Front End - 11240 > FD - [iCARe] Pricing Campaign > image2022-3-16_13-2-30.png](/download/attachments/758818308/image2022-3-16_13-2-30.png?version=1&modificationDate=1647549624307&api=v2)
Create following Logic in LWC:
If Account Manager Review ISCHANGED to Rejected - do not auto-save, but instead:
Present a Toast message in Yellow stating: “To Reject this CPC, please provide a Reason for Rejection.”
If the User then changes Reason for Rejection from null to not null:
auto-save and commit both values to database (Account Manager Review = Rejected and Reason for Rejection with whatever value the User chose).
if the User does not change Reason for Rejection from null to not null and instead refreshes the page:
do not save any changes made by the User - returning Account Manager Review to the value it had before it was changed to Rejected.
Alternatively, if the User just changes the Reason for Rejection from null to not null and the Account Manager Review != Rejected, present User with a validation Error:
“Please choose Rejected on Account Manager Review field before providing a Reason for Rejection”.
Do not auto-save Reason for Rejection until User chooses Account Manager Review = Rejected.
Note: If User changes Account Manager Review value from Rejected to Not Yet Reviewed or Committed - the system needs to automatically make Reason for Rejection and Rejection Description = null
User is able to create a quote only if at the CPC level:
![Pricing Front End - 11240 > FD - [iCARe] Pricing Campaign > image2022-3-16_13-10-24.png](/download/attachments/758818308/image2022-3-16_13-10-24.png?version=1&modificationDate=1647549624352&api=v2)
A. No pricing setting matching
If there is not a pricing setting matching the criteria below at least for one Pricing Campaign CPC selected previsouly, the user is not able to create a quote
Pricing_Setting__r.Product_Pricing__r.Product__r.Product_Availability__c != Inactive
AND
Pricing_Setting__r.Product_Pricing__r.Valid_Active__c EQUALS TRUE
AND
Pricing_Setting__r.Region__c EQUALS Pricing_Campaign_CPC__r.Pricing_Region__c
AND
Pricing_Setting__r.CurrencyIsoCode EQUALS Pricing_Campaign_CPC__r.Pricing_Currency__c (only need to compare the first 3 characters of the Pricing Currency field of Pricing Campaign CPC)
Screen below is displayed to the user:
![Pricing Front End - 11240 > FD - [iCARe] Pricing Campaign > image2022-3-17_16-35-59.png](/download/attachments/758818308/image2022-3-17_16-35-59.png?version=1&modificationDate=1647549624397&api=v2)
B. One pricing setting matching
After clicking the button 'Create Quote' and only if there is a Pricing setting matching, a screen dedicated to create a quote appears:
![Pricing Front End - 11240 > FD - [iCARe] Pricing Campaign > image2022-3-16_13-25-30.png](/download/attachments/758818308/image2022-3-16_13-25-30.png?version=1&modificationDate=1647549624428&api=v2)
Logic has been implemented for the fields below in order to make the quote creation the easiest possible for the user:
Profile Object Permissions - only the Profiles meeting the following criteria should be able to Read Pricing Campaigns:
Profile.User License = Salesforce
Profile.Custom = TRUE
System Administrator, System Admin (Lite) and GBU Data Steward must have full permissions for this object (Read, Create, Edit, Delete, View All and Modify All).
All other Profiles meeting criteria 1 and 2 above should not have anything other than Read permission for this object (no Create, no Edit, no Delete, no View All, no Modify All).
Only Owner can see Pricing Campaign CPC records (Private object).
Grant Access Using Hierarchies = TRUE
no other Sharing Rules will be implemented
Profile Object Permissions - only the Profiles meeting the following criteria should be able to Read and Edit Pricing Campaigns:
Profile.User License = Salesforce
Profile.Custom = TRUE
System Administrator and GBU Data Steward must have full permissions for this object (Read, Create, Edit, Delete, View All and Modify All).
System Admin (Lite) Profile will have access to this object via the z__Object_Permissions_for_AdminLite Permission Set
adjust this permission set to grant Access to Pricing Campaign CPC (Read, Create, Edit, Delete, View All and Modify All).
All other Profiles meeting criteria 1 and 2 above should only have Read and Edit permission for this object (no Create, no Delete, no View All, no Modify All)