Please bear with me as I am very new to Acumatica.
In Acumatica (2020.4) we are calling an external REST Web service once a Project is created. The API returns an ID that we want to store in a custom field. However we cannot do this on the Row Persisting as we have queries that run that requires data in the table.
How can we update the field and save that value once the Row Persisted event has been triggered or is there an alternative to calling data in the Row Persisting event?
This is what we have so far, but it only sets the value in the field.
protected void PMProject_RowPersisted(PXCache cache, PXRowPersistedEventArgs e)
{
var row = (PMProject)e.Row;
// API Class that we call
APICall.APIResult Rateres = new APICall.APIResult();
Contract ctr = e.Row as Contract;
ContractExt ctrExt = ctr.GetExtension<ContractExt>();
Rateres.RateCalc(row.RateTableID);
cache.SetValue<ContractExt.usrAPIRateID>(ctr, Rateres.contentid);
}
Thanks in advance.