• Virginia Leandro 27
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
We have multiple Record Types on the Case object.  We also have folks who work across Record Types (they're not just tied to a single Record Type).

I tried writing a Lightning Web Component to bubble up the Record Type name so Staff know if they're working with a record that is RecordType1, RecordType2, or RecordType3.

While I can pull other pieces of data from the Case object (such as Case Number, and Contact), I can't seem to expose the name of the Record type.  Any ideas?  I'm pretty new to development so I've been trying to cobble something together and would appreciate any insight / thoughts and help!

Here's my code snippets.

recordTypeForCase.js
import { LightningElement, api } from 'lwc';

export default class HelixITSMType extends LightningElement {
    @api recordId; // Case Id
}

RecordTypeForCase.html​​​​​​​
<template>
    <lightning-card class="slds-text-title_bold" title="Record Type" icon-name="standard-people">
        <div class="slds-m-around_medium">
        <!-- Show Helix ITSM Record Type when Case is loaded -->
            <lightning-record-view-form record-id={recordId} object-api-name="Case">
                <div class="slds-grig">
                    <div class="slds-col slds-size_1-of-2">
                        <lightning-output-field field-name="CaseNumber"></lightning-output-field>
                        <lightning-output-field field-name="RecordTypeId"></lightning-output-field>
                        <lightning-output-field field-name="ContactId"></lightning-output-field>
                    </div>
                </div>
            </lightning-record-view-form>
        </div>
     </lightning-card>   
</template>

Thank you in advance for your help and advice.  

Virginia