• shikher goel
  • NEWBIE
  • 56 Points
  • Member since 2011
  • Technical Lead
  • http://shikhergoel.blogspot.com/


  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 15
    Replies
Currently there are too many opportunity record types locking out the different business units from seeing each others data and not allowing a clear view of pipeline.  I want to create a single opportunuty page layout opening up the information for all to see.  Is there a trick to doing this.

Currently:
4 different record type
4 different opportunity page layouts
4 different profiles

Looking to do:
1 opportunity record type
4 different opportunity types
1 profile
1 opportunity layout

Any ideas on where to start?
 
VFP:

<apex:page standardController="Teacher__c" extensions="RGMTeacherController">   
      <apex:form id="loginForm" forceSSL="true">
        
        <apex:outputPanel id="actualblock" >
            <apex:tabPanel switchType="client" tabClass="activeTab" inactiveTabClass="inactiveTab" selectedTab="Information">
                
                <apex:tab id="home" label="Home" title="Home">                   
                </apex:tab>
                
                <apex:tab label="Information" name="Information" id="InformationTab" >                                   ----------------------------------------                    
                </apex:tab>

                <apex:tab id="student" label="Student" title="Student">
                    <apex:pageBlock >
                        <apex:selectList label="Standard" id="choosestandard" required="true" value="{!standard}" >
                            <apex:selectOptions value="{!standarditems}" id="standarditem" />                           
                        </apex:selectList> 
                        <apex:selectList label="Section" id="choosesection" required="true" value="{!section}" >
                            <apex:selectOptions value="{!sectionitems}" id="sectionitem" />                           
                        </apex:selectList>
                        <apex:selectList label="Subject" id="choosesubject" required="true" value="{!subject}" >
                            <apex:selectOptions value="{!subjectitems}" id="subjectitem" />                           
                        </apex:selectList>
                        <apex:commandButton action="{!studentsearch}" value="Search" reRender="stulistid" />           
                        <apex:outputPanel id="stulistid" >
                        <apex:pageblocktable value="{!studentlist}" var="a" id="pbTable" >
                            <apex:column value="{!a.Name}"/>
                            <apex:column value="{!a.Roll_Number__c}"/>
                        </apex:pageblocktable>
                        </apex:outputPanel>
                    </apex:pageBlock>
                </apex:tab>
               
            </apex:tabPanel>
        </apex:outputPanel>
      </apex:form>
       
</apex:page>


CTRL:

public class RGMTeacherController {
    public Boolean showRecords{get;set;}
    public List<Student__c> studentlist{get;set;}
    public string[] standard{get;set;}
    public string[] section{get;set;}
    public string[] subject{get;set;}
    public string[] sections;
    public string[] standards;
    public string[] subjects;
     
    public RGMTeacherController(ApexPages.StandardController controller) {
 
        Teacher__c TeacherId = [SELECT Id, Name, Email__c, Section__c, Standard__c, Subject__c, Contact_Number__c FROM Teacher__c WHERE Username__c =: username AND Password__c =: password LIMIT 1];
        ApexPages.currentPage().getParameters().put('id', TeacherId.Id);
        sections = TeacherId.Section__c.split(';', 7);
        standards = TeacherId.Standard__c.split(';', 7);
        subjects = TeacherId.Subject__c.split(';', 7);
    }
    public List<SelectOption> getstandarditems() {
        List<SelectOption> standardoptions = new List<SelectOption>();
         for(Integer i=0; i < standards.size(); i++) {
             standardoptions.add(new SelectOption(standards[i], standards[i]));
         }
        return standardoptions;
    }
    
    public String[] getstandard() {
        return standard;
    }
            
    public void setstandard(String[] standard) {
        this.standard = standard;
    }
    
    public List<SelectOption> getsectionitems() {
        List<SelectOption> sectionoptions = new List<SelectOption>();
        for(Integer i=0; i < standards.size(); i++) {
             sectionoptions.add(new SelectOption(sections[i], sections[i]));
         }
        return sectionoptions;
    }
    
    public String[] getsection() {
        return section;
    }
            
    public void setsection(String[] section) {
        this.section = section;
    }
    
    public List<SelectOption> getsubjectitems() {
        List<SelectOption> subjectoptions = new List<SelectOption>();
        system.debug('*********************************'+standard);
        for(Integer i=0; i < subjects.size(); i++) {
             subjectoptions.add(new SelectOption(subjects[i], subjects[i]));
         }
        return subjectoptions;
    }
    
    public String[] getsubject() {
        return subject;
    }
            
    public void setsubject(String[] subject) {
        this.subject = subject;
    }
    
    public void studentsearch() {
        system.debug('*********************************'+standard);
        studentlist = [SELECT Id, Name, Roll_Number__c FROM Student__c WHERE Standard__c =: standard AND Section__c =: section];
        system.debug('*********************************'+studentlist);
        
    }   
    
}
Hi All,

I am trying to fetch the Salesforce Objects Schema from some other Sandbox. To achieve this ,i am trying to connect salesforce with REST API using this below code :
    try{
      Http h = new Http();
      HttpRequest request= new HttpREquest();
      String endPointURL = 'https://c.cs15.salesforce.com/services/data/v34.0/sobjects';
      request.setHeader('Authorization', 'Bearer '+ UserInfo.getSessionId());
      request.setEndPOint(endPointURL );
      request.setbody(endPointURL );
      request.setMethod('GET');
      HttpResponse hres = h.send(request);
      response = hres.getBody();
      }catch(exception exc)
      {
       system.debug('EXc is '+exc);
       response = exc.getMessage();
      }

 But I am getting the error as "Unable to tunnel through proxy. Proxy returns "HTTP/1.0 404 Not Found".
As far I know this is because of firewalls.but i want to add proxy into my code.
Can someone know,how can we add proxy in apex.???
Currently there are too many opportunity record types locking out the different business units from seeing each others data and not allowing a clear view of pipeline.  I want to create a single opportunuty page layout opening up the information for all to see.  Is there a trick to doing this.

Currently:
4 different record type
4 different opportunity page layouts
4 different profiles

Looking to do:
1 opportunity record type
4 different opportunity types
1 profile
1 opportunity layout

Any ideas on where to start?
 
I am new to coding.  I need a little assistance.  I have embedded my flow in a visualforce page and I am trying to create a custom controller to have the flow finish with redirecting the user to the newly created record.

Page:

<apex:page Controller="SplitCaseController">
<flow:interview name="Split_Case" interview="{!myFlow} finishLocation="/{!FinishPage}">
<apex:param name="CurrentCaseID" value="{!Case.Id}"/>
<apex:param name="CurrentUserID" value="{!$User.Id}"/>
</flow:interview>
</apex:page>

Controller

1
2
3
4
5
6
7
8
9
10
11
12
13
14
public class SplitCaseController {

public Flow.Interview.Split_Case myFlow { get; set; }

public String getmyID() {
if (myFlow==null) return '';
else return myFlow.NewCaseID;
}

public PageReference getFinishPage(){
PageReference p = new PageReference('/' + getmyID());
p.setRedirect(true);
return p;
}}

But every time I try to save the page I get the error "Unknown property 'SplitCaseController.Case'

Help!
Hello Everyone,

Here in my organization we are accessing one field in many areas. Now i just want to know where this field is being used, like Visualforce Pages, Apex Classes etc..

I heard that we can achieve this by report metadata search, but how can i get it? plz update me your thoughts.

Thanks!!
VFP:

<apex:page standardController="Teacher__c" extensions="RGMTeacherController">   
      <apex:form id="loginForm" forceSSL="true">
        
        <apex:outputPanel id="actualblock" >
            <apex:tabPanel switchType="client" tabClass="activeTab" inactiveTabClass="inactiveTab" selectedTab="Information">
                
                <apex:tab id="home" label="Home" title="Home">                   
                </apex:tab>
                
                <apex:tab label="Information" name="Information" id="InformationTab" >                                   ----------------------------------------                    
                </apex:tab>

                <apex:tab id="student" label="Student" title="Student">
                    <apex:pageBlock >
                        <apex:selectList label="Standard" id="choosestandard" required="true" value="{!standard}" >
                            <apex:selectOptions value="{!standarditems}" id="standarditem" />                           
                        </apex:selectList> 
                        <apex:selectList label="Section" id="choosesection" required="true" value="{!section}" >
                            <apex:selectOptions value="{!sectionitems}" id="sectionitem" />                           
                        </apex:selectList>
                        <apex:selectList label="Subject" id="choosesubject" required="true" value="{!subject}" >
                            <apex:selectOptions value="{!subjectitems}" id="subjectitem" />                           
                        </apex:selectList>
                        <apex:commandButton action="{!studentsearch}" value="Search" reRender="stulistid" />           
                        <apex:outputPanel id="stulistid" >
                        <apex:pageblocktable value="{!studentlist}" var="a" id="pbTable" >
                            <apex:column value="{!a.Name}"/>
                            <apex:column value="{!a.Roll_Number__c}"/>
                        </apex:pageblocktable>
                        </apex:outputPanel>
                    </apex:pageBlock>
                </apex:tab>
               
            </apex:tabPanel>
        </apex:outputPanel>
      </apex:form>
       
</apex:page>


CTRL:

public class RGMTeacherController {
    public Boolean showRecords{get;set;}
    public List<Student__c> studentlist{get;set;}
    public string[] standard{get;set;}
    public string[] section{get;set;}
    public string[] subject{get;set;}
    public string[] sections;
    public string[] standards;
    public string[] subjects;
     
    public RGMTeacherController(ApexPages.StandardController controller) {
 
        Teacher__c TeacherId = [SELECT Id, Name, Email__c, Section__c, Standard__c, Subject__c, Contact_Number__c FROM Teacher__c WHERE Username__c =: username AND Password__c =: password LIMIT 1];
        ApexPages.currentPage().getParameters().put('id', TeacherId.Id);
        sections = TeacherId.Section__c.split(';', 7);
        standards = TeacherId.Standard__c.split(';', 7);
        subjects = TeacherId.Subject__c.split(';', 7);
    }
    public List<SelectOption> getstandarditems() {
        List<SelectOption> standardoptions = new List<SelectOption>();
         for(Integer i=0; i < standards.size(); i++) {
             standardoptions.add(new SelectOption(standards[i], standards[i]));
         }
        return standardoptions;
    }
    
    public String[] getstandard() {
        return standard;
    }
            
    public void setstandard(String[] standard) {
        this.standard = standard;
    }
    
    public List<SelectOption> getsectionitems() {
        List<SelectOption> sectionoptions = new List<SelectOption>();
        for(Integer i=0; i < standards.size(); i++) {
             sectionoptions.add(new SelectOption(sections[i], sections[i]));
         }
        return sectionoptions;
    }
    
    public String[] getsection() {
        return section;
    }
            
    public void setsection(String[] section) {
        this.section = section;
    }
    
    public List<SelectOption> getsubjectitems() {
        List<SelectOption> subjectoptions = new List<SelectOption>();
        system.debug('*********************************'+standard);
        for(Integer i=0; i < subjects.size(); i++) {
             subjectoptions.add(new SelectOption(subjects[i], subjects[i]));
         }
        return subjectoptions;
    }
    
    public String[] getsubject() {
        return subject;
    }
            
    public void setsubject(String[] subject) {
        this.subject = subject;
    }
    
    public void studentsearch() {
        system.debug('*********************************'+standard);
        studentlist = [SELECT Id, Name, Roll_Number__c FROM Student__c WHERE Standard__c =: standard AND Section__c =: section];
        system.debug('*********************************'+studentlist);
        
    }   
    
}
I have a requirement where I need to delete a contact record based on some conditions while updating the same Contact record.

How can we delete a record from its own update trigger ?
Hi,

I have a visualforce page similar to registration form.I need to create tabs.In the each tab fields are present user should enter.How can i achieve this.Using pageblockblocksection it is working fine but Title should be in tabs.Please help me out
Hello Geeks,

I have an idea to create a sample Release Management App, and for that I wanted to know whether Salesforce has exposed any API's regarding creating changesets at runtime ? or how can we achieve this ?

If you have any pointers regarding this, please provide your thoughts.


Thank You,
Mahadev
I created a VF page using a controller and not a standard controller. This VF paginate the Search result on Account. I have used Jeff's example 
http://blog.jeffdouglas.com/2009/07/14/visualforce-page-with-pagination/
<apex:page controller="CustomPaginationController" sidebar="false">
I want to override new button on Account with this VF page. Now, because I am not using Standard Controller on Account, VF page is not avaliable.

How can I override new button with this VF page?


 
I have a VF page that is not recognizing a field that i've created. I'm new to this keep in mind. I found an apex class extension and I believe this is whats driving what fields can be used on my VF page. I see some notes in here that our old developer used. I clicked on the show dependincies on my page and the field i'm trying to use is not on there. I feel like this below is telling my page what fields to use from my "Account" object. The new field i want to display i created on the account object. How do i add my new field to my VF page. Here is the part of the Apex Class below i believe thats pulling in the current fields used for the VF page. This below doesn't mean much to me. Please help. Thank you

 // Grab all fields for Account (Customer).
    Map<String, Schema.SObjectField> fieldsAccountMap = Schema.SObjectType.Account.fields.getMap();
    for( String key : fieldsAccountMap.keySet() ) {
      proposalFields += ',Order__r.Customer__r.' + key;
      proposalFields += ',Vendor__r.Account.' + key;
    }

Hi!

 

I want controller for below code.please help me.

 

<apex:page controller="mycustomcontroller">
    <apex:form >
        <apex:sectionHeader title="New Account" subtitle="Account Edit"/>
        <apex:pageBlock helpUrl="https://help.salesforce.com/htviewhelpdoc?err=1&id=account_edit.htm&siteLang=en_US"
                                                          helpTitle="Help for this Page" title="Account Edit" >
            <apex:pageBlockButtons location="bottom">
                <apex:commandButton action="{!save}" value="Save"/>
                <apex:commandButton action="{!Saveandnew}" value="Save & New" id="saveAndNew"/>
                <apex:commandButton action="{!cancel}" value="cancel"/>
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="Account information"  >
            
               
                <apex:inputField value="{!account.name}" />
                <apex:inputField value="{!Account.rating}"/>
                <apex:inputField value="{!account.parentid}"/>
                <apex:inputField value="{!Account.Phone}"/>
                <apex:inputField value="{!Account.AccountNumber}"/>
                <apex:inputField value="{!Account.Fax}"/>
                <apex:inputField value="{!Account.Site}"/>
                <apex:inputField value="{!Account.Website}"/>
                <apex:inputField value="{!Account.Type}"/>
                <apex:inputField value="{!Account.Ownership}"/>
                <apex:inputField value="{!Account.Industry}"/>
                <apex:inputField value="{!Account.NumberOfEmployees}"/>
                <apex:inputField value="{!Account.AnnualRevenue}"/>
                <apex:inputField value="{!Account.Sic}"/>
                
            </apex:pageBlockSection>   
             
            <apex:pageBlockSection title="Address Information" onclick="copy Billing Address to Shipping Address" >
                <A HREF="#" onClick="return copyAddress();">Copy  Mailing Address to Residence Address</A><br></br>
                <apex:inputField value="{!Account.BillingStreet}"/>
                <apex:inputField value="{!Account.ShippingStreet}"/>
                <apex:inputField value="{!Account.Billingcity}"/>
                <apex:inputField value="{!Account.ShippingCity}"/>
                <apex:inputField value="{!Account.Billingstate}"/>
                <apex:inputField value="{!Account.Shippingstate}"/>
                <apex:inputField value="{!Account.Billingpostalcode}"/>
                <apex:inputField value="{!Account.Shippingpostalcode}"/>
                <apex:inputField value="{!Account.Billingcountry}"/>
                <apex:inputField value="{!Account.Shippingcountry}"/>
                
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Additional Information">
                <apex:inputField value="{!Account.CustomerPriority__c}"/>
                <apex:inputField value="{!Account.SLA__c}"/>
                <apex:inputField value="{!Account.SLAExpirationDate__c}"/>
                <apex:inputField value="{!Account.SLASerialNumber__c}"/>
                <apex:inputField value="{!Account.NumberofLocations__c}"/>
                <apex:inputField value="{!Account.UpsellOpportunity__c}"/>
                <apex:inputField value="{!Account.Active__c}"/>
                
            </apex:pageBlockSection>
            
            <apex:pageBlockSection title="Description Information">
            <apex:inputField value="{!Account.Description}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

  • September 26, 2013
  • Like
  • 0

I have been stuck with this for over a day.

 

I am using a component. that was obtained from an unmanaged package,  in my visualforce page. It is complaining that one of the attributes is not getting the right type for its parameter.

 

Following is the attribute definition and controller variable

 

 

  <apex:attribute name="leftOptions"
    description="Options list for left listbox." type="SelectOption[]"
    required="true" assignTo="{!leftOptions}" />

 

public SelectOption[] leftOptions { get; set; }

 

In my VF page, this is how I have been using it and the corresponding extension code

 

My VF:

                    <apex:column headerValue="Dates of Service" >
                        <apex:variable var="dos1" value="{!s.multiLineEdit_tag__c}"/>                        
                        <c:MultiselectPicklist leftLabel="" leftOptions="{!leftOptionList[dos1]}" rightLabel="" rightOptions="{!rightOptionlist[dos1]}"  size="5" width="150px"/>                                
                     </apex:column>   

 

My Controller:

    public List <SelectOption[] > leftSideOptions = new List <List<SelectOption> >();   
    public List<SelectOption[] > getleftOptionList()
    {
        system.debug('leftSideOptions'+leftSideOptions);
        return leftSideOptions;
    }

 

It throws me a VF error as:

Cannot convert the value of '{!leftOptions}' to the expected type.

 


Could someone guide me as to what I am doing wrong?

 

Thank you.

  • November 20, 2012
  • Like
  • 0

Hi I am trying to write a trigger that will update all other open opportunities within the same account when one is closed. Right now we have workflow that sets the opportunity type based on some categories. If ten opportunities open for the same account they are automatically set to "Initial Purchase".

 

What I want to do is have a trigger run when one opportunity is closed won to update the other nine open opportunities to a different type. So the one that closes remains as Initial Purchase, but the other nine change to Existing Customer since they have already purchased from us.

 

Here is what I have so far, but when I close an opportunity as closed won it does not update the other open opportunities for the related account:

 

trigger updateOpportunityType on Opportunity (after update) 
{



// Build a map from the Opportunity ID's referenced in the Accounts for a reverse lookup later.
    Set<Id> OpptyIds = new Set<Id>();
    for (Opportunity opps: trigger.new) 
    if (opps.AccountId != null) 
    OpptyIds.add(opps.AccountId);
    
//Build a list of all open opportunities in the map.    
    List<Opportunity> opptys = new List<Opportunity>([select Id, Type FROM Opportunity 
                                WHERE Type = 'New Customer – Initial PurchaseId'
                                AND isClosed = false
                                AND Id in :OpptyIds]);
                                
//Build a list of the opportunity that is closing.
    List<Opportunity> closedoppty = new List<Opportunity>([select Id, Type FROM Opportunity 
                                WHERE Type = 'New Customer – Initial PurchaseId'
                                AND isClosed = true
                                AND StageName = 'Closed Won'
                                AND Id in :OpptyIds]);

    for (Opportunity openopps: opptys)
    {
        if(!closedoppty.isEmpty())
        {
            openopps.Type = 'New Customer – First 12 Months';
        }
    
    }
    
    update opptys;
    
}

 

Thanks.

My code:

 

CollaborationGroup chatterGroup = new CollaborationGroup();


chatterGroup.Name = appSettings.Developers_Chatter_Group_Name__c;

 

insert chatterGroup;

 

Causes this error:

 

DML_BEGIN [59]|Op:Insert|Type:CollaborationGroup|Rows:1

 

System.DmlException: Insert failed. First exception on row 0; first error: UNKNOWN_EXCEPTION, com.ninja.common.exception.NinjaValidationException: workspaceName - This field is required:

 

Any ideas?

workspaceName doesn't seem to be a field in CollaborationGroup.