• taPhil
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies

In some cases I need to change a user's profile programmatically.  Have an Apex method the tries to do this, but I get the following message (running as myself, sys admin role).

 

{faultcode:'soapenv:Client', faultstring:'System.DmlException: Update failed. First exception on row 0 with id 00580000001r5gRAAQ; first error: FIELD_INTEGRITY_EXCEPTION, This user is a portal administrator and must have a profile with the "Edit Self-Service Users" permission.: __MISSING_LABEL_FOR_common.udd.impl.UddInfoImpl@1d09706: [UserPermissions]

 

At first I was invoking the method that changes the profile from a VF page.  After reading the following in the Apex Dev Guide I switched it to a Webservice method and invoked from javascript, hoping it would somehow bypass whatever restriction I was running into.  It didn't help.

 

"Invoking a custom webService method always uses System context. Consequently, the current user's credentials are not used..."

 

&

 

"Apex class methods that are exposed through the API with the webService keyword do not observe object permissions, field-level security, or sharing rules for any records..."

 

Can anyone suggest a way to work around this limitation restriction?

 

Thanks.

 

  • November 11, 2009
  • Like
  • 0

I've seen a lot of posts and articles showing how to invoke an action on an object from a commandButton or an outputLink.  Trying to do this for a new contact using contact standard controller, as I've seen suggested is possible, but keep getting Contact.New not an action errors.  Same setup works for for new account with Account standard controller or other actions on Contact, but just not the New action.  Trying to mimic New Contact button on Contact related list.

 

Is the New method not supported for Contact for some reason?

 

Thanks.

  • March 23, 2009
  • Like
  • 0

In some cases I need to change a user's profile programmatically.  Have an Apex method the tries to do this, but I get the following message (running as myself, sys admin role).

 

{faultcode:'soapenv:Client', faultstring:'System.DmlException: Update failed. First exception on row 0 with id 00580000001r5gRAAQ; first error: FIELD_INTEGRITY_EXCEPTION, This user is a portal administrator and must have a profile with the "Edit Self-Service Users" permission.: __MISSING_LABEL_FOR_common.udd.impl.UddInfoImpl@1d09706: [UserPermissions]

 

At first I was invoking the method that changes the profile from a VF page.  After reading the following in the Apex Dev Guide I switched it to a Webservice method and invoked from javascript, hoping it would somehow bypass whatever restriction I was running into.  It didn't help.

 

"Invoking a custom webService method always uses System context. Consequently, the current user's credentials are not used..."

 

&

 

"Apex class methods that are exposed through the API with the webService keyword do not observe object permissions, field-level security, or sharing rules for any records..."

 

Can anyone suggest a way to work around this limitation restriction?

 

Thanks.

 

  • November 11, 2009
  • Like
  • 0

I've seen a lot of posts and articles showing how to invoke an action on an object from a commandButton or an outputLink.  Trying to do this for a new contact using contact standard controller, as I've seen suggested is possible, but keep getting Contact.New not an action errors.  Same setup works for for new account with Account standard controller or other actions on Contact, but just not the New action.  Trying to mimic New Contact button on Contact related list.

 

Is the New method not supported for Contact for some reason?

 

Thanks.

  • March 23, 2009
  • Like
  • 0
I am trying to override the 'New' opportunity button as I'd like to pass some values when it is clicked (opportunity name = account name among others). The code below works - however, it's doing a 'double-load' when I click the new button. Does anyone know why it does that or how I can fix it? For instance, if I have several record types to choose from it will ask me twice which record type I want before it takes me to the new opportunity screen.
 
<html>
<head>
<script src="/soap/ajax/8.0/connection.js">
</script>
<script>
function new_URL()
{
window.parent.location.href ="{!URLFOR($Action.Opportunity.New,null,[accid=Account.Id,opp3= Account.Name ],TRUE)}";
}
</script>
</head>
<body onload="new_URL()">
<p>&nbsp;</p>
</body>
</html>
 
Thanks!