Cornickon / sf-examination

0 stars 0 forks source link

Exam Registration Process #26

Closed Cornickon closed 1 year ago

Cornickon commented 1 year ago

Summary

We should prepare for our customer rollout, and allow the customers to register for exams by themselves. This process is called 'Exam Registration'. As a customer, I should be able to

  1. Select from the list of available exams
  2. I should only see Exams, which are 'Published' (Tip: Consider proper record sharing method with external users. Propose a mechanism to share records with all external users)
  3. I can only select one Exam at the time
  4. After proceeding with my exam selection, I should select suggested Date/Time of Exam start. On the screen, I should see what's my current time zone (Tip: based on $User global variable)
  5. Assessment record should be inserted with 'Time Proposed' Status (Tip: probably new field required, if no Status exists yet), where I (customer) am the 'Examinee' (Tip: Consider custom user lookup relationship)

To test this process, we should be able to see it in a form of a custom Lightning Tab inside of our Console App used internally

Suggested Solution

No response

Alternative Solutions

No response

Code of Conduct

TommyStamper commented 1 year ago

@Cornickon

We suggest the following solution:

  1. Add new field to Exam object, 2 solutions: checkbox 'Is Published' or picklist 'Status' with a set of values, that should have the necessary 'Published' value.
  2. Create a new profile with access to new app. The new app could be called 'Console App' for the moment. External user should have read access to object Exam and Create access to object Assessment.
  3. Create Screen flow, where users make choice on a picklist. Picklist values would come from Get Records element that starts before the Screen. Get Record gets all Exam records which have the checkbox 'Is Published' equal True/picklist 'Status' equal to Published. The Picklist should have the option to let users only choose one option (Let Users Select Multiple Options = No).
  4. Place Date/Time field on the Screen that would appear after choosing the Exam.
  5. Flow should Create Record on Assessment object and end.

The proposed solution is still in an early stage. For example step 2 requires more research on how to create correct external user access and step 4 needs to be tested if the default value set to {!$Flow.CurrentDateTime} shows correct Date/Time for the User's timezone.

TommyStamper commented 1 year ago

@Cornickon Prerequirements:

  1. Set Exam and Assessment object Org-wide Default sharing settings as Private for External Access.
  2. Add new field in the Exam object: Checkbox type, "Is Published".
  3. Add new field in the Assessment object: Lookup type (Lookup to the Contact object), Examinee.
  4. Create new App (Console App).
  5. Create Lightning Home Page for the app where the Screen Flow will be placed.
  6. In the app, there is only the aforementioned Lightning Home Page in Navigation Items.
  7. Add needed profiles to the App (see: External User Access.3. below) and Activate the Lightning Home Page as Org Default (could be changed to App Default or App and Profile default if needed).

External User Access:

  1. To meet the future requirements we need to enable Digital Experiences in Setup (Digital Experiences -> Settings -> Enable Digital Experiences).
  2. After enabling Digital Experiences, make sure that "Allow using standard external profiles for self-registration, user creation, and login" is checked (Digital Experiences -> Settings) - this allows us to convert Contacts to Customer User (Enable Customer User).
  3. For testing purposes we created a custom internal profile to test the Flow placed on the Lightning Home Page in the Console App (Assigned App) and assigned Object settings (Read to Exams, Create and Read for Assessments). The profile is also assigned the Run Flows permission (Profile -> App Permissions). a. For future purposes: we cloned Customer Portal Manager Custom and assigned similar permissions, apart from the Assigned App.
  4. Create Criteria Based Sharing Rule on Exams (Criteria: 'Is Published?' Equals True, Share with Test User Role, Access level Read only). a. For future purposes: Create Criteria Based Sharing Rule on Exams (Criteria: 'Is Published?' Equals True, Share with Portal Role, Access level Read only).

Screen Flow:

  1. The Flow should start with a Get Records element that gets all Exam records which have the 'Is Published' checkbox equal True (How Many Records to Store: All Records; How to Store Record Data: Choose fields and let Salesforce do the rest; Select Exam Fields to Store in Variable : ID, Name).
  2. After the Get Records element we should create a Screen element, where the users choose an option from a picklist: a. The picklist displays the Exams from Get Records element - Exams shown are restricted to the Exams that the User has access to due to Org Wide Defaults and Sharing Rules. b. The User can only choose one option (Let Users Select Multiple Options set to No). c. The Picklist Choice Value should be set to Exam ID and Choice Label to Exam Name.
  3. On the Screen element we should also place a Date/Time field with conditional visibility - it should only appear after the User has selected the Exam (Picklist Is Null Equals False).
  4. After the Screen element, before the Flow ends, we should place the Create Records element for the Assessment object, that creates a record using data from the input fields (How Many Records to Create: One; How to Set the Record Fields: Use separate resources, and literal values). a. Examc - Exam ID from Exam chosen on the Screen Element. b. Examineec - User ID. c. Scheduled_Time__c - User Input from Date/Time field on the Screen Element.