I am trying to use the Salesforce Object Query Language (SOQL), and the Salesforce Object Describe API to import the objects and fields data into my JavaScript file. I am a bit lost on where to start, as I don't know if I am retrieving the object metadata correctly. Also for SOQL would this be done in my JavaScript file? I don't know where to start with SOQL, since I am unsure If I am getting any metadata from my object.
Here's my code for the Salesforce Object Describe API
// Importing Opportunity object and fields metadata.
import { getObjectInfo } from 'lightning/uiObjectInfoApi';
import OPPORTUNITY_OBJECT from '@salesforce/schema/Opportunity';
// -----------------------------------------------------------------------------
export default class Mapping extends LightningElement {
@wire(getObjectInfo, { objectApiName: OPPORTUNITY_OBJECT })
propertyOrFunction;
Question on my code: I guess my question for this is if I am missing anything when using the wire adapter to get metadata for my object? Also which variable is the metadata stored in? is it the 'OPPORTUNITY_OBJECT' or 'propertyOrFunction'?
My Output for 'propertyOrFunction'