You need to sign in to do that
Don't have an account?
getObjectInfos is not working
I have a basic coding about getObjectInfos adapter but it seems not working:
Thank you so much.
import { LightningElement, wire } from 'lwc'; import { getObjectInfos } from 'lightning/uiObjectInfoApi'; import ACCOUNT_OBJECT from '@salesforce/schema/Account'; import OPPORTUNITY_OBJECT from '@salesforce/schema/Opportunity'; export default class GetObjectInfosLwc extends LightningElement { @wire(getObjectInfos, {objectApiName:[ACCOUNT_OBJECT, OPPORTUNITY_OBJECT]}) objectInfosHandler({data, error}) { if(data) { console.log("Get Multiple " + data) } if(error) { console.error(error) } } }and here is the Browser Console log:
beaconLib.BeaconLibrary.js:37 {InstrumentationResult : ( RECEIVED = 14 , SUCCESS -> LOG = 14 , Topic = AILTN ) , TracingResponse : ( AsyncResults ) , TelemetryResponse : ( AsyncResults ): {…}}As you can see, it doesn't print the list of metadata (for Account and Opportunity). I need some help!
Thank you so much.
when requesting for multiple object infos, you should use 'objectApiNames' It will work . Also i would suggest to use JSON.stringify(data) to print values in console. Thanks
Surya G
All Answers
when requesting for multiple object infos, you should use 'objectApiNames' It will work . Also i would suggest to use JSON.stringify(data) to print values in console. Thanks
Surya G
What a critical mistake from me!!!
Thank you for your support, hope you doing well bro.