Populate custom field while creating sale order from opportunity

后端 未结 1 820
滥情空心
滥情空心 2021-01-28 09:28

I have created a custom field Contact on SO screen (SO301000). Now I need to populate these field when user Create Sales Order from Opportunity screen (CR304000). New custom fie

相关标签:
1条回答
  • 2021-01-28 09:59

    Similar answer found here: How to pass line item custom field value to sales order from opportunity?

    Can be translated to something like this from CROpportunity to SOOrder...

    public class CROpportunityMaintExtension : PXGraphExtension<OpportunityMaint>
    {
        [PXOverride]
        public virtual void DoCreateSalesOrder(Action del)
        {
            PXGraph.InstanceCreated.AddHandler<SOOrderEntry>(graph =>
            {
                graph.RowInserting.AddHandler<SOOrder>((cache, args) =>
                {
                    var soOrder = (SOOrder)args.Row;
                    CROpportunity opportunity = PXResult<CROpportunity>.Current;
    
                    // Copy logic here...
    
                });
            });
    
            del();
        }
    }
    
    0 讨论(0)
提交回复
热议问题