Loading

Consumer Goods Cloud: "You can't assign the Sales Organization to your profile" error when updating User.cgcloud__Sales_Org__c

Publish Date: May 26, 2026
Description

This article explains why updating the Sales Organization on an existing user fails in Consumer Goods Cloud and how to resolve it using the supported assignment workflow. Customers describe this as: "When updating Sales Organization = 5280 on existing user, the process triggers a validation message: 'You can't assign the Sales Organization to your profile.'" and "if Modify All Data is granted via a Permission Set instead of the profile, the update still fails." The exact error returned by the cgcloud managed package is "FIELD_CUSTOM_VALIDATION_EXCEPTION: You can't assign the Sales Organization to your profile." Trigger conditions: the error occurs only when updating the Sales Organization [cgcloud__Sales_Org__c] field on an existing User record (not at user creation), when the executing or target user's Profile does not have the Modify All Data permission enabled directly on the Profile. Debug logs show the cgcloud.UserTrigger executes "SELECT Id, PermissionsModifyAllData FROM Profile WHERE Id = :tmpVar1" and "SELECT Sales_Organization__r.Name FROM Sales_Organization_User__c WHERE User__c = :tmpVar1", then aborts before any DML — confirming the package checks Profile-level permissions, not effective permissions from Permission Sets. Affected editions: Lightning Experience in Professional, Enterprise, and Unlimited Editions with Consumer Goods Cloud enabled. Affected profiles include CGCloud_User_Profile_Standard, CGCloud_User_Profile, and any custom profile cloned from these without Modify All Data.

Resolution

Do not grant Modify All Data on the Profile to bypass this validation. Instead, assign the Sales Organization to the user through the Sales Organization related list, which is the supported workflow.

Cause 1: Sales Organization being updated directly on the User record

  1. Confirm the admin performing the assignment has the CGCloud Business Admin or CGCloud Retail Business Admin permission set assigned. Navigate to Setup > Users > Users > [Admin User] > Permission Set Assignments and verify the assignment.
  2. From the App Launcher, find and select Sales Organization.
  3. Select the target Sales Organization record (for example, the one with Name = 5280).
  4. On the Sales Organization detail page, scroll to the User [Sales_Organization_User__c] related list and click New.
  5. In the new Sales Organization User [Sales_Organization_User__c] record, set Sales Organization [Sales_Organization__c] to the desired sales org and User [User__c] to the existing user.
  6. Populate Default Visit Template, Default Customer, Work Begins, Work Ends, and the Works on <Day> checkboxes as required by your business.
  7. Click Save.
  8. Return to Setup > Users > Users > [Target User] and open the user record.
  9. In the Additional Attributes section, set Sales Organization [cgcloud__Sales_Org__c] to the value just assigned. The picklist now lists the sales orgs the user is mapped to and the update succeeds without the validation error. The Language Postfix populates automatically based on the Sales Organization.
  10. Click Save.

Cause 2: Custom integration or API user updating cgcloud__Sales_Org__c directly

  1. Refactor the integration to insert a Sales Organization User [Sales_Organization_User__c] record (with User__c and Sales_Organization__c populated) before updating User.cgcloud__Sales_Org__c.
  2. Assign the integration user the CGCloud Business Admin permission set via Setup > Permission Sets > CGCloud Business Admin > Manage Assignments > Add Assignment.
  3. If the integration also writes to other cgcloud objects, also assign Lightning Retail Execution Starter and the Lightning Retail Execution Starter Psl permission set license.

Confirm the issue is resolved by reopening the target user's record at Setup > Users > Users > [Target User], changing Sales Organization [cgcloud__Sales_Org__c] to a value the user is mapped to via a Sales Organization User record, and saving — the save completes without the "You can't assign the Sales Organization to your profile" error.

Knowledge Article Number

005385048

 
Loading
Salesforce Help | Article