How to add Order Number Field in the Create Sales Order Action Dialog
Hi Team,
I have enabled manual number for Sales Order Number but When I am creating sales order from opportunity it is throwing an error as Manual numbering is activated. I think I have to add Order number field in the dialog box. How can I add Order Number field in the Create Sales Order dialog box ?
Page 1 / 1
Hi @Shaify In your instance, Manual Numbering sequence is enabled.
You can enable Auto Numbering sequence, instead adding a SOOrder number in dialog box.
@Shaify If you wanted to work with only Manual Numbering, then it seems it requires a customization that you need to add Sales Order Number on Dialog box and then override the OK button logic to pass this value to the Sales Order Number field.
@Shaify If you wanted to work with only Manual Numbering, then it seems it requires a customization that you need to add Sales Order Number on Dialog box and then override the OK button logic to pass this value to the Sales Order Number field.
Thanks. Can you please provide some steps how can I override OK button method. I am using REST API “entity/Default/18.200.001/Opportunity/CreateOpportunitySalesOrder” to create sales order. Do I need the update the REST API for handling order number field ?
Hi @Shaify,
Try the below work around.
Extend the CreateSalesOrderFilter DAC and add the ordernbr field. Also add the field in aspx.
Include the OrderNbr field on the endpoint Opportunity. It wont allow to add the Field directly on the CreateOpportunitySalesOrder action. You can add new action “Create SalesOrder” under Opportunity and add the OrderNbr Parameter.
Extend the CRCreateSalesOrder_SOOrderEntry graph and override the DoCreateSalesOrder method.
You would need to extend the OpportunityMaint graph and override the action to use the provided order id. You would need to extend the CreateSalesOrderFilter DAC to add the order ID field to it(you may also want to add the field to the smart panel but that won’t affect the API). On the endpoint you would need to also add the order id parameter and map it to the new field you created.
The Rest API maps the parameters to the graph objects(Create Sales Order view in this case) and then just uses the Action handler so you would have to override both.
Hi @Shaify,
Try the below work around.
Extend the CreateSalesOrderFilter DAC and add the ordernbr field. Also add the field in aspx.
Include the OrderNbr field on the endpoint Opportunity. It wont allow to add the Field directly on the CreateOpportunitySalesOrder action. You can add new action “Create SalesOrder” under Opportunity and add the OrderNbr Parameter.
Extend the CRCreateSalesOrder_SOOrderEntry graph and override the DoCreateSalesOrder method.
Thanks. Can you please provide some steps how can I extend CreateSalesOrderFilter DAC
You would need to extend the OpportunityMaint graph and override the action to use the provided order id. You would need to extend the CreateSalesOrderFilter DAC to add the order ID field to it(you may also want to add the field to the smart panel but that won’t affect the API). On the endpoint you would need to also add the order id parameter and map it to the new field you created.
The Rest API maps the parameters to the graph objects(Create Sales Order view in this case) and then just uses the Action handler so you would have to override both.
Thanks. Can you please provide some steps how can I extend CreateSalesOrderFilter DAC
Hi @Shaify
Customization Projects → Data Access - > Select the DAC name
Click the Create New field button and add the new field ordernbr (NonPersistedField)
Publish the package
Customize the Opportunity screen - > Add the field on the popup.
Then only you can add the field on the endpoint (if required)
Attached Sample customization
Hi @Shaify
Customization Projects → Data Access - > Select the DAC name
Click the Create New field button and add the new field ordernbr (NonPersistedField)
Publish the package
Customize the Opportunity screen - > Add the field on the popup.
Then only you can add the field on the endpoint (if required)
Attached Sample customization
Thanks. I have added OrderNo field
Just wanted to know how can I access this property inside the Graph extension method
Hi @Shaify
Can you please try like below,
Refer the DoCreateSalesOrder code from the CRCreateSalesOrder_SOOrderEntry graph to create the Order.
Use CreateSalesOrderFilter extn DAC to get the OrderNbr field.
public class OpportunityMaint_Extension : PXGraphExtension<OpportunityMaint> { public class CRCreateSalesOrderExtn : CRCreateSalesOrderExt { public virtual void _(Events.RowSelected<CROpportunity> e) { CROpportunity row = e.Row as CROpportunity; if (row == null) return;