SAP Knowledge Base Article - Public

3605284 - "Sales Area not valid based on Organizational Structure, Field value validation failed" Error When Creating Lead using PDI Code

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

  1. Go to the Sales work center.
  2. Go to the Leads view.
  3. Click in the + icon.
  4. Fill in the required fields.
  5. Click in the Save button.
  6. 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

Product

SAP Cloud for Customer add-ins all versions ; SAP Cloud for Customer core applications all versions