• rohit.mehta
  • NEWBIE
  • 25 Points
  • Member since 2007

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 20
    Questions
  • 18
    Replies

Hello,

 

I have a question and am a little confused after reading the documentation.

I want to use SSO for the customer portal. My users are authenticated on a custom app. From the custom app when they click on a link, I need to then forward them to the Customer Portal and do not want them to login again.

 

Questions -

1. Do I need to use federated authentication or can I use delegated authentication and what is the preferred way?

2. If while logging in, If I find that a user does not exist in Salesforce, can I then create a user by using the api and then log them in?

 

Thanks

Rohit

Hello,

 

I have a VF page which has a link to a content within salesforce.  A content url is normally like

/sfc/#version?selectedDocumentId=069Q00000004Elt

 

When I put a relative url on the Visualforce Page, the link renders as

https://cs3.visual.force.com/sfc/#version?selectedDocumentId=069Q00000004Elt

 

This works fine in Mozilla and Chrome but IE is not able to render this url.

IE forwards it to

https://cs3.salesforce.com/sfc/#search

 

Any suggestions?

 

Thanks

 

 

Hello,

 

I understand that I can give access to Authenticated Web Site User for a object based on a lookup field to Account/Contact.

 

I have a many to one scenario where my object has a related list of Contacts.

 

Is there any way I can give access to this object to  based on the Contact having a lookup to this object?

 

If not, what is the best recommended solution.

 

Thanks

Ro

Hello,

 

1. I created a Customer Portal, enabled login/self registration. Set the Default New User License to "Platform Portal" and the Default New User Profile to "Authenticated Website".

 

2. Created a Site and enabled login with the Customer Portal.

 

3. I am able to register a new user through the SiteRegister VF page but am not able to login. I have tried resetting password/ creating new users but cannot login. I get the following error -

"Your login attempt has failed. Make sure the username and password are correct".

 

I checked the user created from self registration and it all looks fine.

 

4. I then tried to login into the Customer Portal by using the login url of the Customer Portal. I get the following error - 

"The maximum number of logins has been exceeded. Please contact your administrator for more information."

I tried to reset the password and try again but the same issue.

 

5. The only place I can login in from is the Contact record - "Login As Portal User"

 

Can someone help me with why I am not able to login from Sites.

 

Thanks

Ro

I am creating a managed package which has a Static Resource. The static resource has few stylesheets.

 

I wanted to give the customer the flexibility to edit the style sheets.

 

If I make the resource as part of the stylesheet, the end user cannot edit it. What is the best way to handle this?

 

 

Thanks

Rohit

Hello,

 

I have a requirement where on convert of a lead I want to add the original owner of the lead on the Opportunity Sales Team.

 

I am able to create a OpportunityTeamMember record but I am not able to set the access level. Compilation throws an error - "Field is not writeable"

 

Any ideas how can I set the access level?

 

 

//This works

OpportunityTeamMember tm = new OpportunityTeamMember(UserId = myId, OpportunityId = l.ConvertedOpportunityId, TeamMemberRole = role );

//this does not work
OpportunityTeamMember tm = new OpportunityTeamMember(UserId = myId, OpportunityId = l.ConvertedOpportunityId, TeamMemberRole = role, OpportunityAccessLevel = 'Read');

//throws error - field is not writeable

 

Thanks,

Rohit

 

Hello,

 

I have a custom VF page and controller. The controller is declared as 

 

 

public with sharing class MyCustomController {

The user accessing this page is a Partner user and does not have "Edit" Permissions on Leads but is still able to assign leads to other users.

 

I also tried assigning leads to a user who does not have "Read" permission on leads and that also surprising worked.

 

As per my understanding if I declare the class with the "with sharing" keyword, it should take into account the user permission.

 

Can someone explain why the "with sharing" is not having any effect.

 

Thanks,

Rohit

 

 

Hello,

 

I have a requirement where on certain workflow rules I want to send out an email in the contacts preferred language.

Is there a way to create multi lingual visual force email templates  ?

 

If not what is the best approach to acheive this?

 

Thanks,

Rohit


I have territory assignment rules for Account.
When I update the Account from my apex code, these rules dont seem to run.

When I go into an account within Salesforce and click edit and save, the rules run.

Is there any way to ensure that the rules run when an account is updated from apex code.

Thanks,
Rohit

Hi,

I want to able to retrieve the Id for a Custom Report by name. I have the name of the report and also the folder name of where the report is saved.

Basically what I want to do is


Code:
Select Id from Report where name = 'MyReportName';

Since the Report object is not available I am not able to do the above query.

I also have an option of calling it from a SControl.

Thanks,
Rohit


Hello,

Is it possible to query Reports and retrieve its Id. Something like...

Code:
Select Id from Report where name='MyReportName';

 
I have a requirement where I want to redirect the user to a Report from my SControl. I dont see any Report object in the salesforce schema.

Thanks,
Rohit
Hi,

I have an after update trigger on opportunity.
I wanted to know what fields are available on an object when I retrieve it from the Trigger.oldMap ?

What I observed is that all fields are not available on the object retrieved from the oldMap and wanted to understand the logic.

Thanks,
Rohit

Hi,

I have a PRM enabled org. I have an afterUpdate trigger on Opportunity. In the code, I am doing this -

Code:
//get the opp fields  
Set<Id> oppIds = new Set<Id>();
for (Opportunity opp : Trigger.new) {
oppIds.add(opp.Id);
}

Map<Id, Opportunity> opportunityMap = new Map<Id, Opportunity>(
[Select Id, partnerAccountId, isClosed, isWon, Partner_Amount__c,
closeDate from Opportunity where Id In :oppIds]);

 Now when I do this

Code:
for (Opportunity o : Trigger.new) {
Opportunity opp = opportunityMap.get(o.Id);

if (opp.partnerAccountId != null) {

It works fine when I do this within Salesforce, but we have a quoting tool - QuoteWerks, which also updates opportunities. This tool throws a Null pointer exception - Attempt to de-reference a null object on this line -
opp.partnerAccountId != null

Any ideas why this would happen.

Thanks,
Rohit
 



Hi,

I want to be able to get all the fields for the Opportunity. I am writing custom code for cloning an opportunity.
I had the following piece of code which was working but suddenly has stopped working.

Code:
        Map<String, Schema.SObjectField> m = Schema.SObjectType.Opportunity.fields.getMap();
        System.debug('isEmpty = ' + m.isEmpty());

This now returns an empty map.
Any ideas why this call would return an empty map.

Thanks,
Rohit

Hello,
 
I have a requirement to retrieve all the email templates from the user's 'My Personal Email Templates' folder.
 
Is there a way to programatically retrieve this information?
 
 
Thanks,
Rohit
Hi,
 
Is there a way to programatically use the letterhead in sendmail api.
I cannot use the template as the email contains references to  multiple objects and have to create the email in my apex code.
 
I still need to retrieve the letterhead specified in an email template and use that programatically to send the mail.
 
 
 
thanks,
Rohit
I have a query where I want to use the NEXT_N_DAYS in my query but the problem is that the number of days is a variable in my code.
 
When I try writing as
 
Code:
Integer mydays = 20;
Select Id from Opportunity where CloseDate = NEXT_N_DAYS:mydays 

 
I get an error "Expecting a number, found mydays". I have tried the following variations but none of them work -
 
Code:
NEXT_N_DAYS::mydays 
NEXT_N_DAYS:mydays 
NEXT_N_DAYS: =:mydays 

How do I do this?

Thanks,
Rohit
I keep getting this error time and again when I do a query from a SControl
 
"SOAPAction HTTP header missing".
 
There is no pattern...sometimes it comes and the next time it works fine.
 
Any help is appreciated.
 
Thanks
Rohit
I get this error in SControl at times. It is not consistent and comes while doing a query or maybe while doing a update/create.

The error message is
{faultcode:'soapenv:Client', faultstring:'SOAPAction HTTP header missing',}

I am using the 10.0 api.

Any help is appreciated.

Thanks
Rohit
I have a custom object and I wanted to be able to approve it via a SControl.
I was looking at the api "ProcessWorkitemRequest" but do not see any sample on it
 
I was trying the following code but am getting an error

var request = new sforce.ProcessWorkitemRequest();

request.action = "Approve";

request.workitemId = "{!MyObject__c.Id}";

request.comment = "Automated approval.";

var processRes = sforce.connection.process([request]);

This is giving an error -

"invalid cross reference id"

Any help?

Hello,

 

1. I created a Customer Portal, enabled login/self registration. Set the Default New User License to "Platform Portal" and the Default New User Profile to "Authenticated Website".

 

2. Created a Site and enabled login with the Customer Portal.

 

3. I am able to register a new user through the SiteRegister VF page but am not able to login. I have tried resetting password/ creating new users but cannot login. I get the following error -

"Your login attempt has failed. Make sure the username and password are correct".

 

I checked the user created from self registration and it all looks fine.

 

4. I then tried to login into the Customer Portal by using the login url of the Customer Portal. I get the following error - 

"The maximum number of logins has been exceeded. Please contact your administrator for more information."

I tried to reset the password and try again but the same issue.

 

5. The only place I can login in from is the Contact record - "Login As Portal User"

 

Can someone help me with why I am not able to login from Sites.

 

Thanks

Ro

Hello,

 

I have a custom VF page and controller. The controller is declared as 

 

 

public with sharing class MyCustomController {

The user accessing this page is a Partner user and does not have "Edit" Permissions on Leads but is still able to assign leads to other users.

 

I also tried assigning leads to a user who does not have "Read" permission on leads and that also surprising worked.

 

As per my understanding if I declare the class with the "with sharing" keyword, it should take into account the user permission.

 

Can someone explain why the "with sharing" is not having any effect.

 

Thanks,

Rohit

 

 

Hello,

 

I have a requirement where on certain workflow rules I want to send out an email in the contacts preferred language.

Is there a way to create multi lingual visual force email templates  ?

 

If not what is the best approach to acheive this?

 

Thanks,

Rohit

Hi all,

I'd like to dynamically  render an Sobject to a VF page.

Here is my controller:

Code:
private list<SObject> obj;

public void setobj(list<SObject> s){obj=s;} public list<Sobject> getobj(){return obj;}
public PageReference init() {
 obj=[select Name from Account limit 10]; return null; }

Here my VF Page:

Code:
<apex:page Controller="Test" action="{!init}">
<apex:form>
<apex:repeat value="{!obj}" var="field">
   <apex:inputField value="{!field.Name}"/>
</apex:repeat>
</apex:form>
</apex:page>

I've got this error message :
Read access not found for null.
I've also tried with outputText, inputText with no success.The only field I've managed to retrieve is the ID.

Any Idea ?



Hello,

Is it possible to query Reports and retrieve its Id. Something like...

Code:
Select Id from Report where name='MyReportName';

 
I have a requirement where I want to redirect the user to a Report from my SControl. I dont see any Report object in the salesforce schema.

Thanks,
Rohit
Hi,

I have a PRM enabled org. I have an afterUpdate trigger on Opportunity. In the code, I am doing this -

Code:
//get the opp fields  
Set<Id> oppIds = new Set<Id>();
for (Opportunity opp : Trigger.new) {
oppIds.add(opp.Id);
}

Map<Id, Opportunity> opportunityMap = new Map<Id, Opportunity>(
[Select Id, partnerAccountId, isClosed, isWon, Partner_Amount__c,
closeDate from Opportunity where Id In :oppIds]);

 Now when I do this

Code:
for (Opportunity o : Trigger.new) {
Opportunity opp = opportunityMap.get(o.Id);

if (opp.partnerAccountId != null) {

It works fine when I do this within Salesforce, but we have a quoting tool - QuoteWerks, which also updates opportunities. This tool throws a Null pointer exception - Attempt to de-reference a null object on this line -
opp.partnerAccountId != null

Any ideas why this would happen.

Thanks,
Rohit
 



I have set up a customer portal and now want to have Single sign on to it from our company website .. I am really struggling with this as I can see "Is SSO enabled" in a normal users profile under General User Permissions but there does not seem to be anywhere to set it in a Portal user's profile .. I've had our web developer review all the Wiki entries and it all makes perfect sense apart from the bit about "make sure the portal user profile has "Is Single-sign-on enabled" checked and you are using the correct login URLs."
 
Has anyone already set this up and could give me some direction?
 
Jaz
Hi,

I want to be able to get all the fields for the Opportunity. I am writing custom code for cloning an opportunity.
I had the following piece of code which was working but suddenly has stopped working.

Code:
        Map<String, Schema.SObjectField> m = Schema.SObjectType.Opportunity.fields.getMap();
        System.debug('isEmpty = ' + m.isEmpty());

This now returns an empty map.
Any ideas why this call would return an empty map.

Thanks,
Rohit

With the 10000 record limit on SOQL queries, is that per SOQL call in an Apex class or is it the sum of all calls in that class?  So if I had 5 queries, the total of those 5 must not exceed 10k?

Also, if all I'm doing is an SOQL count() .. how can I count all the records if it exceeds 10k?  Example please.  Thanks.
Hello,
 
I have a requirement to retrieve all the email templates from the user's 'My Personal Email Templates' folder.
 
Is there a way to programatically retrieve this information?
 
 
Thanks,
Rohit
Hi,
 
Is there a way to programatically use the letterhead in sendmail api.
I cannot use the template as the email contains references to  multiple objects and have to create the email in my apex code.
 
I still need to retrieve the letterhead specified in an email template and use that programatically to send the mail.
 
 
 
thanks,
Rohit
Hi,

I used try and catch statements in Controller extension to catch DML errors.

How can I disply the error message ? I know that I can get the message from e.getMessage() where "e" is the exception.
But  how do I display it on the current page . I tried using ApexPages but cud not succeed.

Thanks in advance!

Sirisha
I have a query where I want to use the NEXT_N_DAYS in my query but the problem is that the number of days is a variable in my code.
 
When I try writing as
 
Code:
Integer mydays = 20;
Select Id from Opportunity where CloseDate = NEXT_N_DAYS:mydays 

 
I get an error "Expecting a number, found mydays". I have tried the following variations but none of them work -
 
Code:
NEXT_N_DAYS::mydays 
NEXT_N_DAYS:mydays 
NEXT_N_DAYS: =:mydays 

How do I do this?

Thanks,
Rohit
I keep getting this error time and again when I do a query from a SControl
 
"SOAPAction HTTP header missing".
 
There is no pattern...sometimes it comes and the next time it works fine.
 
Any help is appreciated.
 
Thanks
Rohit
I get this error in SControl at times. It is not consistent and comes while doing a query or maybe while doing a update/create.

The error message is
{faultcode:'soapenv:Client', faultstring:'SOAPAction HTTP header missing',}

I am using the 10.0 api.

Any help is appreciated.

Thanks
Rohit