• Suman M
  • NEWBIE
  • 25 Points
  • Member since 2012

  • Chatter
    Feed
  • 1
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 19
    Questions
  • 17
    Replies
Hi, Need help with below requirement.
We are supposed to create public group through apex, where users running the apex will NOT have manage users permission. 
We are getting the below exception when we try to create a public group with a user without manage users permission on profile.
System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, As a delegated administrator, you can't create a public group using the API. Create public groups using the user interface.: []

how can we acheive this. Please help. Thanks!
Hi,

I'm woking on a requirment, where I need to have a link in Email template, on clicking the link, if the user is not looged into salesforce, then once he logs into salesforce, the user needs to be taken directly to page which the link is refering

I'm using a visualforce email template and my link is something like below.

<p>For email settings in community please click <a target="_blank" href="{!$Setup.MyPersonalSettings__c.Community_Base_URL__c}/VFPage">here</a></p>

currently if a user is already logged into salesforce/our commuinty then on clicking the link in email then the user is langing on the intended VF page, but this is not working if the user is logging into salesforce/commuinty on clicking the link.

Please help me with possible solution on this. Thank You
Hi,

We have a community in salesforce, when users are trying to register to the community we are gettinig this 'Limit Exceeded' Error.

Screen Capture of Limit Exceed Error on community registration

I have checked the Customer Community user licenses for our Org, we have plenty of licenses left, what could be the possible reason for this issue.

Please help, Thank You.
Hi,

We have a functionality where users post on discussions on a community, in the backend we have Discussions as a Custom object, in this we are taking the Count of Posts made by users on the discussions records.
in the apex class, we are querying on FeedComment to get the count.
Now when a community user logs into community, they are able to post on a Discussion, but they are not able to delete the post that they posted previously. An exception is thrown from rhe Apex class. below is the error msg.

User-added image

Please suggest if there is any workapund for this. Thank You.
Hi,

We have rich text area field on an Object, This field is used to show its content on a VisualForce page on a Community. When we Insert images into this field we are not able to see the Image on the VF page on the community. Below is the error.
User-added image
When I see the source of the Page, using Inspect Element.  the SRC URL is something like this .
<img alt="User-added image" src="/servlet/rtaImage?eid=a1SO0000001mlcp&amp;feoid=00N90000009jGOn&amp;refid=0EMO000000005er"></img>

But, here when I upload a Image into Documents in salesforce and Add an Image in this field using the Image URL, I'm able to see the Image on the Community Page. Then the SRC URL is looking like this.
src="https://org--qa--c.cs5.content.force.com/servlet/servlet.ImageServer?id=015O0000000MH0Q&amp;oid=00DO0000000VdkF&amp;lastMod=1415956267000">.

Is there anyway we can get this URL through Apex an using in the VF Page. Below is part of Apex.

 public List<NewsItem> getOutages() {
        return convertSObjectCustomNewsItemList(messages.get(PLANNED_OUTAGE));
    }

    public List<NewsItem> getFeatures() {
        return convertSObjectCustomNewsItemList(messages.get(NEW_FEATURE));
    }

    public List<NewsItem> getEvents() {
        return convertSObjectCustomNewsItemList(messages.get(MAJOR_EVENT));
    }

    /*
    Helper method to convert a 'native' list of MyWSE_News__c to a list of the public inner NewsItem 
    class. Done so we can hide the MyWSE_News__c object from relevant profiles and use the data in 
    custom VF pages
    */
    private List<NewsItem> convertSObjectCustomNewsItemList(List<MyWSE_News__c> mywseNewsEvents) 
    {
        List<NewsItem> returnList = new List<NewsItem>();
        system.debug('mywseNewsEvents>>'+mywseNewsEvents);
        if(mywseNewsEvents != null) 
        {
            for(MyWSE_News__c event : mywseNewsEvents) 
            {
                NewsItem newsItem = new NewsItem();
                newsItem.name = event.name;
                newsItem.description = event.description__c;
                newsItem.createdDate = event.createddate.format();

                returnList.add(newsItem);
            }
        }

        return returnList;
    }

    public class NewsItem {
        public String name {get; set;}
        public String description {get; set;}
        public String createdDate {get; set;}

        public NewsItem() {
            name = '';
            description = '';
            createdDate = '';
        }
    }
}
Hi,

We have a link called 'Help' on Visualforce page, which is created by Javascript.
<li><a href="{!$Page.MyWSEHelp}" title="Help">Help</a></li>

Now, we have a requirment where this link 'Help' should be hidden from the page for te users who log in with Profile X. How can I make it Hidden in this case. Please help thank You. 
 
Hi,

We have an object called Discussions, When I'm trying to edit a record and save it, I'm again taken back to Edit mode but the data is getting saved.

Actually We have a VF page which use Standard Controller and Extension, this page has Edit button when we click on Edit button it takes to a Edit Page where we edit and save that reflects back on Discussion record in the backend. But when we edit the same record in salesforce standard page and click save it is again taken back to edit mode.


<apex:page showHeader="false" standardStylesheets="true" sidebar="false" docType="html" standardController="Discussion__c" extensions="WSEWDiscussionEditController" action="{!IF(LEN($Site.Domain)>0,'',URLFOR($Action.Discussion__c.Edit, Id, null,true))}"> <apex:composition template="MyWSETemplate"> <apex:define name="header">Discussions</apex:define> <apex:define name="breadcrumb"> Create / Edit Discussion </apex:define> <apex:define name="body"> <link href="{!URLFOR($Resource.MyWSEAssets, 'css/chatterCustomFollowers.css')}" rel="stylesheet"/> <apex:form id="createDiscussion"> <div class="row"> <div class="col-md-4"> <img class="center-block img-responsive" src="{!URLFOR($Resource.MyWSEAssets, 'images/feature_1.jpg')}" alt="discussion" /> <div class="row padding10"> <div class="col-xs-12"> <apex:outputPanel rendered="{!theDiscussion.ownerid == $User.Id}"> <apex:commandButton styleclass="btn btn-primary btn-sm" value="SAVE" action="{!save}"/>&nbsp; </apex:outputPanel> <apex:outputPanel rendered="{!theDiscussion.ownerid == $User.Id}"> <apex:commandButton styleclass="btn btn-primary btn-sm" value="CANCEL" action="{!$Page.MyWSEGroupDiscussion}?id={!theDiscussion.id}"/>&nbsp; </apex:outputPanel> </div> </div> </div>


Save method in Controller

 public PageReference save() {
        try {
          theDiscussion.Related_Interest__c = selectedInterest ;
          update theDiscussion;
          PageReference viewDiscussionPage = Page.MyWSEGroupDiscussion;
          viewDiscussionPage.getParameters().put('Id', theDiscussion.id);
          return viewDiscussionPage;
        } catch (Exception e) {
            ApexPages.Message exceptionMessage = new ApexPages.Message(ApexPages.Severity.FATAL, e.getMessage());
            ApexPages.addMessage(exceptionMessage);
            return null;
        }

Please help on how to fix it. Thank You.
Hi everyone,
I need your help on the below.

I have got a requirment where I need to generate a report that should capture the total login time of users i.e.; Login Time - LogOut Time = total login hours.

Is there anyway we can achieve this, Please help. Thank You
Hi, I'm trying to log a case with salesforce to enable some features on my developer Org. But I'm not able to do so. when I go to help$Training and click Submit Case, it is asking for my credentials and once I give them, it is again redirecting back to same help page. does any one know how we can get rid of this.

Thank You
Hi,

I need help in getting options about refreshing a full copy sandbox from Production without getting data(Records) from Production.

Ours is a banking project, Production data is very secured, So we are not even allowed to get the Production live data into Full Copy sandbox during refresh.

We are looking for options to Copy only Configurations from Production into full copy sandbox.

Could someone please help me on this. Thank You. 
Hi All,

I'm running throw an issue with the below link.

We are using this link in our Org under Custom Links which is used in Home Page. When we click the link we are getting Insufficent privileges.

\007?fcf=00B40000006cg9M&rolodexIndex=-1&page=1

Then I changed the link to \007?fcf=00B40000006cg9M , now it is working but showing a view page.

Do anyone have an idea about the significance of using  rolodexIndex=-1&page=1.

Please help on this. Thank You.
Hi,

Below is my class

public class opptytemlisttrigger
{
    public static Map<id,set<id>> statuids = new Map<id,set<id>>();
    @future
    public static void beforetriggermethod()
    {
     system.debug('UseridsrecievedfrombeforeTrigger'+statuids);
    }
    public static void aftertriggermethod(set<id> newaccid)
    {
        Map<Id, List<OpportunityTeamMember>> newopptytemmemmap = new Map<Id, List<OpportunityTeamMember>>();
        system.debug('AccountIDsreceivedfromtrigger'+newaccid);
        system.debug('UseridsrecievedfrombeforeTrigger'+statuids);
        tr_Opportunity_Sales_Team_Delete__c delSalesTeamObj = new tr_Opportunity_Sales_Team_Delete__c();
        List<tr_Opportunity_Sales_Team_Delete__c> deleteTeamInsert = new List<tr_Opportunity_Sales_Team_Delete__c>();
        List<Opportunity> newopptyinfo = [SELECT Id, OwnerId from Opportunity where AccountId IN : newaccid];
            system.debug('OpportunityDetailsafterchange'+newopptyinfo);
            List<OpportunityTeamMember> newopptytemlist = [SELECT UserId, OpportunityId FROM OpportunityTeamMember where OpportunityId IN : newopptyinfo];
            system.debug('OpptyTeamqueryafterupdate'+newopptytemlist);
            for(OpportunityTeamMember newoppttem : newopptytemlist)
            {
                 if(!newopptytemmemmap.containsKey(newoppttem.OpportunityId))
                 {
                     newopptytemmemmap.put(newoppttem.OpportunityId, new List<OpportunityTeamMember>());
                 }
                 newopptytemmemmap.get(newoppttem.OpportunityId).add(newoppttem);
                 system.debug('OpptyTeamDetails after change**'+newopptytemmemmap);
            }
        if(newopptytemlist.size()>0)
        {
            for(Integer i=0;i<newopptytemlist.size();i++)
            {
                if(string.valueOf(statuids).contains(newopptytemlist[i].UserId))
                {
                    system.debug('EnteredintoIfLoop');
                }
            }
        }
        else if(newopptytemlist.size()==0)
        {
          for(Id optyid: statuids.keyset())
          {
              Set<id> temp = new Set<id>();
              temp=statuids.get(optyid);
              for(Integer i=0;i<temp.size();i++)
              {
                  delSalesTeamObj.tr_team_member__c = string.valueOf(temp[i]);    // Here is where I'm getting the error -> Compile Error: Expression must be a list type: SET<Id>

                  delSalesTeamObj.trOpportunity__c = optyid;
                  delSalesTeamObj.tr_action_type__c = 'Deleted';        
                  deleteTeamInsert.add(delSalesTeamObj);
              }
              system.debug('***deleteTeamInsert***'+deleteTeamInsert);
          }
        }
        if(!deleteTeamInsert.isEmpty())
        {
              Database.SaveResult[] sr1 = Database.insert(deleteTeamInsert,false);
        }       
    }
}

Could someone help on how to fix the error. Thank You.
Hi,

in our organization we are standardizing few profiles, i.e.; making 3 profiles ( A, B, C ) into 1 ( X ).

Currently the system is like, we have few validation rules where we are restricting B or C profiles from the above 3 profiles. So, now when we Club the 3 profiles into 1. now is the validation rule we have to replace B or C profile with X, but all the users under X will be restricted through this validation rule. we want to overcome this situation. Is there any way for this. Can someone help on this. Thank You. 
Hi,

I Have a Trigger (UpdateOpportunityTeamHistory) on OpportunityTeamMember, this trigger has actions to be done whenever there is a Delete/Insert happened on the OpportunityTeamMember list. This actions are executed normally as expected in all the other.

In Our case when an Account is transferred using Transfer Account tool, and this in turn updates Opportunity Team  list (i.e.; removing old member X and adding new member Y), in this case only Insert Action in the trigger is executed and the Opportunity Sales Team History is showing only as user Y is added, but the Delete action is not executed in the trigger.

Is there anything related to Transfer Account Tool functionality.

Please help me on this. Thank You
Hi,

I Have a VF Page which displays the EmailTemplate Name for user selection, Once an user selects a Template name and click submit I need to Pass that selected value to the Controller. I'm getting stuck here, pls help on this. Thank You

VF Page:

<apex:page controller="Opt_In_Out_Renewal_Class">
    <apex:sectionHeader title="SAP OptIn Email Template Selection"/>
        <apex:form >
            <apex:messages styleClass="error" style="color:red" />
            <apex:pageBlock title="Select an Email Template">
                <apex:selectList value="{!OptInTemplates}" size="1">
                    <apex:selectOptions value="{!OptInRenewalNoticeTemplate}"/>
                </apex:selectList>
            </apex:pageBlock>
            <apex:commandButton value="Submit" action="{!Submit}"/>
            <apex:commandButton value="Cancel" action="{!Cancel}"/>
        </apex:form>
</apex:page>


Controller:

public class Opt_In_Out_Renewal_Class
{
    public ID RenewalID;
    public PageReference P;
    map<Id,String> mapOptIntemplates = new map<Id,String>();
    map<Id,String> mapOptOutTemplates = new map<Id,String>();
    List<EmailTemplate> result;
    integer i=0;
    public Opt_In_Out_Renewal_Class()
    {
        RenewalID=ApexPages.currentPage().getParameters().get('RenewalID');
    }
   
    public String OptInTemplates { public get; public set; }
    public List<SelectOption> getOptInRenewalNoticeTemplate()
    {
        List<SelectOption> OptIns= new List<SelectOption>();
        for (EmailTemplate t : [select Id,Name from EmailTemplate where FolderId = '00l70000001QZrV' AND Name Like '%Renewal Notice template- Opt In%'])
        {
            OptIns.add(new SelectOption(t.Id,t.Name));
            mapOptIntemplates.put(t.Id,t.Name);
        }
        return OptIns;
    }
    public void setOptInTemplates(String value)
    {
       
    }
    public String OptOutTemplates{public get; public set;}
    public List<SelectOption> getOptOutRenewalNoticeTemplate()
    {
        List<SelectOption> OptOuts= New List<SelectOption>();
        for (EmailTemplate t1:[select Id, Name From EmailTemplate Where FolderId = '00l70000001QZrV' AND Name Like'%Renewal Notice template- Opt Out%'])
        {
            OptOuts.add(new SelectOption(t1.Id,t1.Name));
            mapOptOutTemplates.put(t1.Id,t1.Name);
        }
        return OptOuts;
    }
   
    public PageReference Submit()
    {
        result=(List<EmailTemplate>)[select Name from EmailTemplate where Name = :mapOptIntemplates.get(OptInTemplates)];
        system.debug('***Name***'+result);
        for(i=0;i<result.length;i++)
        {
        if(result[i]=='Renewal Notice template- Opt In_Detailed')
        {
            P = New PageReference('/_ui/core/email/author/EmailAuthor?p3_lkid='+RenewalID+'&retURL=%2F'+RenewalID+'&template_id='+'00X70000001X0aT');
        }
        else if(result[i]=='Renewal Notice template- Opt In_One Price')
        {
            P = New PageReference('/_ui/core/email/author/EmailAuthor?p3_lkid='+RenewalID+'&retURL=%2F'+RenewalID+'&template_id='+'00X70000001X57E');
        }
        }
        return P;
    }
    public PageReference Cancel()
    {
        P = New PageReference('/'+RenewalID);
        return P;
    }
}

Hi All,

 

Could someone please help me on the below scenario.

 

There are many profiles in one Sandbox, I wanted to move all the profiles from one sandbox environment to another sandbox. Now I'm doing this manually, by setting up each and every thing in every profile.

 

Is there any other way to do this. any way to automate this.

 

Please help me on this. Thank You

Hi All,

 

Could someone please help me on the below requirement.

 

I'm creating a New Object named ' History_Object ', Whenever I create or update a record in another Object, There should be a Record Created in the History_Object. How to achieve this.

 

Someone please help me ASAP. Thank You. 

Hi,

 

I have created a Custom Picklist Field ( Country__c ) in a Standard Object ( Contact ). I have created a VF page and have a selectList component in it, I want to pass the Picklist filed values into VF page. Please help me on this.

 

VF Page:

 

<apex:page standardController="Contact" extensions="countryExtension" standardStylesheets="true">

<apex:form >
<apex:pageBlock title="Contact Edit" mode="edit">
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value=" Save "> </apex:commandButton>
<apex:commandButton action="{!cancel}" value="Cancel"></apex:commandButton>
</apex:pageBlockButtons>
<apex:pageBlockSection title="General Information" columns="2">
<apex:inputField value="{!Contact.FirstName}"></apex:inputField>
<apex:inputField value="{!Contact.LastName}"></apex:inputField>
<apex:inputField value="{!Contact.Department}"></apex:inputField>
<apex:inputField value="{!Contact.Phone}"></apex:inputField>

<apex:inputField value="{!Contact.Email}"></apex:inputField>

</apex:pageBlockSection>
<apex:pageBlockSection columns="1" showHeader="false">
<apex:pageBlockSectionItem >
<apex:outputLabel value="Country Name" for="accts"></apex:outputLabel>
<apex:selectList id="accts" value="{!Contact.Country__c}" size="1" title="Contact">
<apex:selectOptions value="{!accts}"></apex:selectOptions>
</apex:selectList>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 

Controller:

 

public class countryExtension
{
public Contact c;

public countryExtension(ApexPages.StandardController stdController)
{
this.c = (Contact)stdController.getRecord();
}
public List<selectOption> getaccts()
{
List<selectOption> options = new List<selectOption>();
options.add(new selectOption('', '- None -'));
for (Contact c : [SELECT id, Country__c FROM Contact Limit 1])
{
System.debug(c);
options.add(new selectOption(c.id, c.Country__c));

}
return options;
}
}

 

Hi,

 

Please help me with the below scenario, I have Visualforce page through which I can select a value from Picklist and based on the Picklist value particular Checkboxes will be displayed on the page. My Requirment is when a checkbox value is selected and Save botton is clicked, then the checkbox value need to be stored in a TextArea Field in the respective Object.

 

Selected Checkbox values should be displayed in a TextArea Field ' PlacesVisisted__c ' in the Contact Object.

 

Please help me on this scenario. ThankYou.

 

Below is my Visualforce Page.

 

<apex:page standardController="Contact">
<apex:form >
<apex:pageBlock title="Update Contact Details">
 <apex:pageBlockButtons location="bottom">
  <apex:commandButton action="{!save}" value="Save"/>
  <apex:commandButton action="{!cancel}" value="Cancel"/>
 </apex:pageBlockButtons>
<apex:pageBlockSection id="NewPage" title="Select The Country">
    <apex:inputField value="{!Contact.Country__c}">
    <apex:actionSupport event="onchange" reRender="IndiaBlock, USBlock, ChinaBlock, AusesBlock"/>
    </apex:inputField>
    <apex:inputText value="{!Contact.Name}"/>
</apex:pageBlockSection> 
<apex:outputPanel id="IndiaBlock">
 <apex:pageBlockSection rendered="{!Contact.Country__c == 'India'}" id="SampleSendInfoBlock" title="Select Places Visited">
    <apex:inputCheckbox label="Agra"/>
    <apex:inputcheckbox label="Delhi"/>
 </apex:pageBlockSection>
</apex:outputPanel>
<apex:outputPanel id="USBlock">
 <apex:pageBlockSection title="Select Places Visited" rendered="{!Contact.Country__c == 'America'}" id="USPageBlock">
  <apex:inputCheckbox label="Newyork"/>
  <apex:inputCheckbox label="Washington"/>
 </apex:pageBlockSection> 
</apex:outputPanel>
<apex:outputPanel id="ChinaBlock">
 <apex:pageBlockSection title="Select Places Visited" rendered="{!Contact.Country__c == 'China'}" id="ChinaPageBlock">
 <apex:inputCheckbox label="Bejing"/>
 <apex:inputCheckbox label="Taiwan"/>
 </apex:pageBlockSection>
</apex:outputPanel>
<apex:outputPanel id="AusesBlock">
 <apex:pageBlockSection title="Select Places Visited" rendered="{!Contact.Country__c == 'Australia'}" id="AusesPageBlock">
 <apex:inputCheckbox label="Sydney"/>
 <apex:inputCheckbox label="Canberra"/>
 </apex:pageBlockSection>
</apex:outputPanel>
</apex:pageBlock>
</apex:form>
</apex:page>
Hi,

in our organization we are standardizing few profiles, i.e.; making 3 profiles ( A, B, C ) into 1 ( X ).

Currently the system is like, we have few validation rules where we are restricting B or C profiles from the above 3 profiles. So, now when we Club the 3 profiles into 1. now is the validation rule we have to replace B or C profile with X, but all the users under X will be restricted through this validation rule. we want to overcome this situation. Is there any way for this. Can someone help on this. Thank You. 
Hi,

We have a community in salesforce, when users are trying to register to the community we are gettinig this 'Limit Exceeded' Error.

Screen Capture of Limit Exceed Error on community registration

I have checked the Customer Community user licenses for our Org, we have plenty of licenses left, what could be the possible reason for this issue.

Please help, Thank You.
Hi everyone,
I need your help on the below.

I have got a requirment where I need to generate a report that should capture the total login time of users i.e.; Login Time - LogOut Time = total login hours.

Is there anyway we can achieve this, Please help. Thank You
Hi,

I need help in getting options about refreshing a full copy sandbox from Production without getting data(Records) from Production.

Ours is a banking project, Production data is very secured, So we are not even allowed to get the Production live data into Full Copy sandbox during refresh.

We are looking for options to Copy only Configurations from Production into full copy sandbox.

Could someone please help me on this. Thank You. 
Hi,

in our organization we are standardizing few profiles, i.e.; making 3 profiles ( A, B, C ) into 1 ( X ).

Currently the system is like, we have few validation rules where we are restricting B or C profiles from the above 3 profiles. So, now when we Club the 3 profiles into 1. now is the validation rule we have to replace B or C profile with X, but all the users under X will be restricted through this validation rule. we want to overcome this situation. Is there any way for this. Can someone help on this. Thank You. 
Hi,

I Have a VF Page which displays the EmailTemplate Name for user selection, Once an user selects a Template name and click submit I need to Pass that selected value to the Controller. I'm getting stuck here, pls help on this. Thank You

VF Page:

<apex:page controller="Opt_In_Out_Renewal_Class">
    <apex:sectionHeader title="SAP OptIn Email Template Selection"/>
        <apex:form >
            <apex:messages styleClass="error" style="color:red" />
            <apex:pageBlock title="Select an Email Template">
                <apex:selectList value="{!OptInTemplates}" size="1">
                    <apex:selectOptions value="{!OptInRenewalNoticeTemplate}"/>
                </apex:selectList>
            </apex:pageBlock>
            <apex:commandButton value="Submit" action="{!Submit}"/>
            <apex:commandButton value="Cancel" action="{!Cancel}"/>
        </apex:form>
</apex:page>


Controller:

public class Opt_In_Out_Renewal_Class
{
    public ID RenewalID;
    public PageReference P;
    map<Id,String> mapOptIntemplates = new map<Id,String>();
    map<Id,String> mapOptOutTemplates = new map<Id,String>();
    List<EmailTemplate> result;
    integer i=0;
    public Opt_In_Out_Renewal_Class()
    {
        RenewalID=ApexPages.currentPage().getParameters().get('RenewalID');
    }
   
    public String OptInTemplates { public get; public set; }
    public List<SelectOption> getOptInRenewalNoticeTemplate()
    {
        List<SelectOption> OptIns= new List<SelectOption>();
        for (EmailTemplate t : [select Id,Name from EmailTemplate where FolderId = '00l70000001QZrV' AND Name Like '%Renewal Notice template- Opt In%'])
        {
            OptIns.add(new SelectOption(t.Id,t.Name));
            mapOptIntemplates.put(t.Id,t.Name);
        }
        return OptIns;
    }
    public void setOptInTemplates(String value)
    {
       
    }
    public String OptOutTemplates{public get; public set;}
    public List<SelectOption> getOptOutRenewalNoticeTemplate()
    {
        List<SelectOption> OptOuts= New List<SelectOption>();
        for (EmailTemplate t1:[select Id, Name From EmailTemplate Where FolderId = '00l70000001QZrV' AND Name Like'%Renewal Notice template- Opt Out%'])
        {
            OptOuts.add(new SelectOption(t1.Id,t1.Name));
            mapOptOutTemplates.put(t1.Id,t1.Name);
        }
        return OptOuts;
    }
   
    public PageReference Submit()
    {
        result=(List<EmailTemplate>)[select Name from EmailTemplate where Name = :mapOptIntemplates.get(OptInTemplates)];
        system.debug('***Name***'+result);
        for(i=0;i<result.length;i++)
        {
        if(result[i]=='Renewal Notice template- Opt In_Detailed')
        {
            P = New PageReference('/_ui/core/email/author/EmailAuthor?p3_lkid='+RenewalID+'&retURL=%2F'+RenewalID+'&template_id='+'00X70000001X0aT');
        }
        else if(result[i]=='Renewal Notice template- Opt In_One Price')
        {
            P = New PageReference('/_ui/core/email/author/EmailAuthor?p3_lkid='+RenewalID+'&retURL=%2F'+RenewalID+'&template_id='+'00X70000001X57E');
        }
        }
        return P;
    }
    public PageReference Cancel()
    {
        P = New PageReference('/'+RenewalID);
        return P;
    }
}

Hi All,

 

Could someone please help me on the below scenario.

 

There are many profiles in one Sandbox, I wanted to move all the profiles from one sandbox environment to another sandbox. Now I'm doing this manually, by setting up each and every thing in every profile.

 

Is there any other way to do this. any way to automate this.

 

Please help me on this. Thank You

Hi All,

 

Could someone please help me on the below requirement.

 

I'm creating a New Object named ' History_Object ', Whenever I create or update a record in another Object, There should be a Record Created in the History_Object. How to achieve this.

 

Someone please help me ASAP. Thank You. 

Hi,

 

I have created a Custom Picklist Field ( Country__c ) in a Standard Object ( Contact ). I have created a VF page and have a selectList component in it, I want to pass the Picklist filed values into VF page. Please help me on this.

 

VF Page:

 

<apex:page standardController="Contact" extensions="countryExtension" standardStylesheets="true">

<apex:form >
<apex:pageBlock title="Contact Edit" mode="edit">
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value=" Save "> </apex:commandButton>
<apex:commandButton action="{!cancel}" value="Cancel"></apex:commandButton>
</apex:pageBlockButtons>
<apex:pageBlockSection title="General Information" columns="2">
<apex:inputField value="{!Contact.FirstName}"></apex:inputField>
<apex:inputField value="{!Contact.LastName}"></apex:inputField>
<apex:inputField value="{!Contact.Department}"></apex:inputField>
<apex:inputField value="{!Contact.Phone}"></apex:inputField>

<apex:inputField value="{!Contact.Email}"></apex:inputField>

</apex:pageBlockSection>
<apex:pageBlockSection columns="1" showHeader="false">
<apex:pageBlockSectionItem >
<apex:outputLabel value="Country Name" for="accts"></apex:outputLabel>
<apex:selectList id="accts" value="{!Contact.Country__c}" size="1" title="Contact">
<apex:selectOptions value="{!accts}"></apex:selectOptions>
</apex:selectList>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 

Controller:

 

public class countryExtension
{
public Contact c;

public countryExtension(ApexPages.StandardController stdController)
{
this.c = (Contact)stdController.getRecord();
}
public List<selectOption> getaccts()
{
List<selectOption> options = new List<selectOption>();
options.add(new selectOption('', '- None -'));
for (Contact c : [SELECT id, Country__c FROM Contact Limit 1])
{
System.debug(c);
options.add(new selectOption(c.id, c.Country__c));

}
return options;
}
}

 

Hi,

 

Please help me with the below scenario, I have Visualforce page through which I can select a value from Picklist and based on the Picklist value particular Checkboxes will be displayed on the page. My Requirment is when a checkbox value is selected and Save botton is clicked, then the checkbox value need to be stored in a TextArea Field in the respective Object.

 

Selected Checkbox values should be displayed in a TextArea Field ' PlacesVisisted__c ' in the Contact Object.

 

Please help me on this scenario. ThankYou.

 

Below is my Visualforce Page.

 

<apex:page standardController="Contact">
<apex:form >
<apex:pageBlock title="Update Contact Details">
 <apex:pageBlockButtons location="bottom">
  <apex:commandButton action="{!save}" value="Save"/>
  <apex:commandButton action="{!cancel}" value="Cancel"/>
 </apex:pageBlockButtons>
<apex:pageBlockSection id="NewPage" title="Select The Country">
    <apex:inputField value="{!Contact.Country__c}">
    <apex:actionSupport event="onchange" reRender="IndiaBlock, USBlock, ChinaBlock, AusesBlock"/>
    </apex:inputField>
    <apex:inputText value="{!Contact.Name}"/>
</apex:pageBlockSection> 
<apex:outputPanel id="IndiaBlock">
 <apex:pageBlockSection rendered="{!Contact.Country__c == 'India'}" id="SampleSendInfoBlock" title="Select Places Visited">
    <apex:inputCheckbox label="Agra"/>
    <apex:inputcheckbox label="Delhi"/>
 </apex:pageBlockSection>
</apex:outputPanel>
<apex:outputPanel id="USBlock">
 <apex:pageBlockSection title="Select Places Visited" rendered="{!Contact.Country__c == 'America'}" id="USPageBlock">
  <apex:inputCheckbox label="Newyork"/>
  <apex:inputCheckbox label="Washington"/>
 </apex:pageBlockSection> 
</apex:outputPanel>
<apex:outputPanel id="ChinaBlock">
 <apex:pageBlockSection title="Select Places Visited" rendered="{!Contact.Country__c == 'China'}" id="ChinaPageBlock">
 <apex:inputCheckbox label="Bejing"/>
 <apex:inputCheckbox label="Taiwan"/>
 </apex:pageBlockSection>
</apex:outputPanel>
<apex:outputPanel id="AusesBlock">
 <apex:pageBlockSection title="Select Places Visited" rendered="{!Contact.Country__c == 'Australia'}" id="AusesPageBlock">
 <apex:inputCheckbox label="Sydney"/>
 <apex:inputCheckbox label="Canberra"/>
 </apex:pageBlockSection>
</apex:outputPanel>
</apex:pageBlock>
</apex:form>
</apex:page>