You need to sign in to do that
Don't have an account?
Stéphane C.
Add the new lightning "picklistPath" component to work order
Hi,
I try to add the new lightning "picklistPath" component to work order.
I write the code to cmp :
I write this code to js :
I can't find what it is wrong.
I am inspiring from this webinar : https://youtu.be/WsVW5qU4XWI?t=35m24s
I try to add the new lightning "picklistPath" component to work order.
I write the code to cmp :
<aura:componentimplements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId"> <force:recordData aura:id="propertyService" recordId="{!v.recordId}"targetFields="{!v.WorkOrder}" layoutType="FULL" mode="EDIT" /> <div class="slds-card"> <lightning:picklistPath aura:id="picklistPath" recordId="{!v.recordId}" variant="non-linear" picklistFieldApiName="Status" onselect="{!c.handleSelect}"> </lightning:picklistPath> </div> </aura:component>
I write this code to js :
({ handleSelect : function (component, event, helper) { var stepName = event.getParam("detail") .value; component.set("v.WorkOrder.Status", stepName); component.find("v.propertyService") .saveRecord($A.getCallback(function(result) { console.log(result.state); if (result.state === "SUCCESS" || result.state === "DRAFT") { var toastEvent = $A.get("e.force:showToast"); toastEvent.setParams({ "title": "Success!", "message": "Le statut de l'intervention a été mis à jour à " + stepName + ".", "type": "succes" }); toastEvent.fire(); } })) } })
I can't find what it is wrong.
I am inspiring from this webinar : https://youtu.be/WsVW5qU4XWI?t=35m24s
AIain
All Answers
You find an aura:id not an attribute here so you don't need the
v.component.find("propertyService")
... and your code will work perfectly.
Did you test it on WorkOrder? It's not working for me (with your recommendations too)
Any idea? Perhaps it doesn't work on this satndard object.
When I change the picklist value, the path change. But when I click on a path value, the picklist value don't change.
I have also a stange behaviour when I change the picklist value, the path values before the selected one don't pass to green.
AIain
Now the update is OK.
Alain
Just miss the color on the path to be changed (green before the active value) and on the toaster (green).
Strange error indeed.
Your case was interesting.
Alain
On the webinar it's working.
Thanks, SNR