Lightning components - Microsoft Solutions

Follow

This is a small component that is shown only on Referrals with Microsoft. Use it to manage the Microsoft Solution records in relation to the current Referral. It can be placed on a Referral page. OOTB is on the Referral Lightning page when Partner ID = Microsoft.

LWC shows a list of MicrosoftSolution__c records (Name in regular font + Solution ID in smaller font below it) that are linked to the current Referral via ReferralMicrosoftSolution__c records.

LWC has an Edit button in the top right corner.

Clicking Edit switches the component into edit mode:

  1. The edit button changes into the Save and Cancel buttons.
  2. A trashcan button appears next to every record in the list; clicking on it removes the record from the list.
  3. Below the list appears a picklist, which is empty by default. The picklist pulls all MicrosoftSolution__c records in the org and displays them as <Name> (<SotutionID__c>) values for selection.
  4. If a value is selected, the selection is added to the list of Solutions above the picklist, and the picklist resets to being empty.
  5. The newly added Solution in the list also has a trashcan button next to it.
  6. When the user clicks Save, the DML operations are performed:
    1. A ReferralMicrosoftSolution__c record is created for every new Solution that is added, linking the current Referral to the selected MicrosoftSolution__c record.
    2. The ReferralMicrosoftSolution__c records corresponding to every Solution that was removed are deleted.

If there are no MicrosoftSolution__c records linked to the current Referral via ReferralMicrosoftSolution__c:

  1. The LWC is rendered in edit mode.
  2. The Save button is disabled.
  3. A message is shown under the header in red: “Please add at least one Solution before the referral can be shared with Microsoft.”

If the Referral has Sourced to Partner = Microsoft and there are no MicrosoftSolution__c records linked to it via ReferralMicrosoftSolution__c, then the Integration Status LWC should display Last Sync From Salesforce Status: Paused, Message: “Referral was not sent to Microsoft because no Solution has been specified.”

0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.