• rickyn
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 9
    Replies

I am using the X-Paypal Toolkit for force.com and am attempting to create a new paypal account using the adaptive accounts API.

 

I am using the CreateAccountTest page from the toolkit.  I receive the following error, although my Sandbox email address is populated on the page and it is the same email address used to login to my paypal sanbox account.

 

PAYPAL TOOLKIT  ERROR 580029 : Missing required request parameter: X-PAYPAL-SANDBOX-EMAIL-ADDRESS

 

It seems that I have to put the Sandbox email in the header of the request based on this https://www.x.com/developers/paypal/forums/paypal-sandbox/adaptive-accounts-create-account-problem

 

However I do not know how to edit the toolkit code to achieve this. Can anyone help please?

 

Thanks

  • April 23, 2012
  • Like
  • 0

Hi, my app flow for my site requires users to login inorder to access pages after a point.  However I do not want them to return to a specific URL, I would like the user to continue to the page they attempted to go to before login was prompted.

I attempted the code below, however it does not redirect from the authentication page although authentication is successful.  It appears that using currentPage() keeps me at a stand still.  Not sure if there is another method I can use?

 

Any one have any suggestions?

 

 global PageReference login() {
        String startUrl = System.currentPageReference().getParameters().get('startURL');
        String CurrentUrl = ApexPages.currentPage().getURL();
        return Site.login(username, password, CurrentUrl);
    }

 

  • March 12, 2012
  • Like
  • 0

I have a form on a sites page that guest users fill out. However submitting form requires authentication, so I'm trying to figure out how to retain the user's submitted form data  through the authentication/registration process, and then post it.  The main goal is to allow the user to authenticate only when needed.

 

The flow would go something like this:

1. User goes to the form page.
2. User fills out the form and presses the Submit button.
3. If the user is not logged in, they are prompted to login or
register.
4. User logs in/registers using standard authentication
5. Once logged in/registered, the form data from Step 2 gets submitted and are redericted to a summary page of their submission

 

I'm not sure how to approach this.

A) I have had thoughts of adding the sitelogin and siteregister controller as extensions to my controller to see if that state gets stored, however concerned about a growing view state on my page.

B) I thougfht about cookies to store the form values, however concerned that cookies may be disabled by the user.  Another challenge is that my form is generated by dynamic visualforce components so the form questions and answers will be different for every session.

 

It seems like this is a problem that a lot people would have solved before.

Any pointers on a best practice for this?

  • March 11, 2012
  • Like
  • 0

I am using Dynamic Visual force and have a werid problem.

 

My dynamic component does not work within the apex:composition tag, however it works outside the tag.

 

Is this a known limitation?

 

<apex:page showheader="false" controller="ProjReqController" action="{!ServiceInfoPageLoad}" standardStylesheets="false" ><!-- cache="True" expires="600" -->

 <apex:composition template="{!if($Site.LoginEnabled,$Site.Template,$Page.Cervice_Trust_User_Site_Template)}"> 
   <apex:define name="body"> 


 <apex:dynamicComponent componentValue="{!DynamicForm}"/> <!--Does not work here-->
   

</apex:define> 
   
</apex:composition>

 <apex:dynamicComponent componentValue="{!DynamicForm}"/> <!--Works here--->

</apex:page>

 

  • March 06, 2012
  • Like
  • 0

Hi,

 

I have a Param and ActionSupport Tag inside an Outputlink, and the value I assign is not being passed to the controller.  Any thoughts? Thanks in advance.

 

<apex:outputpanel id="CategoryList">

            <apex:outputlink id="SCLink">{!SCvalue.Name}             
<apex:actionSupport event="onclick" action="{!showSC}" rerender="testtextline"> <apex:param assignTo="{!SelectedCategoryID}" value="{!SCvalue.ID}" name="SelectedCategoryID"/> </apex:actionSupport> </apex:outputlink> </apex:outputpanel> <apex:outputpanel id="testtextline"> <apex:outputtext >Test-{!SelectedCategoryID}</apex:outputtext> <!--Value starts as null and stays null after rerender--> </apex:outputpanel> Controller Snippet Public String SelectedCategoryID {get;set;} public PageReference showSC(){ system.debug('DEBUG: Entered Show SC and SelectedServiceCategoryID = ' + SelectedCategoryID); return null; }

 

  • March 05, 2012
  • Like
  • 0
Hi, Can someone please guide me through the Conceptual process/ resources that may help me achieve the following: 1) Access a CSV file from an external URL 2) Manipulate some of the columns 3) update records using apex data loader command line Some context. I have a fixed CSV file posted to a external server daily, that needs to be captured, manipulated and update records in salesforce daily. Any guidance or ideas is appreciated. Thanks! Ricky
  • February 21, 2012
  • Like
  • 0


My objective is to insert 500,000 records in ObjectA__c created by looping through Prooduct2 (1,000 records) and Area__c (500 records) objects.


My code below runs fine on for a small sample of the records, however I hit governor limits when trying to executive all records.

 

I been reading on batch apex thinking it may solve my problem, however having never used batch apex, I am not sure if I can pass in the two Objects I need to create the records for the ObjectA__c inserts based on the examples.  If I can, can someone please provide an example on how?

If not any suggestions or examples on how to solve this problem would be greatly appreciated?

 

Thanks in advance

 

public class RefreshAllObjectARelationships {


Public pagereference doRefreshAllObjectARelationships() {
    
    List<ObjectA__c> deleteObjectA_records = [SELECT ID FROM ObjectA__c]; 
    
    System.Debug('DEBUG: deleteObjectA_records List Size =' + deleteObjectA_records.size());
    
    DELETE deleteObjectA_records;
    
    List<Product2> products = [SELECT ID, Name FROM Product2]; //1000 Products returned from Query
   
       System.Debug('DEBUG: products List Size = ' + products.size());
   
    List<Area__c> Areas = [SELECT ID, Name FROM Area__c]; //500 ObjectA records returned from Query
    
	System.Debug('DEBUG: Areas List Size = ' + Areas.size());
    
    
    List<ObjectA__c> ObjectARelationships = new List<ObjectA__c>();
    
        for(Product2 prod : products){
        
        integer i = 0;
        
            for(Area__c A: Areas){
        
                i++;
            
                ObjectA__c ObjA_record = new ObjectA__c(Area__c = A.ID, Service_Task__c = prod.ID);
                             
                      
                      if(i>10){
                        i=0;
                        InsertObjectA_records (ObjectARelationships);
                        ObjectARelationships.Clear();
                    }
                    
                
                    
                    ObjectARelationships.add(ObjA_record);
            }   
        }
        
    InsertObjectA_records (ObjectARelationships);
    
    RETURN NULL;
    
}


public void InsertObjectA_records(List<ObjectA__c> insertObjA_recordList){

System.Debug('DEBUG: ObjA_record List size = ' + insertObjA_recordList.size());

INSERT insertObjA_recordList;

System.Debug('DEBUG: ObjA_record records inserted');


insertObjA_recordList.clear();

  
    
}  

 

  • February 03, 2012
  • Like
  • 0

I am coding dynamic visual force components in my controller and have had success rendering the Inputfield component and SelectList compnent where the Multi-Select Attribute is False however having trouble when the attribute is set to true.

 

Here is the controller code and page code snippet:  Red text shows the error I am receiving.

 

Thanks in advance for your help

 

  for(Service_Task_STQ_Joiner__c STQ: STQList){
        
                STRRList.add(new Service_Task_Request_Response__c());


    // Picklist field code block
                        
                        if(STQ.Service_Task_Request_Questionnaire__r.Type__c == 'Picklist (Multi-Select)'){
                                 
                                 Component.Apex.SelectList STQPicklist = new Component.Apex.SelectList();
                                 
                                 List<String> STQPicklistValues =         STQ.Service_Task_Request_Questionnaire__r.Values__c.Split(':',0);
                                 
STQPicklist.Multiselect = True; /* ERROR when I load VF page: System.VisualforceException: Invalid value for property multiselect: Attribute multiselect for component <apex:selectList> cannot be changed after the component has been created */
//If STQPicklist.Multiselect = False; renders fine, however I need Multi-Select option

	STQPicklist.expressions.value = '{!STRRList[0].Response__c}';
        STQPicklist.Size = STQPicklistValues.Size();
        STQPicklist.id = 'STQPicklist'+i;
       STQPicklist.Required = STQ.Service_Task_Request_Questionnaire__r.Required__c;
        STQPicklist.Title = STQ.Service_Task_Request_Questionnaire__r.Help_Text__c;
                                
      Component.Apex.selectOptions STQOptions = new Component.Apex.SelectOptions();
                                 
                                                                 
          Component.Apex.OutputLabel STQOutputLabel = new Component.Apex.OutputLabel();
          STQOutputLabel.value = STQ.Service_Task_Request_Questionnaire__r.Label__c;
          STQOutputLabel.for = 'STQPicklist'+i;  
                                 
         STRRList[0].Service_Task_Question__c = STQ.Service_Task_Request_Questionnaire__r.Label__c;
                                 
                                 dynPageBlockSection.childComponents.add(STQOutputLabel);
                                 dynPageBlockSection.childComponents.add(STQPicklist);
                                 
                                  for(String s: STQPicklistValues){
                                Component.Apex.selectOption STQOption = new Component.Apex.SelectOption();
                                 	STQOption.itemValue = s;
                                 	STQOption.itemLabel = s; 
                                 	STQPicklist.childComponents.add(STQOption);
                                  }
                        } 

 

 <apex:page showheader="false" controller="CusReqController" action="{!ServiceTaskQuestionnairePageLoad}">
   
 
   <apex:form >

   
   <apex:dynamicComponent componentValue="{!DynamicForm}"/>  
    

    </apex:form>

   
</apex:page>

 

  • February 02, 2012
  • Like
  • 0

 

I am having alignment issues with my output panels. They render fine when the page loads, however after a re-render they are not aligned.  See image and code below.

 

 

 

 

 <apex:outputPanel id="searchResults" style="width:600px;float:left;"> 
   <apex:pageBlockSection columns="1" title="Service Tasks" id="SearchResultsection" > 
		
		<apex:pageBlockSectionItem >
		<apex:commandButton value="Add Service Tasks" action="{!processSelectedST}" styleClass="btn"/>
		<apex:commandButton value="Clear Selection" action="{!refreshSTList}" styleClass="btn"/>
		</apex:pageBlockSectionItem>
		
   <apex:pageBlockTable value="{!ServiceTaskList}" var="STitem" id="STtable">
                            <apex:column headervalue="Select">
                              <apex:inputCheckbox value="{!STitem.selected}"/>
                          </apex:column> 
                              <apex:column headerValue="{!selectedServiceCategory.Name}" value="{!STitem.ST.Name}" /> 
                       </apex:pageBlockTable>    

   </apex:pageBlockSection> 
  </apex:outputPanel> 
  
   <apex:outputPanel id="relatedcategoriespanel" style="width:400px;float:left;"> 
   <apex:pageBlockSection columns="1" title="Related Categories" id="relatedcategoriessection" > 
   
     <apex:dataList value="{!RelatedServiceCategories}" var="RSC" id="relatedservicecategorieslist" type="None">
                   
                 <apex:commandLink value="{!RSC.Related_Service_Category__r.Name}" action="{!refreshSTList}" reRender="STtable, relatedcategoriessection, ServiceCategoryList" >
                    <apex:param name="relatedSCparam" value="{!RSC.Related_Service_Category__c}" assignTo="{!selectedServiceCategoryID}"/>
                 </apex:commandlink> 

        </apex:dataList>
   
    </apex:pageBlockSection> 
  </apex:outputPanel> 

 

Thanks,


RN

  • December 12, 2011
  • Like
  • 0

I am seeking to develop a Map which can hold selected values from a user on a viusal force page

 

I have three variables in context:

 

1) Service_Area__c - SObject

2) Postal Code - String

3) Product2 - SObject

 

Each Service Area selection has a Postal Code and each Service Area/Postal Code combination has multiple Product selections.

 

My logic is to combine Service_Area__c and Postal Code in one virtual object called eServiceArea.

 

I am attempting to create a map like the following:

 

Map<eServiceArea, List<Product2>> Map_ServiceAreaList_ServiceTasksList = new Map<eServiceArea, List<Product2>>();

 

Using some code I found in a wrapper class, assuming its relevant:

public class eServiceArea {
        public Service_Area__c SA {get; set;}
        public string PostalZipCode {get; set;}

        public eServiceArea (Service_Area__c eSA, String ePostalZipCode) {
            SA = eSA;
            PostalZipCode = ePostalZipCode;
        }
    }

 The map will not allow me to save with eServiceArea.  I am not sure if creating a eServiceArea Class is what I need, please provide some direction.

 

Thanks,

 

RN

  • December 12, 2011
  • Like
  • 0

Hi -

 

Does anyone know of a possible walk around to allow customer portal users to have the ability to edit their account records using authenticated sites?

 

I currently have account fields that I want to allow portal users to update in a visual force page.  I am trying to avoid creating a custom object with the account fields just for this purpose.

 

Please let me know if anyone has any ideas.

 

Thanks,


RN

  • November 15, 2011
  • Like
  • 0

Hi - I can't seem to figure out how to get my setter method to bind to my page.  The none of my setter methods are being called.

 

public with sharing class ConRegWizController {

 
Account account;
Shadow_Account__c shadowacct;
Contact primarycontact;

User user = [SELECT id, AccountId, ContactID FROM User WHERE id = : UserInfo.getUserId()];

 public ConRegWizController() {
            //Retrieve records for Portal Users
            if(user.AccountID != NULL ) {
            account = [SELECT id, Name FROM Account WHERE id = : user.AccountID];
            shadowacct = [SELECT id, Name, Con_Annual_Revenue__c, Con_In_Business_Since__c, City__c, Country__c, Postal_Zip_Code__c, Province_State__c, Street__c, Con_Legal_Business_Name__c, Con_Number_of_Employees__c, Con_Type_of_Business__c, Website__c, Con_Work_Category__c FROM Shadow_Account__c WHERE Account__c = : user.AccountID];
            primarycontact = [SELECT id, LastName, FirstName, Phone, MobilePhone, Email, Primary_Contact__c FROM Contact WHERE AccountID = :user.AccountID AND Primary_Contact__c = TRUE ];
            }
           

            
            //Retrieve records for Standard Users
            else        {
            account = [SELECT id, Name FROM Account WHERE id = :ApexPages.currentPage().getParameters().get('id')];
            shadowacct = [SELECT id, Name, Con_Annual_Revenue__c, Con_In_Business_Since__c, City__c, Country__c, Postal_Zip_Code__c, Province_State__c, Street__c, Con_Legal_Business_Name__c, Con_Number_of_Employees__c, Con_Type_of_Business__c, Website__c, Con_Work_Category__c FROM Shadow_Account__c WHERE Account__c = :ApexPages.currentPage().getParameters().get('id')];
            primarycontact = [SELECT id, LastName, FirstName, Phone, MobilePhone, Email, Primary_Contact__c FROM Contact WHERE AccountID = :ApexPages.currentPage().getParameters().get('id') AND Primary_Contact__c = TRUE ];
            }
            
                       
 }


  public Account getAccount() {
      if(account == null)  account = new Account();
      return account;
   }
   
  public void setAccount(Account ACCT)
    {
        Account = ACCT;
    }

 public Shadow_Account__c getShadowAcct() {
      system.debug('DEBUG: shadowacct =' + shadowacct);
      if(shadowacct == null) shadowacct = new Shadow_Account__c ();
      return shadowacct;
   }
   
     public void setShadowAcct(Shadow_Account__c SA)
    {
         system.debug('DEBUG: Entering Shadow Acct Setter method'); //Does not enter method
        ShadowAcct = SA;
    }

  public Contact getprimaryContact() {
       system.debug('DEBUG: primarycontact =' + primarycontact);
      if(primarycontact == null) primarycontact = new Contact();
      return primarycontact;
   }

  public void setprimaryContact(Contact CONT)
    {
        system.debug('DEBUG: Entering Primary Contact Setter method'); //Does not enter method
        primaryContact = CONT;
    }



public PageReference step1() {
      return Page.ContractorRegistrationStep1 ;
    
   }

   public PageReference step2() {
     return Page.ContractorRegistrationStep2;
    
   }

   public PageReference step3() {
      return Page.ContractorRegistrationStep3 ;
     
   }
   
   
   public PageReference step4() {
      return Page.ContractorRegistrationStep4 ;
     
   }
   
   public PageReference step5() {
      return Page.ContractorRegistrationStep5 ;
    
   }

Public pageReference Save() {
  
  system.debug('DEBUG: shadowacct =' + shadowacct.Con_Legal_Business_Name__c);
  system.debug('DEBUG: primarycontact =' + primarycontact.LastName);
   update shadowacct;
   update primarycontact;
   
   /*PageReference ContractorDetails = Page.ContractorDetails;
   ContractorDetails.getParameters().put('ID',acct.ID);
   ContractorDetails.setRedirect(true);   
   return ContractorDetails; */
   
   return Page.ContractorRegistrationStep5;
  
}
     

 

<apex:page sidebar="false" Controller="ConRegWizController">
    <apex:sectionHeader title="Contractor Registration" subtitle="1 of 5 Company & Contact Information"/>   
         <apex:form >
           <apex:pageBlock mode="Detail" >
 
           <apex:pageBlockButtons location="both">
                <apex:commandButton action="{!Save}" value="Save & Exit" styleClass="btn" onclick="return confirmExit()" immediate="true"/>
                 <apex:commandButton action="{!Cancel}" value="Cancel" styleClass="btn" onclick="return confirmCancel()" immediate="true"/>
                <apex:commandButton value="Next" action="{!Step2}" styleClass="btn" />
           </apex:pageBlockButtons> 
           
           <apex:pageBlockSection title="{!Account.Name} Information">
           <apex:inputField value="{!ShadowAcct.Name}"/>
           <apex:inputField value="{!ShadowAcct.Con_Work_Category__c}"/>
           <apex:inputField value="{!ShadowAcct.Con_Legal_Business_Name__c}"/>
           <apex:inputField value="{!ShadowAcct.Con_Type_of_Business__c}"/>
           <apex:inputField value="{!ShadowAcct.Street__c}"/>
           <apex:inputField value="{!ShadowAcct.Con_Number_of_Employees__c}"/>
           <apex:inputField value="{!ShadowAcct.City__c}"/>
           <apex:inputField value="{!ShadowAcct.Con_Annual_Revenue__c}"/>
           <apex:inputField value="{!ShadowAcct.Province_State__c}"/>
           <apex:inputField value="{!ShadowAcct.Con_In_Business_Since__c}"/>
           <apex:inputField value="{!ShadowAcct.Postal_Zip_Code__c}"/>
           <apex:inputField value="{!ShadowAcct.Website__c}"/>
           <apex:inputField value="{!ShadowAcct.Country__c}"/>
         </apex:pageBlockSection>
         
           
           <apex:pageBlockSection title="Primary Contact Information" rendered="{!PrimaryContact.Primary_Contact__c}">
            <apex:inputField value="{!PrimaryContact.FirstName}"/>
            <apex:inputField value="{!PrimaryContact.Phone}"/>
            <apex:inputField value="{!PrimaryContact.LastName}"/>
            <apex:inputField value="{!PrimaryContact.MobilePhone}"/>
            <apex:inputField value="{!PrimaryContact.Email}"/>
           </apex:pageBlockSection>

                    
             
  
        </apex:pageBlock>
        
        </apex:form>

</apex:page>

 

  • October 25, 2011
  • Like
  • 0

Hi, my app flow for my site requires users to login inorder to access pages after a point.  However I do not want them to return to a specific URL, I would like the user to continue to the page they attempted to go to before login was prompted.

I attempted the code below, however it does not redirect from the authentication page although authentication is successful.  It appears that using currentPage() keeps me at a stand still.  Not sure if there is another method I can use?

 

Any one have any suggestions?

 

 global PageReference login() {
        String startUrl = System.currentPageReference().getParameters().get('startURL');
        String CurrentUrl = ApexPages.currentPage().getURL();
        return Site.login(username, password, CurrentUrl);
    }

 

  • March 12, 2012
  • Like
  • 0

I have a form on a sites page that guest users fill out. However submitting form requires authentication, so I'm trying to figure out how to retain the user's submitted form data  through the authentication/registration process, and then post it.  The main goal is to allow the user to authenticate only when needed.

 

The flow would go something like this:

1. User goes to the form page.
2. User fills out the form and presses the Submit button.
3. If the user is not logged in, they are prompted to login or
register.
4. User logs in/registers using standard authentication
5. Once logged in/registered, the form data from Step 2 gets submitted and are redericted to a summary page of their submission

 

I'm not sure how to approach this.

A) I have had thoughts of adding the sitelogin and siteregister controller as extensions to my controller to see if that state gets stored, however concerned about a growing view state on my page.

B) I thougfht about cookies to store the form values, however concerned that cookies may be disabled by the user.  Another challenge is that my form is generated by dynamic visualforce components so the form questions and answers will be different for every session.

 

It seems like this is a problem that a lot people would have solved before.

Any pointers on a best practice for this?

  • March 11, 2012
  • Like
  • 0

I am using Dynamic Visual force and have a werid problem.

 

My dynamic component does not work within the apex:composition tag, however it works outside the tag.

 

Is this a known limitation?

 

<apex:page showheader="false" controller="ProjReqController" action="{!ServiceInfoPageLoad}" standardStylesheets="false" ><!-- cache="True" expires="600" -->

 <apex:composition template="{!if($Site.LoginEnabled,$Site.Template,$Page.Cervice_Trust_User_Site_Template)}"> 
   <apex:define name="body"> 


 <apex:dynamicComponent componentValue="{!DynamicForm}"/> <!--Does not work here-->
   

</apex:define> 
   
</apex:composition>

 <apex:dynamicComponent componentValue="{!DynamicForm}"/> <!--Works here--->

</apex:page>

 

  • March 06, 2012
  • Like
  • 0

Hi,

 

I have a Param and ActionSupport Tag inside an Outputlink, and the value I assign is not being passed to the controller.  Any thoughts? Thanks in advance.

 

<apex:outputpanel id="CategoryList">

            <apex:outputlink id="SCLink">{!SCvalue.Name}             
<apex:actionSupport event="onclick" action="{!showSC}" rerender="testtextline"> <apex:param assignTo="{!SelectedCategoryID}" value="{!SCvalue.ID}" name="SelectedCategoryID"/> </apex:actionSupport> </apex:outputlink> </apex:outputpanel> <apex:outputpanel id="testtextline"> <apex:outputtext >Test-{!SelectedCategoryID}</apex:outputtext> <!--Value starts as null and stays null after rerender--> </apex:outputpanel> Controller Snippet Public String SelectedCategoryID {get;set;} public PageReference showSC(){ system.debug('DEBUG: Entered Show SC and SelectedServiceCategoryID = ' + SelectedCategoryID); return null; }

 

  • March 05, 2012
  • Like
  • 0

 

I am having alignment issues with my output panels. They render fine when the page loads, however after a re-render they are not aligned.  See image and code below.

 

 

 

 

 <apex:outputPanel id="searchResults" style="width:600px;float:left;"> 
   <apex:pageBlockSection columns="1" title="Service Tasks" id="SearchResultsection" > 
		
		<apex:pageBlockSectionItem >
		<apex:commandButton value="Add Service Tasks" action="{!processSelectedST}" styleClass="btn"/>
		<apex:commandButton value="Clear Selection" action="{!refreshSTList}" styleClass="btn"/>
		</apex:pageBlockSectionItem>
		
   <apex:pageBlockTable value="{!ServiceTaskList}" var="STitem" id="STtable">
                            <apex:column headervalue="Select">
                              <apex:inputCheckbox value="{!STitem.selected}"/>
                          </apex:column> 
                              <apex:column headerValue="{!selectedServiceCategory.Name}" value="{!STitem.ST.Name}" /> 
                       </apex:pageBlockTable>    

   </apex:pageBlockSection> 
  </apex:outputPanel> 
  
   <apex:outputPanel id="relatedcategoriespanel" style="width:400px;float:left;"> 
   <apex:pageBlockSection columns="1" title="Related Categories" id="relatedcategoriessection" > 
   
     <apex:dataList value="{!RelatedServiceCategories}" var="RSC" id="relatedservicecategorieslist" type="None">
                   
                 <apex:commandLink value="{!RSC.Related_Service_Category__r.Name}" action="{!refreshSTList}" reRender="STtable, relatedcategoriessection, ServiceCategoryList" >
                    <apex:param name="relatedSCparam" value="{!RSC.Related_Service_Category__c}" assignTo="{!selectedServiceCategoryID}"/>
                 </apex:commandlink> 

        </apex:dataList>
   
    </apex:pageBlockSection> 
  </apex:outputPanel> 

 

Thanks,


RN

  • December 12, 2011
  • Like
  • 0

Hi -

 

Does anyone know of a possible walk around to allow customer portal users to have the ability to edit their account records using authenticated sites?

 

I currently have account fields that I want to allow portal users to update in a visual force page.  I am trying to avoid creating a custom object with the account fields just for this purpose.

 

Please let me know if anyone has any ideas.

 

Thanks,


RN

  • November 15, 2011
  • Like
  • 0

Hi - I can't seem to figure out how to get my setter method to bind to my page.  The none of my setter methods are being called.

 

public with sharing class ConRegWizController {

 
Account account;
Shadow_Account__c shadowacct;
Contact primarycontact;

User user = [SELECT id, AccountId, ContactID FROM User WHERE id = : UserInfo.getUserId()];

 public ConRegWizController() {
            //Retrieve records for Portal Users
            if(user.AccountID != NULL ) {
            account = [SELECT id, Name FROM Account WHERE id = : user.AccountID];
            shadowacct = [SELECT id, Name, Con_Annual_Revenue__c, Con_In_Business_Since__c, City__c, Country__c, Postal_Zip_Code__c, Province_State__c, Street__c, Con_Legal_Business_Name__c, Con_Number_of_Employees__c, Con_Type_of_Business__c, Website__c, Con_Work_Category__c FROM Shadow_Account__c WHERE Account__c = : user.AccountID];
            primarycontact = [SELECT id, LastName, FirstName, Phone, MobilePhone, Email, Primary_Contact__c FROM Contact WHERE AccountID = :user.AccountID AND Primary_Contact__c = TRUE ];
            }
           

            
            //Retrieve records for Standard Users
            else        {
            account = [SELECT id, Name FROM Account WHERE id = :ApexPages.currentPage().getParameters().get('id')];
            shadowacct = [SELECT id, Name, Con_Annual_Revenue__c, Con_In_Business_Since__c, City__c, Country__c, Postal_Zip_Code__c, Province_State__c, Street__c, Con_Legal_Business_Name__c, Con_Number_of_Employees__c, Con_Type_of_Business__c, Website__c, Con_Work_Category__c FROM Shadow_Account__c WHERE Account__c = :ApexPages.currentPage().getParameters().get('id')];
            primarycontact = [SELECT id, LastName, FirstName, Phone, MobilePhone, Email, Primary_Contact__c FROM Contact WHERE AccountID = :ApexPages.currentPage().getParameters().get('id') AND Primary_Contact__c = TRUE ];
            }
            
                       
 }


  public Account getAccount() {
      if(account == null)  account = new Account();
      return account;
   }
   
  public void setAccount(Account ACCT)
    {
        Account = ACCT;
    }

 public Shadow_Account__c getShadowAcct() {
      system.debug('DEBUG: shadowacct =' + shadowacct);
      if(shadowacct == null) shadowacct = new Shadow_Account__c ();
      return shadowacct;
   }
   
     public void setShadowAcct(Shadow_Account__c SA)
    {
         system.debug('DEBUG: Entering Shadow Acct Setter method'); //Does not enter method
        ShadowAcct = SA;
    }

  public Contact getprimaryContact() {
       system.debug('DEBUG: primarycontact =' + primarycontact);
      if(primarycontact == null) primarycontact = new Contact();
      return primarycontact;
   }

  public void setprimaryContact(Contact CONT)
    {
        system.debug('DEBUG: Entering Primary Contact Setter method'); //Does not enter method
        primaryContact = CONT;
    }



public PageReference step1() {
      return Page.ContractorRegistrationStep1 ;
    
   }

   public PageReference step2() {
     return Page.ContractorRegistrationStep2;
    
   }

   public PageReference step3() {
      return Page.ContractorRegistrationStep3 ;
     
   }
   
   
   public PageReference step4() {
      return Page.ContractorRegistrationStep4 ;
     
   }
   
   public PageReference step5() {
      return Page.ContractorRegistrationStep5 ;
    
   }

Public pageReference Save() {
  
  system.debug('DEBUG: shadowacct =' + shadowacct.Con_Legal_Business_Name__c);
  system.debug('DEBUG: primarycontact =' + primarycontact.LastName);
   update shadowacct;
   update primarycontact;
   
   /*PageReference ContractorDetails = Page.ContractorDetails;
   ContractorDetails.getParameters().put('ID',acct.ID);
   ContractorDetails.setRedirect(true);   
   return ContractorDetails; */
   
   return Page.ContractorRegistrationStep5;
  
}
     

 

<apex:page sidebar="false" Controller="ConRegWizController">
    <apex:sectionHeader title="Contractor Registration" subtitle="1 of 5 Company & Contact Information"/>   
         <apex:form >
           <apex:pageBlock mode="Detail" >
 
           <apex:pageBlockButtons location="both">
                <apex:commandButton action="{!Save}" value="Save & Exit" styleClass="btn" onclick="return confirmExit()" immediate="true"/>
                 <apex:commandButton action="{!Cancel}" value="Cancel" styleClass="btn" onclick="return confirmCancel()" immediate="true"/>
                <apex:commandButton value="Next" action="{!Step2}" styleClass="btn" />
           </apex:pageBlockButtons> 
           
           <apex:pageBlockSection title="{!Account.Name} Information">
           <apex:inputField value="{!ShadowAcct.Name}"/>
           <apex:inputField value="{!ShadowAcct.Con_Work_Category__c}"/>
           <apex:inputField value="{!ShadowAcct.Con_Legal_Business_Name__c}"/>
           <apex:inputField value="{!ShadowAcct.Con_Type_of_Business__c}"/>
           <apex:inputField value="{!ShadowAcct.Street__c}"/>
           <apex:inputField value="{!ShadowAcct.Con_Number_of_Employees__c}"/>
           <apex:inputField value="{!ShadowAcct.City__c}"/>
           <apex:inputField value="{!ShadowAcct.Con_Annual_Revenue__c}"/>
           <apex:inputField value="{!ShadowAcct.Province_State__c}"/>
           <apex:inputField value="{!ShadowAcct.Con_In_Business_Since__c}"/>
           <apex:inputField value="{!ShadowAcct.Postal_Zip_Code__c}"/>
           <apex:inputField value="{!ShadowAcct.Website__c}"/>
           <apex:inputField value="{!ShadowAcct.Country__c}"/>
         </apex:pageBlockSection>
         
           
           <apex:pageBlockSection title="Primary Contact Information" rendered="{!PrimaryContact.Primary_Contact__c}">
            <apex:inputField value="{!PrimaryContact.FirstName}"/>
            <apex:inputField value="{!PrimaryContact.Phone}"/>
            <apex:inputField value="{!PrimaryContact.LastName}"/>
            <apex:inputField value="{!PrimaryContact.MobilePhone}"/>
            <apex:inputField value="{!PrimaryContact.Email}"/>
           </apex:pageBlockSection>

                    
             
  
        </apex:pageBlock>
        
        </apex:form>

</apex:page>

 

  • October 25, 2011
  • Like
  • 0

I have a force.com site with login enabled (to do this you need to associated your site with a customer portal)

 

My problem is that even though I have turned off the "standard styles" on my Visualforce pages, the customer portal CSS links still appear on the HTML code and create problems.

 

Is there anyway to get rid of customer protal CSS styles?

 

What if someone wanted to brand their force.com secure site without using anything predefined CSS styles?