Force refresh calc fields


I am trying to refresh calc fields on one specific id of BillingAccount on a remote env that has 21 million pending jobs in the CalcFieldsQueue. Is there a way to force that one job to the front of the queue, i.e. skip all other pending jobs?


Checkout RefreshCalcFieldsSpec.

You can set async to be false, so it will be calculated synchronously.

Or you can set the priority to be higher than other jobs in the queue.


You may want to look into CalcFieldsQueue.rescheduleByType(). It takes a % value as a threshold and moves all entries for a certain type into BatchQueue where they are computed much more efficiently.


See the type FetchSpec.

BillingAccount.fetch({filter: Filter.eq("id", 'your_id'), refreshCalcFields: true, calcFieldsToRefresh: ['theFieldToRecalc']})


Thanks guys. This command worked for me:

BillingAccount.refreshCalcFields({filter: Filter.eq("id", 'my_id'), async: false, calcFieldsToRefresh: ['theFieldToRecalc']})