• carlz
  • NEWBIE
  • 5 Points
  • Member since 2012

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

Hi

 

We have an internal feature to allow our staff to login as a specific Sites portal user. For that we are using the following URL:

 

/servlet/servlet.su?oid=xxx&suportaluserid={!userId}&retURL=%2Fapex%2FdcEdit%3FuserId%3D{!userId}&targetURL=%2Fapex%2Fms_dashboard&suportalid=xxx

 

The URL seems to work just fine except for the targetURL, which seems to be ignored. So, I tried to find any documentation about this feature, but was not able to. Are there any docs about how to use this URL? Is this a supported feature? If so, what is wrong with the targetURL param?

 

Thanks in advance

 

Rodrigo

  • August 13, 2013
  • Like
  • 0

Hi

 

We have an internal feature to allow our staff to login as a specific Sites portal user. For that we are using the following URL:

 

/servlet/servlet.su?oid=xxx&suportaluserid={!userId}&retURL=%2Fapex%2FdcEdit%3FuserId%3D{!userId}&targetURL=%2Fapex%2Fms_dashboard&suportalid=xxx

 

The URL seems to work just fine except for the targetURL, which seems to be ignored. So, I tried to find any documentation about this feature, but was not able to. Are there any docs about how to use this URL? Is this a supported feature? If so, what is wrong with the targetURL param?

 

Thanks in advance

 

Rodrigo

  • August 13, 2013
  • Like
  • 0

Accordin to this post http://blogs.developerforce.com/developer-relations/2013/02/oauth-for-portal-users.html we are able to use OAuth and API calls with portal user licenses. It seems to work great on DE and Production enviroments, but something its not working  correctly for Sandbox enviroment. What would be the URL for authentication on sandbox?

 

Thank You!

Clara.

  • August 13, 2013
  • Like
  • 0

I have a visualforce page that renders a list of records based on three variables the user sets. The user will then change the status for the intended records and clck the button "Update All." The page will refresh and return the status to the original status. The record page still shows the originnal status. Here is my save page reference:

 

 public PageReference save() {
        try {
            List<CampaignMember> changedCMList=new List<CampaignMember>();
            for ( CampaignMember cm: CampaignMember) {
                CampaignMember cm2=origCMMap.get(cm.Id);
                if ( cm2 != null &&
                    (cm2.Status != selectedsval ||
                     cm2.Log_A_Call_Notes__c != cm.Log_A_Call_Notes__c) ) {
                     changedCMList.add(cm);
                }
            }
            update changedCMList;
        } catch(DmlException ex){
            ApexPages.addMessages(ex);
        }
        return null;
    }

  The complete class:

 

public with sharing class CampaignListOwner13{

    public CampaignListOwner13() {

    }

        List<SelectOption> selectedOwnerList = new List<SelectOption>();
        Map<id, String> mappingval = new Map<id, String>();
        Map<String, String> mappingcval = new Map<String, String>();
        Map<String, String> mappingsval = new Map<String, String>();
        public Map<String, String> localCStatusMap;
        public String selectedval { get;  set;}
        public String selectedcval { get;  set;}
        public String selectedsval { get;  set;}
        public string statusval { get; set;}
        public string statusUpdate   {get; set;}
        public string campaignStatus {get; set;}
 
    public CampaignListOwner13(ApexPages.StandardController controller) {   }
    public String getCampaign() {
        return this.Campaign;
    }
    public String getCampaignStatus() {
        return this.CampaignStatus;
    }    
    public string s;
    public String campaign;
    public transient string               Campaignid{ get; set;}
    private transient CampaignMember[]    members; //the members for that campaign
    public transient String               owner; //owner ID
    public string getOwner() {
        return this.owner;
    }    
    public void setOwner(String s) {
 this.Owner = s; }
  public List<CampaignMember> CampaignMember { get;  set;}
     public List<SelectOption> getselectedOwner(){
         List<SelectOption> optionList = new List<SelectOption>();
            optionList.add(new SelectOption( '1', 'SELECT' ));
            for(User u:[select id,name from user where id in (select ownername__c from campaignmember) order by name]) {
            optionList.add(new SelectOption(u.id, u.name));
            mappingval.put(u.id, u.name);
        }
            return optionList;
        }      
    public List <SelectOption> getcampaignlists(){
system.debug('SFDC TEST ************ OWNER' + Owner);
system.debug('SFDC TEST1 *************' + selectedVal);

            AggregateResult[] groupedResults = [select Campaignid , Campaign_Name__c from campaignmember where 
                        ownername__c=:selectedval group by Campaignid, Campaign_Name__c ];
        List <SelectOption> optionList = new list<SelectOption>();
        optionList.add(new SelectOption( '1', 'SELECT' ));
        system.debug('SFDC TEST2 *************' + selectedVal);
        if(selectedcval!= null){
    for(Aggregateresult ar :groupedResults) {
            optionList.add(new SelectOption(String.valueof( ar.get('Campaign_Name__c')), String.valueof(ar.get('Campaign_Name__c'))));
            String aID = (string)ar.get('Campaign_Name__c');
            mappingcval.put(aID, aID);
            }
        }
        return optionList;
    }
    public List <SelectOption> getstatuslist(){
system.debug('SFDC TEST ************ OWNER' + Owner);
system.debug('SFDC TEST3 *************' + selectedVal);
            AggregateResult[] groupedResults = [select Status from campaignmember where 
                        ownername__c=:selectedval and Campaign_Name__c=:selectedcval group by Status ];
        List <SelectOption> optionList = new list<SelectOption>();
        optionList.add(new SelectOption( '1', 'SELECT' ));
        system.debug('SFDC TEST4 *************' + selectedVal);
        
        system.debug('SFDC TESTold *************' + selectedVal);
        
        if(selectedval!= null){
    for(Aggregateresult ar :groupedResults) {
            optionList.add(new SelectOption(String.valueof( ar.get('Status')), String.valueof(ar.get('Status'))));
            String sID = (string)ar.get('Status');
            mappingsval.put(sID, sID);
            }
        }
        return optionList;
    }
    public List<SelectOption> getcStatus(){
         List<SelectOption> options = new List<SelectOption>();
             options.add(new SelectOption(campaignmember[0].status, campaignmember[0].status));
             for(CampaignMemberStatus ccm:[select id, Label from CampaignMemberStatus where  Campaignid in 
                 (select campaignid from CampaignMember where Campaign_Name__c =:selectedcval) and Label != :statusupdate]){
                 options.add(new SelectOption(ccm.id, ccm.label));
             }
         return options;
        }


    public PageReference campaignRefresh() {       
              system.debug('$$$$$:'+selectedcval);
              system.debug('SFDC TEST5 *************' + selectedVal);
              system.debug(mappingval.get(selectedval));
              system.debug('SFDC TEST6 *************' + selectedVal);
               try {
                 if( selectedval != '1'){
                   
                    CampaignMember = [select Id, owner_Name__c, Campaign_Name__c, ContactId, LeadId, 
                    Status, Lead.Lead_Salutation_Name__c, Country__c, CampaignId, Campaign.Name, Company__c,
                    Lead.Id, Lead.Salutation, Lead.Title, Lead.Name, Lead.Company, Lead.Phone,
                    Lead.Street, Lead.State, Lead.PostalCode, Lead.Country, Lead.City, Lead.Fax, 
                    Lead.Email, Lead.OwnerId, Lead.Owner.FirstName, Lead.Owner.LastName, Lead.Owner.Id,
                    Contact.ID, Contact.AccountId, Contact.Salutation, Contact.Title, Contact.Name,
                    Contact.Phone, Contact.MailingStreet, Contact.MailingState, Contact.MailingPostalCode, 
                    Contact.MailingCountry, Contact.MailingCity, Contact.Fax, Contact.Email, Contact.OwnerId,
                    Contact.Owner.FirstName, Contact.Owner.LastName, Contact.Owner.Id, Contact.Account.name,
                    Log_A_Call_Notes__c, Contact.Contact_Salutation_Name__c, Title__c, Email__c, Phone__c from
                        Campaignmember where owner_Name__c =: mappingval.get(selectedval) limit 99];
                        
                   }
                     
                   if (selectedcval != '1' & selectedval != '1' )
                    {
                      CampaignMember = [select Id, owner_Name__c,Campaign_Name__c , ContactId, LeadId, Status, 
                        Lead.Lead_Salutation_Name__c, Country__c, CampaignId, Campaign.Name, Company__c,
                        Lead.Id, Lead.Salutation, Lead.Title, Lead.Name, Lead.Company, Lead.Phone,
                        Lead.Street, Lead.State, Lead.PostalCode, Lead.Country, Lead.City, Lead.Fax, 
                        Lead.Email, Lead.OwnerId, Lead.Owner.FirstName, Lead.Owner.LastName, Lead.Owner.Id,
                        Contact.ID, Contact.AccountId, Contact.Salutation, Contact.Title, Contact.Name, 
                        Contact.Phone, Contact.MailingStreet, Contact.MailingState, Contact.MailingPostalCode, 
                        Contact.MailingCountry, Contact.MailingCity, Contact.Fax, Contact.Email, Contact.OwnerId,
                        Contact.Owner.FirstName, Contact.Owner.LastName, Contact.Owner.Id, Contact.Account.name,
                        Log_A_Call_Notes__c, Contact.Contact_Salutation_Name__c, Title__c, Email__c, Phone__c from
                        Campaignmember where owner_Name__c =: mappingval.get(selectedval) and
                        Campaign_Name__c =: mappingcval.get(selectedcval) limit 99];  
                    }
                    system.debug('SFDC TEST10 *************' + selectedVal);        
                   if(selectedsval != '1' && selectedcval != '1' && selectedval != '1')
                    {
                    CampaignMember = [select Id, owner_Name__c, Campaign_Name__c, ContactId, LeadId, Status, 
                        Lead.Lead_Salutation_Name__c, Country__c, CampaignId, Campaign.Name,Company__c,
                        Lead.Id, Lead.Salutation, Lead.Title, Lead.Name, Lead.Company, Lead.Phone,
                        Lead.Street, Lead.State, Lead.PostalCode, Lead.Country, Lead.City, Lead.Fax, 
                        Lead.Email, Lead.OwnerId, Lead.Owner.FirstName, Lead.Owner.LastName, Lead.Owner.Id,
                        Contact.ID, Contact.AccountId, Contact.Salutation, Contact.Title, Contact.Name, 
                        Contact.Phone, Contact.MailingStreet, Contact.MailingState, Contact.MailingPostalCode, 
                        Contact.MailingCountry, Contact.MailingCity, Contact.Fax, Contact.Email, Contact.OwnerId,
                        Contact.Owner.FirstName, Contact.Owner.LastName, Contact.Owner.Id, Contact.Account.name,
                        Log_A_Call_Notes__c, Contact.Contact_Salutation_Name__c, Title__c, Email__c, Phone__c from
                       Campaignmember where owner_Name__c =: mappingval.get(selectedval) and
                        Campaign_Name__c =: mappingcval.get(selectedcval) and status =: mappingsval.get(selectedsval) limit 99];
                       system.debug('SFDC TEST11 *************' + selectedVal);   
                    }    
               }catch( Exception e ){
                ApexPages.addMessages( e );
            }     
             system.debug('##################' + CampaignMember);
             system.debug('SFDC TEST12 *************' + selectedVal);   
             return null;
    }
    
    List<CampaignMember> results;
    
    PageReference pageRef = new PageReference('/apex/AExcel');
    public PageReference campaignExport(){
             results= [select Id, owner_Name__c,Campaign_Name__c , ContactId, LeadId, Status, 
                        Lead.Lead_Salutation_Name__c, Country__c, CampaignId, Campaign.Name, Company__c,
                        Lead.Id, Lead.Salutation, Lead.Title, Lead.Name, Lead.Company, Lead.Phone,
                        Lead.Street, Lead.State, Lead.PostalCode, Lead.Country, Lead.City, Lead.Fax, 
                        Lead.Email, Lead.OwnerId, Lead.Owner.FirstName, Lead.Owner.LastName, Lead.Owner.Id,
                        Contact.ID, Contact.AccountId, Contact.Salutation, Contact.Title, Contact.Name, 
                        Contact.Phone, Contact.MailingStreet, Contact.MailingState, Contact.MailingPostalCode, 
                        Contact.MailingCountry, Contact.MailingCity, Contact.Fax, Contact.Email, Contact.OwnerId,
                        Contact.Owner.FirstName, Contact.Owner.LastName, Contact.Owner.Id, Contact.Account.name,
                        Log_A_Call_Notes__c, Contact.Contact_Salutation_Name__c, Title__c, Email__c, Phone__c from
                        Campaignmember where owner_Name__c =: mappingval.get(selectedval)limit 99];
      return pageref;
    }    
    Map<Id, CampaignMember> origCMMap = new Map<Id, CampaignMember>([select Id, owner_Name__c, Campaign_Name__c, ContactId, LeadId, Status, 
                        Lead.Lead_Salutation_Name__c, Country__c, CampaignId, Campaign.Name,Company__c,
                        Lead.Id, Lead.Salutation, Lead.Title, Lead.Name, Lead.Company, Lead.Phone,
                        Lead.Street, Lead.State, Lead.PostalCode, Lead.Country, Lead.City, Lead.Fax, 
                        Lead.Email, Lead.OwnerId, Lead.Owner.FirstName, Lead.Owner.LastName, Lead.Owner.Id,
                        Contact.ID, Contact.AccountId, Contact.Salutation, Contact.Title, Contact.Name, 
                        Contact.Phone, Contact.MailingStreet, Contact.MailingState, Contact.MailingPostalCode, 
                        Contact.MailingCountry, Contact.MailingCity, Contact.Fax, Contact.Email, Contact.OwnerId,
                        Contact.Owner.FirstName, Contact.Owner.LastName, Contact.Owner.Id, Contact.Account.name,
                        Log_A_Call_Notes__c, Contact.Contact_Salutation_Name__c, Title__c, Email__c, Phone__c from
                       Campaignmember where owner_Name__c =: mappingval.get(selectedval) and
                        Campaign_Name__c =: mappingcval.get(selectedcval) and status =: mappingsval.get(selectedsval) limit 99]);
              

 public PageReference save() {
        try {
            List<CampaignMember> changedCMList=new List<CampaignMember>();
            for ( CampaignMember cm: CampaignMember) {
                CampaignMember cm2=origCMMap.get(cm.Id);
                if ( cm2 != null &&
                    (cm2.Status != selectedsval ||
                     cm2.Log_A_Call_Notes__c != cm.Log_A_Call_Notes__c) ) {
                     changedCMList.add(cm);
                }
            }
            update changedCMList;
        } catch(DmlException ex){
            ApexPages.addMessages(ex);
        }
        return null;
    }
}

 

Visualforce Page

<apex:page standardcontroller="CampaignMember" extensions="CampaignListOwner13" showheader="true" sidebar="false">
  <apex:sectionHeader title="Campaign Lead Management" />
  <apex:form id="calls">  
    <apex:pageBlock >

        <apex:outputpanel layout="block">
            <apex:outputText >Owner: </apex:outputText>  
             
        <apex:selectList value="{!selectedval}" size="1">
          <apex:selectOptions value="{!selectedOwner}"/>
          <apex:actionSupport event="onchange" status="counterStatus" action="{!campaignRefresh}" rerender="campPck,calls,calls, 
                  status, callList, owners, goToCampaign"/>
</apex:selectList>
</apex:outputpanel>
        <apex:outputpanel layout="block" id="campPck">

            <apex:outputText >Campaign:</apex:outputText>        
        <apex:selectList value="{!selectedcval}" size="1"> 
          <apex:selectOptions value="{!campaignLists}"/>
            <apex:actionSupport event="onchange" status="counterStatus" action="{!campaignRefresh}" 
                rerender="campPck,calls,calls, status, callList, owners, goToCampaign"/>
</apex:selectList>
<br/>
            <apex:outputText >Status:</apex:outputText>        
        <apex:selectList value="{!selectedsval}" size="1"> 
          <apex:selectOptions value="{!statuslist}"/>
            <apex:actionSupport event="onchange" status="counterStatus" action="{!campaignRefresh}" 
rerender="calls, status, callList, owners, goToCampaign"/>
</apex:selectList>
      </apex:outputpanel>
      <apex:pageBlockButtons >
            <apex:outputPanel layout="block" style="float: right; padding-right: 5px; padding-bottom: 5px">
             <apex:commandButton value="Export to Excel" action="{!campaignExport}"/>
             <apex:commandButton value="Update All" action="{!save}"/>  
            </apex:outputPanel>
      </apex:pageBlockButtons>
        <apex:outputPanel layout="block">


            <apex:outputPanel layout="block" style="clear: both;">
            </apex:outputPanel>
        </apex:outputPanel>
           <apex:actionStatus id="counterStatus">
              <apex:facet name="start">  
                <apex:outputPanel id="processing">
                  <apex:pageMessage title="Processing..." severity="info" strength="2" rendered="true" />
                  
                  <apex:image id="loader" url="{!URLFOR($Resource.CampaignCallDown, '/images/loaderImage.gif')}"/>
                </apex:outputPanel>  

              </apex:facet>

              <apex:facet name="stop">
              
                    <apex:pageBlockTable value="{!CampaignMember}" var="members" id="calls">
                     <apex:column value="{!members.Owner_Name__c}" headerValue="Owner" 
                         rendered="true" />
                     <apex:column value="{!members.Campaignid}" headerValue="Campaign" 
                         rendered="true" />
                     <apex:column value="{!members.Country__c}" headerValue="Country" 
                         rendered="true" />
                     <apex:column value="{!members.leadid}" headerValue="Name" 
                         rendered="true" />
                     <apex:column value="{!members.Title__c}" headerValue="Title" 
                         rendered="true" />
                     <apex:column value="{!members.Country__c}" headerValue="Country" 
                         rendered="true" />
                    <apex:column headerValue="Status">
                           <apex:selectList size="1" value="{!statusupdate}" multiselect="false">
                           <apex:selectOptions value="{!cStatus}"/>
                           </apex:selectList>                    
                    </apex:column>
                     <apex:column headerValue="Notes">
                            <apex:inputTextarea value="{!members.Log_A_Call_Notes__c}" cols="25" rows="1" onFocus="this.rows=3;" onBlur="this.rows=1" />
                            <br />
                        </apex:column> 
                     <apex:column value="{!members.Email__c}" headerValue="E-mail" 
                         rendered="true" />
                     <apex:column value="{!members.Phone__c}" headerValue="Phone" 
                         rendered="true" />
                      

                    </apex:pageBlockTable>
                   </apex:facet>
                  </apex:actionStatus>
 
  </apex:pageBlock>     
</apex:form>
</apex:page>

 

How do I save correct this page reference to save only the records that I am editing?

 

thank you,

ckellie

 

Hi.

 

I created an  Authenticated Website User License.

While creating  this User License I found in the profile that only 

Standard Object Permissions is to "Document" only.

There was no permission to other Standard Object like Contact,Account.

 

To test this I created a VF page called 'My Page' which inserts a record to the Contact.

The user after login 'My Page' is displayed and when the button in the 'My Page' is clicked

a new Contact record is created.

 

I am very much surprised that in profile there is no permission for Contact,

but Authenticated Website User was able to create a new record in the Contact....!

 

 

Cheers

suresh

 

 

Hi,

I am running a query which performs a select based on the SystemModstamp which looks like

select field, field, field where SystemModstamp > DateTime

where DateTime is in UTC and of the form 1999-01-01T23:01:01Z. The call is returning objects even when I set the time to 30 minutes into the future from the current time. I also tried specifying the time in the form 1999-01-01T23:01:01-08:00 but had the same issue.

I thought that this was a timezone issue, but I see that the time string is correct when I debug and inspect the query going across. Also, it seems that if I was looking at 2 hours into the future (on one attempt), no objects would be returned but at 1 hour into the future, I was still retrieving objects.

I am using the partner WSDL with .Net 1.1 and my timezone is PST.

Has anyone else run into a similar issue or have any insights to offer?

Thanks,
Chirayu.