0
votes

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.

1

1 Answers

0
votes

You can change default value for Status field using Automation Steps.

On your JustCreated step, Select the Actions Tab.

On your Actions Tab, Select the row marked as "IsDefault".

Then click on the "Fill With Values" button.

On Fill With Values popup set the Status field to desire default status ("Open").

Then close popup and Save.

enter image description here

Result:

enter image description here