You need to sign in to do that
Don't have an account?

How to enable self service portal automatically?
Hi there,
is it possible to automatically enable self-service portal for a contact? This could be done manually by clicking "enable self-service portal" standard button at the contact record. Could this be done automatically with an apex trigger?
I could see a SelfServiceUser object where in I can see creatable/updatable properties for this object.
I think you can automatically create self service user whenever you create a contact.
Here is the pseudo code and it might work for you.
I have tried the trigger to make contact as a self service user or super user. It seems that DML operations are not allowed for self service user :
trigger SelfUsercontrgger on Contact (after insert,before update)
{
Contact con = trigger.new[0];
Id contactid = con.id;
SelfServiceUser u = new SelfServiceUser(contactId=contactid, username=con.Email, firstname=con.FirstName,
lastname=con.LastName, email=con.Email,languagelocalekey='en_US', localesidkey='en_US'
timezonesidkey='America/Los_Angeles');
insert u; // DML operation not allowed here.
}
Hope this helps.
Thank you both for the answers! So basically the idea of the apex code is pretty simple, but at the moment INSERT is not supported by SF? And there is no other way to achieve this...
Hi there,
I really need to enable self service portal automatically.
Is there any way ? Or, simply it cannot be achieved ?
Please comment here..