I am displaying a custom field through a lightning output field, this works great until I update the field value through Apex. (I am using a modal and a combo box to achieve this) The field is successfully updating, however I have to refresh the page for the lightning output field to update as well.
Is there any way to update the lightning output field without having to update the page? I'll leave a bit of my code below for reference. I can also post more if it would help.
HTML:
<lightning-record-view-form
record-id={recordId}
object-api-name="Project_Contact__c">
<div class="slds-grid slds-gutters slds-align_absolute-center">
<div class="slds-col slds-size_1-of-5">
<div class="slds-grid slds-gutters slds-grid_vertical-align-center">
<div class="slds-col slds-size_1-of-2 slds-text-align_right">
<lightning-output-field field-name="Mobile_Status__c" variant="label-hidden"></lightning-output-field>
<lightning-output-field field-name="Mobile_Status_Date_Time__c" variant="label-hidden"></lightning-output-field>
</div>
</div>
</div>
</div>
</lightning-record-view-form>
APEX:
if(!String.isBlank(phoneWrapper.phoneStatus))
{
projectContact.Mobile_Status__c = phoneWrapper.phoneStatus;
projectContact.Mobile_Status_Date_Time__c = DateTime.now();
update projectContact;
}