So we have this Aura component that we are trying to convert to LWC. We have less than 10 small components, so we want to standardize to LWC before it grows big.
but we have one Aura component that is utilizing force:recordData's recordUpdated
event that does certain things (i.e. show a tipbox about the next step and whatnot) when a field is updated. As per Salesofrce doc, the LWC counterpart of force:recordData
is some kind of wire service - which could be the getRecordUi
which returns Record UI object, but it does not have the needed recordUpdated
event. The component seats in the Lightning layout, which runs perfectly - i.e. the event is fired when a record is updated using standard page layout.
Do we hit a brick wall here?
The code may not be relevant but I am including those
Component
<aura:component implements="flexipage:availableForAllPageTypes,force:hasRecordId">
<force:recordData aura:id="forceRecord"
recordId="{!v.recordId}"
layoutType="FULL"
recordUpdated="{!c.recordUpdated}" />
</aura:component>
Controller
recordUpdated: function(cmp,event,helper) {
var params = event.getParams();
if(params.changeType === "CHANGED") {
var changedFields = params.changedFields;
if (changedFields['Loan_Type__c'].value = 'Auto Loan') {
//remind user not to forget chattel details, car details, etc.
}
}
}