function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Etienne DKEtienne DK 

Get field values before save (lightning:recordForm // force:recordData)

I'm trying to intercept a record save, grab the new values and do stuff (eg validation or a callout) before saving the record. 

As with most orgs we utilise on page layouts heavily, so they have to be leveraged in this solution.

Using force:recordData one can intercept the save but it does not support rendering, which means you can get the data before save but have to manually specify page layout fields (and security). Clearly not an option for orgs with multiple page layouts.

Using lightning:recordForm the page layouts (and security) are handled by the component (yay) but there is no way to access the field data, as per Page Layout, before save.  Unless I'm missing something?

I did a StackExchange writeup with code examples but no luck so am trying here...

Any ideas?

lightning:recordForm force:recordData lds lightning data service
MagulanDuraipandianMagulanDuraipandian
Check this out - www.infallibletechie.com/2018/06/how-to-validate-data-before-saving-in.html
Etienne DKEtienne DK
Perfect thank you.