Symptom
You are using PDI code to affect lead creation and you face the error "Sales Area not valid based on Organizational Structure, Field value validation failed"; you wonder why.
Environment
SAP Cloud for Customer
Reproducing the Issue
- Go to the Sales work center.
- Go to the Leads view.
- Click in the + icon.
- Fill in the required fields.
- Click in the Save button.
- Message appears.
Cause
Most likely there is a PDI script event BeforeSave or AfterModify which tries to create sales arrangement data without a Distribution Channel.
Code exampe:
if (SalesOrg.IsSet())
{
salesArrangmntData.SalesOrganisationUUID = SalesOrg.UUID;
}
This causes the observed error, as Distribution Channel is mandatory for a Sales Arrangement.
Resolution
Distribution Channel field is mandatory when creating a Sales Arrangement.
See Also
KBA 2893401 - Error 'Sales area not valid based on organizational structure' Occurs when Convert Lead to Opportunity
Keywords
Sales, Arrangement, Lead, PDI, Custom, Code, Sales, Area, not, valid, based, on, Organizational, Structure, Field, value, validation, failed, salesArrangmntData.SalesOrganisationUUID, SalesOrg.IsSet() , KBA , LOD-CRM-LM , Lead Management , Problem
SAP Knowledge Base Article - Public