User Story LSCRM-132/43: Update the Sample confidentiality when the Opportunity confidentiality the Sample is linked to, is updated.
Why the new implementation: the need for BDMs, Sales Reps, Laboratory Managers to comply with the NDA and protect sensitive information when managing the confidentiality of a Sample linked to a confidential Opportunity.
Goal: The changes aim to track and capture the visibility changes in an Opportunity while having the related Samples comply with the same visibility.
Feature Overview: The new feature showcases a new automated functionality which uses two, already existing, fields, one for Opportunity, called “Visibility” (picklist) and one for Sample, called “Confidential” (checkbox) to automatically update the Sample with the same type of access as the Opportunity’s visibility; this way, the new functionality allows the BDMs, Sales Reps, and Laboratory Managers users to track and manage the confidentiality of a Sample linked to an Opportunity.
Depending on whether the Opportunity’s visibility is confidential or not, team members are also involved in the process; no former team member part of the Sample will be able to access the Sample and the Opportunity’s details anymore once the related Opportunity’s visibility becomes confidential, because the members in question will be automatically removed from the Sample’s team members and replaced by the team members on the related Opportunity – this way, both the Opportunity and the related Sample will share the same team members with the same type of access to the two; unless any of the Opportunity members were inactive at the time the move was triggered from the Opportunity team to the Sample’s one, all the rest of the members will be moved.
Addresses to: Implementation applies to all GBUs, ECO + SCO, when Visibility on Opportunity is being changed
Current Implementation Behavior:
What’s New?
- if the Opportunity’s visibility is updated to confidential, its related Sample(s) will also become confidential and the “Confidential” field on the Sample(s) will not be editable - an error will be displayed letting the user know he is not allowed to change the ‘Confidential’ field of a Sample related to an Opportunity: “This field cannot be edited because this Sample is related to an Opportunity”; the Case team members will have the same users as the Opportunity’s team members as a result of the opportunity’s team members having been copied in into the sample’s to comply with the sample confidentiality rules.
Create an Opportunity record with Visibility = GBU Restricted OR Shared and add team members. Opportunity team members should be active users; if they are not, inactive users on Opportunity will not be moved to the related Sample upon Opportunity change of Visibility value to "Confidential", but will remain on the opportunity, the way they were to begin with.
Create an Account record (to be able to use mass create the samples from the dedicated button within the account). Go on the Account and mass create 2 samples; after samples are created, go on one of them and remove the opportunity relation: https://syensqo-crm--uat.sandbox.lightning.force.com/lightning/r/Case/500S8000008jEgXIAU/view Sample related to the opportunity should have existing team members different than the ones on the opportunity: https://syensqo-crm--uat.sandbox.lightning.force.com/lightning/r/Opportunity/0060800000yvhoeAAA/view



- case sharing rules were updated so that only the non-confidential Samples are shared with the assigned groups for both ECO and SCO users
- if a Sample is created and related to a confidential Opportunity, the Sample will become automatically confidential and the user will not be able to change the Sample’s confidentiality; the Case team members will have the same users as the Opportunity’s team members
- if the Opportunity visibility is not changed to Confidential but to GBU Restricted or Shared, the related Sample will not be confidential and the user will not be able to change the Sample’s confidentiality with it being related to an Opportunity;
- if the Opportunity’s visibility changes from Confidential to Shared or GBU Restricted, all the samples linked to that opportunity will be updated with ‘Confidential’ field unchecked

- if the Sample is not related to an Opportunity, the sample is not confidential and the “Confidential” field on Sample will be editable - ability to edit Sample confidentiality
- new picklist value “Confidential” to Visibility picklist on Case:
scenario 10. Remove Opportunity from a Sample
Steps:
- Remove Opportunity link from an existing Sample
Results:
- The Visibility field should be cleared and could be edited, since there is no opportunity linked to that Sample. (PARTIALLY FAILED) - the Visibility field is not cleared, however it is editable
- The case team members remain in the case team. (PASSED)
- if no opportunity related to the sample, the Sample Confidential checkbox could be editable (PASSED)
Scenario 11: Change confidential opportunity with a not confidential one
Steps:
- Create sample linked to a confidential opportunity
- Update opportunity of the created sample with another one with Visibility = GBU Restricted or Shared
Result:
- The Samples Visibility should be unticked but the field is locked and cannot be changed. (PASSED)
- The case team members remain in the case team but the ones team members from the new opportunity were added to the case team. (Not sure if this result is the expected one since on the story requirement there is no mention of moving the team members when the Opportunity.Visibility field is one of the GBU Restricted or Shared values)
Scenario 12: Add team member(s) to a confidential Opportunity
Steps:
- Perform updates (addition/deletion) on team member(s) of a confidential Opportunity
Results:
- The related sample(s) team members should be update with the updates done on Opportunity Team members level (FAILED)
Susana scenarios
Scenario 1:
Test data: https://syensqo-crm--monthlyint.sandbox.lightning.force.com/lightning/r/Opportunity/006S8000006SXIXIA4/view
Failed to create Sample(s) after login with Alvaro Torres (any prerequisites?)


Scenario 4: Update Confidential field for a Sample already linked to an Opportunity
Steps:
- Update any sample linked to an Opportunity and change the value of Confidential field
Result:
- An error should be displayed and the change on the Confidential field should not apply (PASSED)