• rfan
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 4
    Replies

Hi,

 

I am provisioning Customer Portal via Apex so I need to create users dinamically.

After some reading and developing I faced this problem that puzzles me.

I got next error executing testing

 

TestUserCreationForContact.singleInserTest277.0System.DmlException: Insert failed. First exception on row 0; first error: MIXED_DML_OPERATION, La operación DML en el objeto de configuración no está permitida después de actualizar un objeto no configurado (o viceversa): User objeto original: Account: []Class.Utilities.createNominalUser: line 53, column 3 External entry point

 

I show you the method createNominalUser

 

 

  @future  public static void createNominalUser(String alias, String email, String emailEncodingKey, String lastName, String languageLocaleKey, String localesKey, 
ID profile, String timeZonesIdKey, String userName, ID userRole)
{
Database.DMLOptions dmo = new Database.DMLOptions();
dmo.EmailHeader.triggerUserEmail = true;
User user = new User(alias = alias, email = email, emailencodingkey = emailEncodingKey, lastname = lastName, languagelocalekey = languageLocaleKey,
localesidkey = localesKey, profileid = profile, timezonesidkey = timeZonesIdKey, username = userName, userRoleId = userRole);

user.setOptions(dmo);
insert user; //line 53
  System.debug('Usuario nominal creado, Id:' + user.Id);
}

 How is that possible?

How can I fix it?

 

 

I have custom object with Roll Up Summary Fields. In a unit test I create the custom object but the roll up summary fields are always null. Any idea how to set these fields in my unit tests?

 

Thanks

Chaitanya

We are working on a forecasting app and we need to figure out whether the logged in user has the rights to view someone elses forecast and if yes then whos (which role/user).My questions are:
 
1) Is there a way to figure this out through the API. If yes how and which tables give me that info.
2) Also which tables give the security info. e.g - whether I am allowed to see someone elses data (e.g Opportunities for ppl above or below me in the hierarchy) and if yes what security permissions do i have to look at in teh API.
 
It would be great to get some help ont he above
 
Thanks
 

Hi All,

I want a input text in my visualforce page. On clicking this inputbox the standard salesforce calendar should popup. Is this possible.

Please note that i need only a input text and not a input field.

I got the below code from the forums.

What are the values that i have to pass in the highlighted part of the code. Is this possible in Visualforce.

Code:
<a href="javascript&colon;openPopupFocus

('/home/calendar.jsp—form=form1&field=sdate&mo=0&callonchange=true', '_blank', 186, 170, 'width=186,height=170,resizable=yes,toolbar=no,status=no,scrollbars=no,menubar=no,directories=no,location=no,dependant=yes', true, true);"

class="datePicker"

title="Pick A Date (New Window)"

onclick="setLastMousePosition(event)"

id="sdatePopCal">

<img src="/s.gif" alt="Pick A Date (New Window)" class="datePickerIcon">

</a>

 Thanks,
Edwin