• mroark
  • NEWBIE
  • 85 Points
  • Member since 2011

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

Set<String> setUserID = new Set<String>{'1','55','80','12', '6','22','87'};

 

Now I want to select random element from it.  Below random method is not yet exist. So how can I select random element from this set. Any other idea?

 

System.debug('Random Set Element  = ' +setUserID.random());

 

Hello all,

 

I am having an issue using Messaging.sendMail when the email is sent to an undeliverable email address. 

 

I have the 'ReplyTo' on the email message set to a mailing list, so that if a customer has questions, they can respond to the list of users who can help them.   However, when the email address provided for the email message is invalid, an undeliverable message is not delivered to this mailing list.  In fact, I can't seem to find where this undeliverable message is being delivered. 

 

As this is a customer facing email, I need to be able to alert my users when it is undeliverable so that they can take appropriate action.

 

        /* public Messaging.SingleEmailMessage buildEmailMessage()
        * Description:  This method generates the email message which will be sent to the Contact and any CCEmails identified for an instance of this class
        */      
        public Messaging.SingleEmailMessage buildEmailMessage()
        {   
            // Create a new SingleEmailMessage record
            Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
            // Set the 'Reply To' and 'Sender Display Name' value of the email alias for the mailing list
            mail.setReplyTo('mailing-list@my-company.com');
            mail.setSenderDisplayName('My Company');
            // Fetch the email address for the current user
            User currentUser = [Select Id, Email from User where Id = :UserInfo.getUserId() limit 1];
            // Set the To and CC addresses for the email
            mail.setToAddresses(new String[] {this.contEmail});
            if (this.CCEMails != null && this.CCEmails != '')
                mail.setCcAddresses(this.CCEmails.split(';'));
            // Add the current user's email address to the BCC line
            mail.setBccAddresses(new String[] {currentUser.Email});
            // Use the currently logged in user's signature
            mail.setUseSignature(true);
            // Set the subject of the email
            mail.setSubject('Email subject line');
            // Set the body of the email            
            mail.setPlainTextBody(buildEmailMessageBody(false));
            mail.setHTMLBody(buildEmailMessageBody(true));
            // Return the email
            return mail;
        }

 

  • April 24, 2013
  • Like
  • 0

Hello,

 

I have a new custom object called a 'Case Action Item' related to the Case object in a master-detail relationship.  The requirement is that whenever a new Case Action Item is created, a new CaseComment must be added to the parent Case, and this CaseComment should trigger an alert to the Contact assigned to the Case.

 

The code for the trigger is below, and it functions fine except for one detail.  The email to the Contact is not being sent.

 

I've marked the CaseComment as 'Published' and set the DMLOptions to trigger the AutoResponseEmails.  What am I missing?

 

Any assistance would be appreciated.

 

 

trigger addNewCaseComment on Case_Action_Item__c (after insert, after update) {
List<CaseComment> arrCaseComments = new List<CaseComment> ();
Map<Id,Case> mapRelatedCases = new Map<Id,Case>();
	
for (Case_Action_Item__c cai : Trigger.new)
{
	if (cai.Description__c == 'Initial Request')
		continue;
	if (Trigger.IsUpdate)
	{
		Case_Action_Item__c originalCAI = Trigger.oldMap.get(cai.Id);
		if (cai.Category__c == originalCAI.Category__c && cai.Description__c == originalCAI.Description__c)
			continue; 
	}
	mapRelatedCases.put(cai.Case__c,null);
}
if (mapRelatedCases.size() == 0)
	return;
mapRelatedCases = new Map<Id,Case>([Select Id, AccountId, Account.Name, CaseNumber, Subject from Case where Id in :mapRelatedCases.keySet()]);
for (Case_Action_Item__c cai : Trigger.new)
{
	if (cai.Description__c == 'Initial Request')
		continue;
	if (Trigger.IsUpdate)
	{
		Case_Action_Item__c originalCAI = Trigger.oldMap.get(cai.Id);
		if (cai.Category__c == originalCAI.Category__c && cai.Description__c == originalCAI.Description__c)
			continue; 
	}
	if (cai.Case__c == null || !mapRelatedCases.containsKey(cai.Case__c))
		continue;
		
	Case relatedCase = mapRelatedCases.get(cai.Case__c);
	CaseComment newCaseComment = new CaseComment(ParentId=cai.Case__c);
	newCaseComment.CommentBody = '<Comment body is set based on requirements>';
	newCaseComment.IsPublished = true;
	arrCaseComments.add(newCaseComment);
}

if (arrCaseComments.size() > 0)
{ Database.DMLOptions dlo = new Database.DMLOptions(); dlo.EmailHeader.triggerAutoResponseEmail = true; dlo.optAllOrNone = false;
	Database.SaveResult[] arrResults = Database.insert(arrCaseComments, dlo);
    // Process the results, and send an email notifying IT if any errors were encountered.
    classHelperMethods.processResults(arrResults, 'addNewCaseComment', 'Case');
}

}

 

  • February 17, 2012
  • Like
  • 0

Here is my use case.

 

Use Case:  Login to SalesForce Site.

 

Provide a login page for a SalesForce Site. If a user is already authenticated to SalesForce, either as a standard user, customer portal user, or partner portal user, do not present this page and instead route them directly to the content.

 

The first portion of this use case is not the issue; it is already well documented in the SalesForce help documentation.

 

It is the second part of this requirement which is causing me trouble.  Is there a way for a publicly accessible Site to determine if the end user loading the page is already an authenticated user in SalesForce?

 

  • August 01, 2011
  • Like
  • 0

Is it possible to authenticate Customer Portal, Partner Portal, and Standard users via a single form?

 

I have tried a few different approaches, and each errors on me.  Can anyone give me some feedback on whether this is possible, and what (if anything) I am doing wrong in the three approaches below.

 

1.  I tried setting up a SalesForce Site with authentication enabled using the SiteLogin page provided.  However, this does not work, as each Site must be tied to one, and only one, portal site, and does not work with Standard users.

 

2.  I tried using a SalesForce Site with public access enabled, and then tried using the AJAX Toolkit Javascript API.  The VisualForce page works fine if I am inside SalesForce for all three user types.  However, if I access the Site to run the page, I cannot authenticate.  Attempting to do so causes an error to occur on the login method.  This error is 'UNKNOWN_EXCEPTION: Site under construction'. 

 

However, if I enable the header and side bar, it works for standard and Partner Portal users, but not for Customer Portal users.  Attempting to login as a Customer Portal user fails with the following error message: 'INVALID_LOGIN: Invalid username, password, security token; or user locked out'

 

<apex:page showHeader="false" sidebar="false" >
<head>
<style>
page {width:100%;height=100%;border=1;background-color=red;}
</style>
</head>
<script src="../../soap/ajax/22.0/connection.js" type="text/javascript"></script>
<script type="text/javascript">
function validateUser()
{
alert("Username: "+document.getElementById("tbUsername").value);
try
{
var result = sforce.connection.login(document.getElementById("tbUsername").value, document.getElementById("tbPassword").value);
}
catch (e)
{
alert(e);
showStuff('lbLoginFailed');
return;
}
alert("result: "+result);
if (result != undefined)
{
showStuff('rnFrame');
hideStuff('theForm');
hideStuff('lbLoginFailed');
}
else
{
showStuff('lbLoginFailed');
}
}

function hideStuff(id) {
        document.getElementById(id).style.display = 'none';
    }
function showStuff(id) {
        document.getElementById(id).style.display = 'block';
        document.getElementById(id).style.width = '100%';
        document.getElementById(id).style.height = '1000px';
    }
</script>
<form id="theForm" width="100%" height="100%">

<table border="0">
<th><td colspan="2">Please login using your Customer Portal or <br/>Partner Portal credentials to access the article.</td></th>
<tr><td>Username:</td><td><input id="tbUsername" type="text"/></td></tr>
<tr><td>Password:</td><td><input id="tbPassword" type="password"/></td></tr>
<tr><td colspan="2" align="right"><input id="btnSubmit" type="button" value="Login" onclick="validateUser();"/></td></tr>
</table>
</form>
<div id="lbLoginFailed" style="display:none" >Login failed.  Please try again.</div>
</apex:page>

 

3. The last method I tried was using the SOAP API to create an ASP.Net page to try logging the user in.

 

This works for standard and Partner Portal users, but not for Customer Portal users.  Attempting to login as a Customer Portal user fails with the following error message: 'INVALID_LOGIN: Invalid username, password, security token; or user locked out'

 

History:

 

In our environment, we have deployed a VisualForce page which allows users to mass update Opportunity records.  The code for this page mirrors the example shown in the 'Mass-Updating Records with a Custom List Controller' example in the SalesForce cookbook.  We dispense with the custom controller because we don't need to display counts to the user. (The code is included below for those who are interested).

 

Problem:

 

The problem I have is one of governer limits, specifically SOQL queries.  When I run the page in our environment, selecting more than 10 records, I get an error message informing me that too many SOQL queries were made.  Our environment does has several triggers which fire both before and after an Opportunity is updated.  I have tried refactoring these queries to limit the number of SOQL calls, using the best practices outlined in the documentation on DeveloperForce.  This helps, but I still encounter this issue if I select more than 15 records.

 

This seems to indicate that the trigger is not being fired for multiple records.  I added some debug methods to the triggers to figure out how many records were being updated when the trigger was called, and discovered the triggers were being fired for only a single Opportunity (as shown in the debug log snippet below).

 

13:46:29.141 (1141911000)|CODE_UNIT_STARTED|[EXTERNAL]|01qQ0000000CywQ|Oppty_Change on Opportunity trigger event AfterUpdate for [0067000000FXx6J]
13:46:29.142 (1142110000)|SYSTEM_METHOD_ENTRY|[17]|System.debug(ANY)
13:46:29.142 (1142166000)|SYSTEM_METHOD_ENTRY|[17]|LIST.size()
13:46:29.142 (1142188000)|SYSTEM_METHOD_EXIT|[17]|LIST.size()
13:46:29.142 (1142211000)|USER_DEBUG|[17]|DEBUG|Trigger fired for 1 records.

 

So, here is my question.  How do I force the standard controller's {!save} method to update all the records as a single batch, instead of as individual records?  Can I do this?  If not, do I have to build a custom controller which overrides the {!save} method and instead updates all the selected records?

 

Visualforce Code:

 

<apex:page standardController="Opportunity" recordSetVar="unused"
    sidebar="false">
    <apex:includeScript value="{!$Resource.UtilJS}" />
    <apex:form >
        <apex:pageBlock >
            <apex:pageMessages />
            <apex:pageBlock >
Note: All modifications made on the page will be lost if Return button is clicked without clicking the Save button first. 
</apex:pageBlock>
            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!save}" />
                <apex:commandButton value="Return" action="{!cancel}" />
            </apex:pageBlockButtons>
            <apex:pageBlockTable value="{!selected}" var="opp" id="table">
<apex:column headerValue="Sales Region">
<apex:inputField value="{!opp.Sales_Region__c}" />   
</apex:column>
<apex:column headerValue="Opportunity Owner">
<apex:inputField value="{!opp.OwnerID}" />   
</apex:column>
<apex:column headerValue="Opportunity Name">
                    <apex:inputField value="{!opp.name}" />

  </apex:column>
                <apex:column headerValue="Stage">
                    <apex:inputField value="{!opp.stageName}" /> 
</apex:column>
                <apex:column headerValue="Amount">
                    <apex:inputField required="true" value="{!opp.amount}" />      
                </apex:column>
                <apex:column headerValue="Forecast Category">
                    <apex:inputField value="{!opp.ForecastCategoryName}" />
</apex:column>
<apex:column headerValue="Close Date">
                    <apex:inputField value="{!opp.closeDate}" />
                </apex:column>
<apex:column headerValue="FC Updated">
<apex:inputField value="{!opp.FC_Updated__c}" />
</apex:column>
<apex:column headerValue="Mgr Lock">
<apex:inputField value="{!opp.Mgr_Lock__c}" />
</apex:column>
<apex:column headerValue="Mgr Amount">
<apex:inputField value="{!opp.Mgr_Amount__c}" />
</apex:column>
<apex:column headerValue="Mgr Forecast Category">
<apex:inputField value="{!opp.Mgr_Forecast_Category__c}" />
</apex:column>
<apex:column headerValue="Mgr Close Date">
<apex:inputField value="{!opp.Mgr_Close_Date__c}" />
</apex:column>
<apex:column headerValue="Mgr Comments">
<apex:inputField value="{!opp.Mgr_Comments__c}" />
                </apex:column>
            </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
</apex:page>

 

My use case is this:

 

I have a VisualForce page which will redirect users to a third party application.  This page uses the vendor's pass through authentication to automatically log users into the third party application.  I would like to make this VisualForce page available to both my Customer Portal and Partner portal users (in fact, available for all authenticated SalesForce users).

 

I would also like to find out what type of user they are authenticated as, as each type of user may have different permissions in the third party application.  I can then use this information to appropriately log the users into the third party application.

 

Reading through the available literature, it appears that I can make a Site accessible only for either Customer or Partner Portal users.  Is this accurate, or am I misreading the documents?

 

Set<String> setUserID = new Set<String>{'1','55','80','12', '6','22','87'};

 

Now I want to select random element from it.  Below random method is not yet exist. So how can I select random element from this set. Any other idea?

 

System.debug('Random Set Element  = ' +setUserID.random());

 

Hello all,

 

I am having an issue using Messaging.sendMail when the email is sent to an undeliverable email address. 

 

I have the 'ReplyTo' on the email message set to a mailing list, so that if a customer has questions, they can respond to the list of users who can help them.   However, when the email address provided for the email message is invalid, an undeliverable message is not delivered to this mailing list.  In fact, I can't seem to find where this undeliverable message is being delivered. 

 

As this is a customer facing email, I need to be able to alert my users when it is undeliverable so that they can take appropriate action.

 

        /* public Messaging.SingleEmailMessage buildEmailMessage()
        * Description:  This method generates the email message which will be sent to the Contact and any CCEmails identified for an instance of this class
        */      
        public Messaging.SingleEmailMessage buildEmailMessage()
        {   
            // Create a new SingleEmailMessage record
            Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
            // Set the 'Reply To' and 'Sender Display Name' value of the email alias for the mailing list
            mail.setReplyTo('mailing-list@my-company.com');
            mail.setSenderDisplayName('My Company');
            // Fetch the email address for the current user
            User currentUser = [Select Id, Email from User where Id = :UserInfo.getUserId() limit 1];
            // Set the To and CC addresses for the email
            mail.setToAddresses(new String[] {this.contEmail});
            if (this.CCEMails != null && this.CCEmails != '')
                mail.setCcAddresses(this.CCEmails.split(';'));
            // Add the current user's email address to the BCC line
            mail.setBccAddresses(new String[] {currentUser.Email});
            // Use the currently logged in user's signature
            mail.setUseSignature(true);
            // Set the subject of the email
            mail.setSubject('Email subject line');
            // Set the body of the email            
            mail.setPlainTextBody(buildEmailMessageBody(false));
            mail.setHTMLBody(buildEmailMessageBody(true));
            // Return the email
            return mail;
        }

 

  • April 24, 2013
  • Like
  • 0

Hello,

 

I have a new custom object called a 'Case Action Item' related to the Case object in a master-detail relationship.  The requirement is that whenever a new Case Action Item is created, a new CaseComment must be added to the parent Case, and this CaseComment should trigger an alert to the Contact assigned to the Case.

 

The code for the trigger is below, and it functions fine except for one detail.  The email to the Contact is not being sent.

 

I've marked the CaseComment as 'Published' and set the DMLOptions to trigger the AutoResponseEmails.  What am I missing?

 

Any assistance would be appreciated.

 

 

trigger addNewCaseComment on Case_Action_Item__c (after insert, after update) {
List<CaseComment> arrCaseComments = new List<CaseComment> ();
Map<Id,Case> mapRelatedCases = new Map<Id,Case>();
	
for (Case_Action_Item__c cai : Trigger.new)
{
	if (cai.Description__c == 'Initial Request')
		continue;
	if (Trigger.IsUpdate)
	{
		Case_Action_Item__c originalCAI = Trigger.oldMap.get(cai.Id);
		if (cai.Category__c == originalCAI.Category__c && cai.Description__c == originalCAI.Description__c)
			continue; 
	}
	mapRelatedCases.put(cai.Case__c,null);
}
if (mapRelatedCases.size() == 0)
	return;
mapRelatedCases = new Map<Id,Case>([Select Id, AccountId, Account.Name, CaseNumber, Subject from Case where Id in :mapRelatedCases.keySet()]);
for (Case_Action_Item__c cai : Trigger.new)
{
	if (cai.Description__c == 'Initial Request')
		continue;
	if (Trigger.IsUpdate)
	{
		Case_Action_Item__c originalCAI = Trigger.oldMap.get(cai.Id);
		if (cai.Category__c == originalCAI.Category__c && cai.Description__c == originalCAI.Description__c)
			continue; 
	}
	if (cai.Case__c == null || !mapRelatedCases.containsKey(cai.Case__c))
		continue;
		
	Case relatedCase = mapRelatedCases.get(cai.Case__c);
	CaseComment newCaseComment = new CaseComment(ParentId=cai.Case__c);
	newCaseComment.CommentBody = '<Comment body is set based on requirements>';
	newCaseComment.IsPublished = true;
	arrCaseComments.add(newCaseComment);
}

if (arrCaseComments.size() > 0)
{ Database.DMLOptions dlo = new Database.DMLOptions(); dlo.EmailHeader.triggerAutoResponseEmail = true; dlo.optAllOrNone = false;
	Database.SaveResult[] arrResults = Database.insert(arrCaseComments, dlo);
    // Process the results, and send an email notifying IT if any errors were encountered.
    classHelperMethods.processResults(arrResults, 'addNewCaseComment', 'Case');
}

}

 

  • February 17, 2012
  • Like
  • 0

Hi,

 

How can I find day value (eg. Sunday) from Datetime API. Or do we have any other API to find this?

 

Regards,

SuBaa

  • September 06, 2011
  • Like
  • 0

I have a class runs before insert cases. It checks the duplicated tax number. It works perfect in Sandbox but there is covearge problem in Production. Can anyone help with the issue?

 

Thanks

public class TaxNumberDuplicate{

    public static void checkDuplicates (List<Case> caseList) {
    
        List<Case> duplicatecaseList = new List<Case>();
        
        for (Case c : caseList) { 
		
				duplicatecaseList = [SELECT id FROM Case WHERE Tax_Number__c =: c.Tax_Number__c];
			}
            
            if(trigger.isInsert){
            
            
            if(duplicatecaseList.size()> 0 && 
               c.Permit_Duplicate__c== FALSE && 
               c.Tax_Number__c != Null){
            
            c.Tax_Number__c.addError('ERROR');
            }
            }
            else if(trigger.isUpdate){
            
                duplicatecaseList = [SELECT id FROM Case WHERE Tax_Number__c =: c.Tax_Number__c];
            
                if(duplicatecaseList.size()> 0 && 
                   c.Permit_Duplicate__c == FALSE && 
                   c.Tax_Number__c != Null){
            
                c.Tax_Number__c.addError('ERROR');
            
                }
            }

    }
}

 

  • September 06, 2011
  • Like
  • 0

Here is my use case.

 

Use Case:  Login to SalesForce Site.

 

Provide a login page for a SalesForce Site. If a user is already authenticated to SalesForce, either as a standard user, customer portal user, or partner portal user, do not present this page and instead route them directly to the content.

 

The first portion of this use case is not the issue; it is already well documented in the SalesForce help documentation.

 

It is the second part of this requirement which is causing me trouble.  Is there a way for a publicly accessible Site to determine if the end user loading the page is already an authenticated user in SalesForce?

 

  • August 01, 2011
  • Like
  • 0

Is it possible to authenticate Customer Portal, Partner Portal, and Standard users via a single form?

 

I have tried a few different approaches, and each errors on me.  Can anyone give me some feedback on whether this is possible, and what (if anything) I am doing wrong in the three approaches below.

 

1.  I tried setting up a SalesForce Site with authentication enabled using the SiteLogin page provided.  However, this does not work, as each Site must be tied to one, and only one, portal site, and does not work with Standard users.

 

2.  I tried using a SalesForce Site with public access enabled, and then tried using the AJAX Toolkit Javascript API.  The VisualForce page works fine if I am inside SalesForce for all three user types.  However, if I access the Site to run the page, I cannot authenticate.  Attempting to do so causes an error to occur on the login method.  This error is 'UNKNOWN_EXCEPTION: Site under construction'. 

 

However, if I enable the header and side bar, it works for standard and Partner Portal users, but not for Customer Portal users.  Attempting to login as a Customer Portal user fails with the following error message: 'INVALID_LOGIN: Invalid username, password, security token; or user locked out'

 

<apex:page showHeader="false" sidebar="false" >
<head>
<style>
page {width:100%;height=100%;border=1;background-color=red;}
</style>
</head>
<script src="../../soap/ajax/22.0/connection.js" type="text/javascript"></script>
<script type="text/javascript">
function validateUser()
{
alert("Username: "+document.getElementById("tbUsername").value);
try
{
var result = sforce.connection.login(document.getElementById("tbUsername").value, document.getElementById("tbPassword").value);
}
catch (e)
{
alert(e);
showStuff('lbLoginFailed');
return;
}
alert("result: "+result);
if (result != undefined)
{
showStuff('rnFrame');
hideStuff('theForm');
hideStuff('lbLoginFailed');
}
else
{
showStuff('lbLoginFailed');
}
}

function hideStuff(id) {
        document.getElementById(id).style.display = 'none';
    }
function showStuff(id) {
        document.getElementById(id).style.display = 'block';
        document.getElementById(id).style.width = '100%';
        document.getElementById(id).style.height = '1000px';
    }
</script>
<form id="theForm" width="100%" height="100%">

<table border="0">
<th><td colspan="2">Please login using your Customer Portal or <br/>Partner Portal credentials to access the article.</td></th>
<tr><td>Username:</td><td><input id="tbUsername" type="text"/></td></tr>
<tr><td>Password:</td><td><input id="tbPassword" type="password"/></td></tr>
<tr><td colspan="2" align="right"><input id="btnSubmit" type="button" value="Login" onclick="validateUser();"/></td></tr>
</table>
</form>
<div id="lbLoginFailed" style="display:none" >Login failed.  Please try again.</div>
</apex:page>

 

3. The last method I tried was using the SOAP API to create an ASP.Net page to try logging the user in.

 

This works for standard and Partner Portal users, but not for Customer Portal users.  Attempting to login as a Customer Portal user fails with the following error message: 'INVALID_LOGIN: Invalid username, password, security token; or user locked out'

 

History:

 

In our environment, we have deployed a VisualForce page which allows users to mass update Opportunity records.  The code for this page mirrors the example shown in the 'Mass-Updating Records with a Custom List Controller' example in the SalesForce cookbook.  We dispense with the custom controller because we don't need to display counts to the user. (The code is included below for those who are interested).

 

Problem:

 

The problem I have is one of governer limits, specifically SOQL queries.  When I run the page in our environment, selecting more than 10 records, I get an error message informing me that too many SOQL queries were made.  Our environment does has several triggers which fire both before and after an Opportunity is updated.  I have tried refactoring these queries to limit the number of SOQL calls, using the best practices outlined in the documentation on DeveloperForce.  This helps, but I still encounter this issue if I select more than 15 records.

 

This seems to indicate that the trigger is not being fired for multiple records.  I added some debug methods to the triggers to figure out how many records were being updated when the trigger was called, and discovered the triggers were being fired for only a single Opportunity (as shown in the debug log snippet below).

 

13:46:29.141 (1141911000)|CODE_UNIT_STARTED|[EXTERNAL]|01qQ0000000CywQ|Oppty_Change on Opportunity trigger event AfterUpdate for [0067000000FXx6J]
13:46:29.142 (1142110000)|SYSTEM_METHOD_ENTRY|[17]|System.debug(ANY)
13:46:29.142 (1142166000)|SYSTEM_METHOD_ENTRY|[17]|LIST.size()
13:46:29.142 (1142188000)|SYSTEM_METHOD_EXIT|[17]|LIST.size()
13:46:29.142 (1142211000)|USER_DEBUG|[17]|DEBUG|Trigger fired for 1 records.

 

So, here is my question.  How do I force the standard controller's {!save} method to update all the records as a single batch, instead of as individual records?  Can I do this?  If not, do I have to build a custom controller which overrides the {!save} method and instead updates all the selected records?

 

Visualforce Code:

 

<apex:page standardController="Opportunity" recordSetVar="unused"
    sidebar="false">
    <apex:includeScript value="{!$Resource.UtilJS}" />
    <apex:form >
        <apex:pageBlock >
            <apex:pageMessages />
            <apex:pageBlock >
Note: All modifications made on the page will be lost if Return button is clicked without clicking the Save button first. 
</apex:pageBlock>
            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!save}" />
                <apex:commandButton value="Return" action="{!cancel}" />
            </apex:pageBlockButtons>
            <apex:pageBlockTable value="{!selected}" var="opp" id="table">
<apex:column headerValue="Sales Region">
<apex:inputField value="{!opp.Sales_Region__c}" />   
</apex:column>
<apex:column headerValue="Opportunity Owner">
<apex:inputField value="{!opp.OwnerID}" />   
</apex:column>
<apex:column headerValue="Opportunity Name">
                    <apex:inputField value="{!opp.name}" />

  </apex:column>
                <apex:column headerValue="Stage">
                    <apex:inputField value="{!opp.stageName}" /> 
</apex:column>
                <apex:column headerValue="Amount">
                    <apex:inputField required="true" value="{!opp.amount}" />      
                </apex:column>
                <apex:column headerValue="Forecast Category">
                    <apex:inputField value="{!opp.ForecastCategoryName}" />
</apex:column>
<apex:column headerValue="Close Date">
                    <apex:inputField value="{!opp.closeDate}" />
                </apex:column>
<apex:column headerValue="FC Updated">
<apex:inputField value="{!opp.FC_Updated__c}" />
</apex:column>
<apex:column headerValue="Mgr Lock">
<apex:inputField value="{!opp.Mgr_Lock__c}" />
</apex:column>
<apex:column headerValue="Mgr Amount">
<apex:inputField value="{!opp.Mgr_Amount__c}" />
</apex:column>
<apex:column headerValue="Mgr Forecast Category">
<apex:inputField value="{!opp.Mgr_Forecast_Category__c}" />
</apex:column>
<apex:column headerValue="Mgr Close Date">
<apex:inputField value="{!opp.Mgr_Close_Date__c}" />
</apex:column>
<apex:column headerValue="Mgr Comments">
<apex:inputField value="{!opp.Mgr_Comments__c}" />
                </apex:column>
            </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
</apex:page>

 

My use case is this:

 

I have a VisualForce page which will redirect users to a third party application.  This page uses the vendor's pass through authentication to automatically log users into the third party application.  I would like to make this VisualForce page available to both my Customer Portal and Partner portal users (in fact, available for all authenticated SalesForce users).

 

I would also like to find out what type of user they are authenticated as, as each type of user may have different permissions in the third party application.  I can then use this information to appropriately log the users into the third party application.

 

Reading through the available literature, it appears that I can make a Site accessible only for either Customer or Partner Portal users.  Is this accurate, or am I misreading the documents?

 

I'm setting up a few custom tab splash pages to introduce and explain custom objects in an app. I created these splash pages as Visualforce pages and linked them up through the Home > Custom Links section and applied them to the respective tabs.

 

The Visualforce page displays as the splash page, but the "don't show this message again" and "continue" buttons do not appear at the bottom. These buttons do display if I use a URL or s-control type custom link.

 

Are those buttons not currently supported on Visualforce splash pages, or does something need to be configured to enable them?