function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
theWebDevtheWebDev 

Unable to add "Email Opt Out" to page layout in sandbox, so can't access via Partner WSDL

Hello,

 

I am unable to add the field "Email Opt Out" (API name "HasOptedOutOfEmail") to our Lead page layout in our Sandbox environment.  The strange thing is, when i click "Edit Layout" and attempt to add "Email Opt Out" to the layout, it appears in the layout editing view as it should along with the rest of the fields, but when I save it, it does not show up in the actual layout.

 

This is causing problems during development because my orginization is using the Partner WSDL, and as such we can only access object fields that are in the page layout for that object.  So "Email Opt Out" does not exist as a valid field in the WSDL, and when I try to create or update a Lead with a value in the "HasOptedOutOfEmail" API field, I get a INVALID_FIELD_FOR_INSERT_UPDATE exception.

 

Any ideas, or anyone run into this before?  I would appreciate any help, except for just saying "well then just use the Enterprise client!" -- this is not feasible in our organization right now because our entire Salesforce library was written to use the Partner API.

 

Thank you!

SB

Best Answer chosen by Admin (Salesforce Developers) 
theWebDevtheWebDev
It turns out that the problem was due to the fact that the field's accessibility level was set to "hidden," which removed it from the page layout and also from the WSDL.  Sigh.  Won't be making that mistake again!

All Answers

theWebDevtheWebDev

Any ideas out there?

 

Thanks!

MaxiMizeMaxiMize
Have you checked to make sure you're using the correct profile?  That would seem to be the most logical place to start...
SuperfellSuperfell
Unless you have professional edition, the page layout has no effect on API access. (and it seems unlikely that you have PE if you have sandbox)
theWebDevtheWebDev
It turns out that the problem was due to the fact that the field's accessibility level was set to "hidden," which removed it from the page layout and also from the WSDL.  Sigh.  Won't be making that mistake again!
This was selected as the best answer
Debra YoffieDebra Yoffie
The Email Opt Out field does not appear in our Lead Layout even though I have set the field usage to Active AND have customized my Lead Page Layouts by adding and saving the Email Opt Out field to my Lead Layout pages.