• Gaikwad
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
Hi,
 
I need to update User Object details from a VisualForce Page. But after clicking 'Save' button, the fields are not getting updated and I am gettting this error message :
 
"Update failed. First exception on row 0; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, You cannot update a customizable setup entity, except when running tests"
 
 
I have created a separate custom controller and I have included all the fields that are mandatory to create an User Object. Below I have included the page editor and controller code. Can we actually update an User Object from a custom controller and if it is possible, why am I geeting this error message? Please anybody have any suggestions for my issue...
 
 

<apex:page controller="EditUser" sidebar="false" tabstyle="User">

<apex:form>

<apex:pageBlock title="Edit User">

<apex:dataList value="{!EditUserItems}" var="EditUser">


<apex:pageBlockSection title="User Information" columns="2">


<apex:pageBlockSectionItem>

<apex:outputLabel value="Title" />

<apex:outputLabel value="{!EditUser.Title}" id="txtTitle" />

</apex:pageBlockSectionItem>


<apex:pageBlockSectionItem>

<apex:outputLabel value="Last Name" />

<apex:inputField value="{!EditUser.LastName}" id="txtLastName" />

</apex:pageBlockSectionItem>


<apex:pageBlockSectionItem>

<apex:outputLabel value="Alias" />

<apex:inputField value="{!EditUser.Alias}" id="txtAlias" />

</apex:pageBlockSectionItem>


<apex:pageBlockSectionItem>

<apex:outputLabel value="User Name" />

<apex:inputField value="{!EditUser.UserName}" id="txtUserName" />

</apex:pageBlockSectionItem>


<apex:pageBlockSectionItem>

<apex:outputLabel value="Email" />

<apex:inputField value="{!EditUser.Email}" id="txtUserEmail" />

</apex:pageBlockSectionItem>


<apex:pageBlockSectionItem>

<apex:outputLabel value="Role" />

<apex:inputField value="{!EditUser.UserRole.Name}" id="txtRole" />

</apex:pageBlockSectionItem>


<apex:pageBlockSectionItem>

<apex:outputLabel value="Profile" />

<apex:inputField value="{!EditUser.Profile.Name}" id="txtProfile" />

</apex:pageBlockSectionItem>


<apex:pageBlockSectionItem>

<apex:outputLabel value="Phone" />

<apex:inputField value="{!EditUser.Phone}" id="txtUserPhone" />

</apex:pageBlockSectionItem>




</apex:pageBlockSection>

</apex:dataList>

<apex:pageBlockButtons id='pgeblkbtn'>

<apex:commandButton action="{!save}" value="Save" id='btnSave' />

<input type="button" value="Cancel" class="btn" id="btnCancel" OnClick="javaScript:window.parent.location.href='https://na5.salesforce.com/apex/UserList?sfdc.tabName=01r700000001mhF&sfdc.motif=Custom96'" />

</apex:pageBlockButtons>


</apex:pageBlock >

</apex:form>

</apex:page>

 

 

 

 

 

Controller Code:

 

public class EditUser

{

List<User> euser;


public PageReference save()

{

update euser;

PageReference UserPage = new PageReference('https://na5.salesforce.com/apex/UserList?sfdc.tabName=01r700000001mhF&sfdc.motif=Custom96');

UserPage.setRedirect(true);

return UserPage;

}

public PageReference cancel()

{

PageReference homePage = new PageReference('https://na5.salesforce.com/apex/UserList?sfdc.tabName=01r700000001mhF&sfdc.motif=Custom96');

homePage.setRedirect(true);

return homePage;

}

public List<User> getEditUserItems()

{

if(euser == null) {

euser=[select Id,Title,LastName,Alias,UserName,Email,CompanyName,Phone,Profile.Name,UserRole.Name from User where Id = : System.currentPageReference().getParameters().get('uid')];

}

return euser;

}

}

 
 
Hi All,
 
We have an integration system that has been running for more than 2 years without any problems. The system creates contacts / leads...etc via the API.
 
Two days ago we started getting the XML response below everytime we try to create leads....the message says: :insufficient access rights on cross-reference id
 
Did something chnage in the API recently ? our code hasnt been updated for two years...would it be some new permissions ?
 
Thanks,
 
 
The XML response looks like this:
 
  <?xml version="1.0" encoding="UTF-8" ?>
- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <soapenv:Body>
- <createResponse xmlns="urn:partner.soap.sforce.com">
- <result>
- <errors>
  <fields xsi:nil="true" />
  <message>insufficient access rights on cross-reference id</message>
  <statusCode>INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY</statusCode>
  </errors>
  <id xsi:nil="true" />
  <success>false</success>
  </result>
  </createResponse>
  </soapenv:Body>
  </soapenv:Envelope>
 
 
  • July 17, 2007
  • Like
  • 0