You need to sign in to do that
Don't have an account?
Vanitha Mani
lightning combobox issue in regreshing and saving
if the value of product chnages inside form but still combobox is not refreshing to new values and i need to submit the value to case object..i need to save the selected value in combobox to failure point lookup field in case..
<lightning:recordEditForm recordId ="{!v.recordId}" objectApiName = "Case" aura:id="leadCreateForm1" onload="{!c.Onload}" onsubmit="{!c.handleSubmitForm}" >
<lightning:messages />
<lightning:inputField aura:id="newOpportunityField" fieldName="Solution__c" required ="true"/>
<lightning:layout horizontalAlign="left">
<lightning:layoutItem size="12">
<lightning:inputField aura:id="newOpportunityField" fieldName="Product_Build__c" required ="true" onchange="{!c.productchanged}" />
<a href="javascript:void(0)" iconPosition ="right" onclick="{!c.changeprod}">Change</a>
<aura:if isTrue ="{!v.openmodal2}">
<div role="dialog" aura:id="Modalbox6" class="slds-modal slds-fade-in-open ">
<div class="slds-modal__container">
<div class="slds-modal__header">
<h1 class="slds-text-heading--medium">Change Product Build</h1>
</div>
<!--Modal Box Header-->
<div class="slds-modal__content slds-p-around--medium">
<center> <p><b>
<iframe src ="{!'/apex/SVC_Product_Build_Incident_Link?id='+v.recordId+'&source=SVC_Product_Build__c&type=ticket'}" width="100%" height="500px;" frameBorder="0"/>
</b>
</p></center>
</div>
<!--Modal Box Button-->
<div class="slds-modal__footer">
<button class="slds-button slds-button--brand" onclick="{!c.closing}">Close</button>
</div>
</div>
</div>
<div class="slds-backdrop slds-backdrop--open" aura:id="Modalbackdrop6">
</div>
</aura:if>
</lightning:layoutItem>
</lightning:layout>
<lightning:layout horizontalAlign="left">
<lightning:layoutItem size="12">
<lightning:inputField aura:id="newOpportunityField" fieldName="System_Version__c" required ="true" onchange="{!c.productChanged}"/>
<a href="javascript:void(0)" iconPosition ="left">Change</a>
<aura:if isTrue ="{!v.openmodal4}">
<div role="dialog" aura:id="Modalbox8" class="slds-modal slds-fade-in-open ">
<div class="slds-modal__container">
<div class="slds-modal__header">
<h1 class="slds-text-heading--medium">Change System Version</h1>
</div>
<!--Modal Box Header-->
<div class="slds-modal__content slds-p-around--medium">
<center> <p><b>
<iframe src ="{!'/apex/SVC_Product_Build_Link?id='+v.recordId+'&source=SVC_Product_Build__c&type=ticket'}" width="100%" height="500px;" frameBorder="0"/>
</b>
</p></center>
</div>
<!--Modal Box Button-->
<div class="slds-modal__footer">
<button class="slds-button slds-button--brand" onclick="{!c.closing1}">Close</button>
</div>
</div>
</div>
<div class="slds-backdrop slds-backdrop--open" aura:id="Modalbackdrop8">
</div>
</aura:if>
</lightning:layoutItem>
</lightning:layout>
<lightning:combobox aura:id="selectItem" fieldName="Feature_Function__c" label="Failure Point"
placeholder="Choose Failure Point"
value="name"
required="true"
dropdownAlignment="right"
variant="standard"
messageWhenValueMissing="Complete this field"
onchange="{!c.handleOptionSelected}"
options="{!v.featureOptions}"/>
<lightning:inputField aura:id="newOpportunityField" fieldName="SolvedBy__c" required ="true" />
<lightning:inputField aura:id="newOpportunityField" fieldName="CauseCodeCategory__c" required ="true" />
<lightning:inputField aura:id="newOpportunityField" fieldName="CauseCodeDetail__c" required ="true"/>
<br/>
<br/>
<br/>
<br/>
<br/><br/>
</aura:if>
</lightning:recordEditForm>
controller:
handleOptionSelected : function(component,event,helper){
var selectedOptionValue = event.getParam("value");
let ticket = component.get("v.ticket.Feature_Function__c");
ticket = selectedOptionValue;
component.set("v.ticket.Feature_Function__c",ticket);
}
failurePointList: function(component, event, helper) {
var productid = component.get("v.ticket.Product__c");
var action = component.get("c.getFeatureFunction");
if(productid != 'undefined' && productid !=null){
action.setParams({
productId: productid
});
action.setCallback(this,function(response){
var res = response.getReturnValue();
console.log('template object::'+JSON.stringify(response.getReturnValue()));
var state = response.getState();
if(state == "SUCCESS"){
var lables= [];
res.forEach(function(key) {
lables.push({"label":key.Name ,"value":key.Id});
});
component.set("v.featureOptions", lables);
}
});
$A.enqueueAction(action);
}
}
i am submitting the fields when i click next button likr
event.preventDefault();
var eventFields = event.getParam("fields");
component.find('leadCreateForm1').submit(eventFields);
<lightning:recordEditForm recordId ="{!v.recordId}" objectApiName = "Case" aura:id="leadCreateForm1" onload="{!c.Onload}" onsubmit="{!c.handleSubmitForm}" >
<lightning:messages />
<lightning:inputField aura:id="newOpportunityField" fieldName="Solution__c" required ="true"/>
<lightning:layout horizontalAlign="left">
<lightning:layoutItem size="12">
<lightning:inputField aura:id="newOpportunityField" fieldName="Product_Build__c" required ="true" onchange="{!c.productchanged}" />
<a href="javascript:void(0)" iconPosition ="right" onclick="{!c.changeprod}">Change</a>
<aura:if isTrue ="{!v.openmodal2}">
<div role="dialog" aura:id="Modalbox6" class="slds-modal slds-fade-in-open ">
<div class="slds-modal__container">
<div class="slds-modal__header">
<h1 class="slds-text-heading--medium">Change Product Build</h1>
</div>
<!--Modal Box Header-->
<div class="slds-modal__content slds-p-around--medium">
<center> <p><b>
<iframe src ="{!'/apex/SVC_Product_Build_Incident_Link?id='+v.recordId+'&source=SVC_Product_Build__c&type=ticket'}" width="100%" height="500px;" frameBorder="0"/>
</b>
</p></center>
</div>
<!--Modal Box Button-->
<div class="slds-modal__footer">
<button class="slds-button slds-button--brand" onclick="{!c.closing}">Close</button>
</div>
</div>
</div>
<div class="slds-backdrop slds-backdrop--open" aura:id="Modalbackdrop6">
</div>
</aura:if>
</lightning:layoutItem>
</lightning:layout>
<lightning:layout horizontalAlign="left">
<lightning:layoutItem size="12">
<lightning:inputField aura:id="newOpportunityField" fieldName="System_Version__c" required ="true" onchange="{!c.productChanged}"/>
<a href="javascript:void(0)" iconPosition ="left">Change</a>
<aura:if isTrue ="{!v.openmodal4}">
<div role="dialog" aura:id="Modalbox8" class="slds-modal slds-fade-in-open ">
<div class="slds-modal__container">
<div class="slds-modal__header">
<h1 class="slds-text-heading--medium">Change System Version</h1>
</div>
<!--Modal Box Header-->
<div class="slds-modal__content slds-p-around--medium">
<center> <p><b>
<iframe src ="{!'/apex/SVC_Product_Build_Link?id='+v.recordId+'&source=SVC_Product_Build__c&type=ticket'}" width="100%" height="500px;" frameBorder="0"/>
</b>
</p></center>
</div>
<!--Modal Box Button-->
<div class="slds-modal__footer">
<button class="slds-button slds-button--brand" onclick="{!c.closing1}">Close</button>
</div>
</div>
</div>
<div class="slds-backdrop slds-backdrop--open" aura:id="Modalbackdrop8">
</div>
</aura:if>
</lightning:layoutItem>
</lightning:layout>
<lightning:combobox aura:id="selectItem" fieldName="Feature_Function__c" label="Failure Point"
placeholder="Choose Failure Point"
value="name"
required="true"
dropdownAlignment="right"
variant="standard"
messageWhenValueMissing="Complete this field"
onchange="{!c.handleOptionSelected}"
options="{!v.featureOptions}"/>
<lightning:inputField aura:id="newOpportunityField" fieldName="SolvedBy__c" required ="true" />
<lightning:inputField aura:id="newOpportunityField" fieldName="CauseCodeCategory__c" required ="true" />
<lightning:inputField aura:id="newOpportunityField" fieldName="CauseCodeDetail__c" required ="true"/>
<br/>
<br/>
<br/>
<br/>
<br/><br/>
</aura:if>
</lightning:recordEditForm>
controller:
handleOptionSelected : function(component,event,helper){
var selectedOptionValue = event.getParam("value");
let ticket = component.get("v.ticket.Feature_Function__c");
ticket = selectedOptionValue;
component.set("v.ticket.Feature_Function__c",ticket);
}
failurePointList: function(component, event, helper) {
var productid = component.get("v.ticket.Product__c");
var action = component.get("c.getFeatureFunction");
if(productid != 'undefined' && productid !=null){
action.setParams({
productId: productid
});
action.setCallback(this,function(response){
var res = response.getReturnValue();
console.log('template object::'+JSON.stringify(response.getReturnValue()));
var state = response.getState();
if(state == "SUCCESS"){
var lables= [];
res.forEach(function(key) {
lables.push({"label":key.Name ,"value":key.Id});
});
component.set("v.featureOptions", lables);
}
});
$A.enqueueAction(action);
}
}
i am submitting the fields when i click next button likr
event.preventDefault();
var eventFields = event.getParam("fields");
component.find('leadCreateForm1').submit(eventFields);