You need to sign in to do that
Don't have an account?
Shivani Tanwar 6
unknown exception when deploying lwc code to org
I am trying to show stage picklist values of opportunity object through lwc but iit shows error unlnown exception when i deploy code to org
here is my code
<template>
<div class="side-box">
<template if:true={StageValues.data}>
<lightning-combobox value={value} label="Opportunity Stage" onchange={handleChange} options={stageValues.data.values}
name="progress"> </lightning-combobox>
</template>
</div>
</template>
import OPPORTUNITY_OBJECT from '@salesforce/schema/Opportunity';
import { getPicklistValues } from 'lightning/uiObjectInfoapi';
import Stage from '@salesforce/schema/Opportunity.StageName';
import { getObjectInfo } from 'lightning/uiObjectInfoapi';
import { wire } from 'lwc';
export default class LwcPicklistOppor extends LightningElement {
@wire(getObjectInfo, { objectApiName : Opportunity_OBJECT})
opportunityinfo;
@wire(getPicklistValues,
{
recordTypeId: '$opportunityinfo.data.defaultRecordTypeId',
fieldApiName: Stage
}
)
StageValues;
}
here is my code
<template>
<div class="side-box">
<template if:true={StageValues.data}>
<lightning-combobox value={value} label="Opportunity Stage" onchange={handleChange} options={stageValues.data.values}
name="progress"> </lightning-combobox>
</template>
</div>
</template>
import OPPORTUNITY_OBJECT from '@salesforce/schema/Opportunity';
import { getPicklistValues } from 'lightning/uiObjectInfoapi';
import Stage from '@salesforce/schema/Opportunity.StageName';
import { getObjectInfo } from 'lightning/uiObjectInfoapi';
import { wire } from 'lwc';
export default class LwcPicklistOppor extends LightningElement {
@wire(getObjectInfo, { objectApiName : Opportunity_OBJECT})
opportunityinfo;
@wire(getPicklistValues,
{
recordTypeId: '$opportunityinfo.data.defaultRecordTypeId',
fieldApiName: Stage
}
)
StageValues;
}
Replace JS file with following code
import {LightningElement, wire } from 'lwc';
import OPPORTUNITY_OBJECT from '@salesforce/schema/Opportunity';
import { getPicklistValues } from 'lightning/uiObjectInfoapi';
import Stage from '@salesforce/schema/Opportunity.StageName';
import { getObjectInfo } from 'lightning/uiObjectInfoapi';
export default class LwcPicklistOppor extends LightningElement {
@wire(getObjectInfo, { objectApiName : Opportunity_OBJECT})
opportunityinfo;
@wire(getPicklistValues,
{
recordTypeId: '$opportunityinfo.data.defaultRecordTypeId',
fieldApiName: Stage
}
)
StageValues;
}
In Your Js File On Top One Line Is Missing Copy Paste The Below Line In Your Js File On Top It Should Be The First Line Of Your Js File Please Mark it As Best Answer if It Helps
Thank You!
In Your JAVASCRIPT file you LightningElement before wire import line i already correct that you just have to copy and paste the code.
here is my code
If you find your answer please mark as best answer.
Thanks And Regards,
Suraj Tripathi.