Trying to update a formula field of table row when a reference field is updated

I have the formula field, the formula field is RepositoryProduct__r.Available_Qty__c. I referred this link, https://community.skuid.com/t/update-a-formula-field-if-lookup-value-changes-on-table-row, it updates the formula field before save when reference field changes