I have tried setting the status to default by the following ways, but none of it seems working. I saw that value is controlled in automation, but not sure how to default this value to 'Open'
Field defaulting
protected virtual void CROpportunity_Status_FieldDefaulting(PXCache sender, PXFieldDefaultingEventArgs e, PXFieldDefaulting del)
{
if (e.Row == null) return;
if (del != null) del(sender, e);
e.NewValue = OpportunityStatusAttribute._OPEN;
e.Cancel = true;
}
Row inserted
protected virtual void CROpportunity_RowInserted(PXCache cache, PXRowInsertedEventArgs e,PXRowInserted del)
{
if (e.Row == null) return;
if (del != null) del(cache, e);
cache.SetValueExt<CROpportunity.status>(e.Row, OpportunityStatusAttribute._OPEN);
}
automation step 'Just created' > Fields > Status Default value.
automation step 'New' > Fields > Status Default value.

