• svp
  • NEWBIE
  • 25 Points
  • Member since 2012

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

Hi
Can someone give some workaround on how to use custom setting in formula fields. Any help is highly appreciated.


Thanks,
svp

  • October 16, 2012
  • Like
  • 0

Hi,
I have a requirement like to create a new record based on the picklist value and associate new one to the  old
record via look up field on the same object, Is it possible, can someone help how to do this ?
Thanks a lot inadvance.

I have tried like this,but no luck getting errors :-(

 


sObject oldobj;
if(sObject.picklist_c == 'xxx')
  {

   sObject newobj = new sObject();
     newobj.Field1 = 'sometext';
     newobj.Field2 = 'sometext';

     // inser newobj.values( );
     insert newobj;
  }

   oldobj.LookupField__c = newobj.Id;
   update oldobj;

 

 

Thanks& Regards,

  • October 11, 2012
  • Like
  • 0

Hi,

 

Can some one help/ give idea on how to write a Opportunity VF page to auto populate Probability & Forecast category when stageName changed. Was this possible ?,if so please give some idea / sample code.


Thanks a lot inadvance!

Best Regards,

svp

  • September 18, 2012
  • Like
  • 0

Hi,

I'm getting the following error when choosing a price book (custom button) if opportunity has products (OpporutnityLineItems).

 

Errors
 
  • java.sql.SQLException: ORA-20067: ORA-06512: at "BASHFUL.GUTIL", line 42 ORA-06512: at "BASHFUL.SOPPORTUNITY", line 2327 ORA-06512: at line 1
  • Price Book: field integrity exception: Pricebook2Id (cannot change pricebook on opportunity with line items)



It's urgent, any help must be highly appreciated.

<apex:page standardcontroller="Opportunity" extensions="ChoosePricebook_Ext" id="thepage">
    <apex:sectionHeader title="{!Opportunity.Name}" subtitle="Choose a Pricebook"/>
    <apex:form id="theform">
         <apex:pageBlock title="Available Pricebooks">
            <apex:pageBlockButtons >
                <apex:commandButton action="{!Cancel}" value="Cancel"/>
                <apex:commandButton action="{!Save}" value="Save"/>
            </apex:pageBlockButtons>
             <apex:pageBlockSection showheader="false" columns="1">                
                <apex:pageblocksectionitem >
                    <apex:outputLabel value="Select a Pricebook"/>
                    <apex:selectRadio value="{!Opportunity.Pricebook2Id}" layout="pageDirection">
                        <apex:selectOptions value="{!pricebooks}"/>
                    </apex:selectRadio>
                </apex:pageblocksectionitem>    
                <apex:pageMessages />    
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>


public with sharing class ChoosePricebook_Ext {

  private final Opportunity opp;
  public ChoosePricebook_Ext(Apexpages.StandardController stdController){
    this.opp = (Opportunity)stdController.getRecord();
  }

  List<SelectOption> pricebooks;
  public List<Selectoption> getPricebooks(){
    if(pricebooks == null){
    
      pricebooks = new List<SelectOption>{};
      
      pricebooks.add(new selectoption('', 'None'));
      
      User u = [select id, Region__c From User where id =: Userinfo.getUserId()];  
      List<String> regions = new List<String>{};
      if(U.Region__c != null)regions = u.Region__c.split(';');
    
    //  Get the pricebooks
      Map<String, Id> nTOb = new Map<String, Id>{};
      for(Pricebook2 book : [select id, name from Pricebook2]){
        nTOb.put(book.name, book.id);
      }
      
    //  Get the applicable pricebooks
      for(PricebookSelect__c pbs : [Select Id, Region__c,PricebookId_c__c From PricebookSelect__c
                      where Region__c in: regions]){
          

            pricebooks.add(new selectoption(nTOb.get(pbs.Pricebook_Name__c), pbs.Pricebook_Name__c));
                            
      }
      
      if(pricebooks.size() == 1){
        Apexpages.Message nobooks = new apexpages.message(Apexpages.SEVERITY.INFO, 'No pricebooks ');
        Apexpages.addMessage(nobooks);
      }
              
    }
    
    return pricebooks;    
    
  }

 

Thanks a lot in advance !!

  • August 13, 2012
  • Like
  • 0

Hi,

I have a VF page with Standard controller as Pricebook2 and trying to override  "Choose price book" Standard button on OpportunityLineItem. The override dropdown list doesn't showing the VF page.  Any  Idea ?

 

Page:

 

<apex:page standardController="Pricebook2">
     <apex:sectionHeader title="Pricebook" subtitle="yyy"/>
       <apex:form >
         <apex:pageBlock title="Choose Price Book for:">
          <apex:pageBlockButtons location="bottom">
              <apex:commandButton value="Save" action="{!save}"/>
              <apex:commandButton value="Cancel" action="{!cancel}"/>
          </apex:pageBlockButtons>

 

          some other stuff

         </apex:pageBlock>

  </apex:page>

 

Any help must be appreciteated.

 

 

Thanks in advance !!

 

 

  • August 07, 2012
  • Like
  • 0

Hi,

I have a VF page which override Opportunity.Edit button for Partner Portal; On VF page i have some code which disable the Opportunity.CloseDate when a check box is true(checked) on Opportunity. The VF page is working as expected as a standard user but not working as/for Parnter Portal user. Can any one help ?

Here is the page:

<apex:page showHeader="true" standardController="Opportunity" sidebar="false">
 <script>
//  ON LOAD FUNCTIONS
//  ----------------------------------------------------------------------------------------
    function addLoadEvent(func) {
       var oldonload = window.onload;
       if (typeof window.onload != 'function') {
          window.onload = func;
       } else {
          window.onload = function() {
             oldonload();
             func();
            }
        }
     }
    addLoadEvent(
        function() {    disableInputs();    }
    );  

     
//  DISABLE ELEMENTS
//  ----------------------------------------------------------------------------------------
    function disableInputs(){   
        y = document.getElementsByTagName("input");
            for (i=0; i<y.length; i++){
                if(y[i].className == 'disable')y[i].disabled=true;
        }
        
        
    }     
    
</script>
 <apex:composition template="PL_Template">
     <apex:define name="content">
        <apex:actionRegion immediate="true">
        <apex:form >

      <apex:pageBlock title="{!$Label.PRM_General_Opportunity_Edit}" mode="maindetail" id="opportunityPageBlock">
            <apex:pageBlockButtons >
                <apex:commandButton action="{!save}" value="{!$Label.PRM_General_Save}" id="saveCommandLink"/>
                &nbsp;&nbsp;&nbsp;
                <apex:commandButton action="{!saveAndNew}" value="{!$Label.PRM_General_Save_and_New}" id="saveAndNewCommandLink"/>
                &nbsp;&nbsp;&nbsp;
                <apex:commandButton action="{!cancel}" value="{!$Label.PRM_General_Cancel}" id="cancelCommandLink" immediate="true"/>
            </apex:pageBlockButtons>
      <!-- Opportunity Information Fields -->
            <apex:pageBlockSection title="{!$Label.PRM_General_Opportunity_Information}" columns="2" collapsible="false" id="opportunityInformationPageBlock">
                <apex:repeat value="{!$ObjectType.Opportunity.FieldSets.Opportunity_Information}" var="opportunityInformationFields">
                    <apex:inputField value="{!opp[opportunityInformationFields]}" required="{!opportunityInformationFields.Required}" styleClass="{!IF(opportunityInformationFields.FieldPath = 'CloseDate'&& Opportunity.LOCK__c,'disable','')}"/>
                </apex:repeat>
            </apex:pageBlockSection>

    </apex:pageBlock>
        
    </apex:form>
    </apex:actionRegion>
    </apex:define>
  </apex:composition>
</apex:page>

Any help must be appreciated ?

 

 

Best Regards.

  • August 01, 2012
  • Like
  • 0

Hi,

 

I have a VF page which overrides Opportunity Creat / Edit Standard button (Standard Salesforce.com Page) ,  can we have various page layouts for different profiles, different views while Editing / Creating Opportunities ?. Any help ?

 

 

Thanks a lot in advance !!

 

 

 

  • July 25, 2012
  • Like
  • 0

Hi,

 

I  need to write a tirrger to update a check box ( as true) based on value of custom check box on Product. I know there is no direct relationship between two, they have only relationship with OpportunityLineItem only,  i was truck to write a trriger tirgger. Any help must be hightly appreciated.

 

Thanks Inadvance !

 

-SVP

 

 

 

  • July 14, 2012
  • Like
  • 0

Hi,

 

I have to make a field on opportunity to read only state when a check box (another field) is clicked. How to write a trigger ?, Any help must be highly appreciated.

 

 Thanks in advance !

 

 

Regards,

SVP

 

  • July 03, 2012
  • Like
  • 0

Hi,

 

I want to create a web page (VF) via sites that will leverage Web To Case, how to set up web to cases ?.  Any help must be highly appreciated.

 

Thanks in advance !

 

 

  • May 24, 2012
  • Like
  • 0

Hi,

I need to connect with twitter from salesforce, but i'm helpless of how to proceed. Any help ?

 

 

Thanks !

  • April 26, 2012
  • Like
  • 0

Hi
Can someone give some workaround on how to use custom setting in formula fields. Any help is highly appreciated.


Thanks,
svp

  • October 16, 2012
  • Like
  • 0

Hi,
I have a requirement like to create a new record based on the picklist value and associate new one to the  old
record via look up field on the same object, Is it possible, can someone help how to do this ?
Thanks a lot inadvance.

I have tried like this,but no luck getting errors :-(

 


sObject oldobj;
if(sObject.picklist_c == 'xxx')
  {

   sObject newobj = new sObject();
     newobj.Field1 = 'sometext';
     newobj.Field2 = 'sometext';

     // inser newobj.values( );
     insert newobj;
  }

   oldobj.LookupField__c = newobj.Id;
   update oldobj;

 

 

Thanks& Regards,

  • October 11, 2012
  • Like
  • 0

Hi Their,

 

     I'm getting values from api automatically...In this I dont need all values to be displayed....I want only few values how can I acheive it

  


I have three objects Opportunity, Payment Schedule and Proposal

Relationship between the objects
Opportunity is lookup to Payment Schedule and Proposal,,


 relation between PaymentSchedule and Proposal is look up
I want to show Payment Schedule field values in Proposal Visaualforce PDF page

Payment Schedule Fields:
Name and Percentage
How to call these values in Proposal Visualforce PDF

  • September 26, 2012
  • Like
  • 0

Hi,

 

Can some one help/ give idea on how to write a Opportunity VF page to auto populate Probability & Forecast category when stageName changed. Was this possible ?,if so please give some idea / sample code.


Thanks a lot inadvance!

Best Regards,

svp

  • September 18, 2012
  • Like
  • 0

Hi,

I'm getting the following error when choosing a price book (custom button) if opportunity has products (OpporutnityLineItems).

 

Errors
 
  • java.sql.SQLException: ORA-20067: ORA-06512: at "BASHFUL.GUTIL", line 42 ORA-06512: at "BASHFUL.SOPPORTUNITY", line 2327 ORA-06512: at line 1
  • Price Book: field integrity exception: Pricebook2Id (cannot change pricebook on opportunity with line items)



It's urgent, any help must be highly appreciated.

<apex:page standardcontroller="Opportunity" extensions="ChoosePricebook_Ext" id="thepage">
    <apex:sectionHeader title="{!Opportunity.Name}" subtitle="Choose a Pricebook"/>
    <apex:form id="theform">
         <apex:pageBlock title="Available Pricebooks">
            <apex:pageBlockButtons >
                <apex:commandButton action="{!Cancel}" value="Cancel"/>
                <apex:commandButton action="{!Save}" value="Save"/>
            </apex:pageBlockButtons>
             <apex:pageBlockSection showheader="false" columns="1">                
                <apex:pageblocksectionitem >
                    <apex:outputLabel value="Select a Pricebook"/>
                    <apex:selectRadio value="{!Opportunity.Pricebook2Id}" layout="pageDirection">
                        <apex:selectOptions value="{!pricebooks}"/>
                    </apex:selectRadio>
                </apex:pageblocksectionitem>    
                <apex:pageMessages />    
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>


public with sharing class ChoosePricebook_Ext {

  private final Opportunity opp;
  public ChoosePricebook_Ext(Apexpages.StandardController stdController){
    this.opp = (Opportunity)stdController.getRecord();
  }

  List<SelectOption> pricebooks;
  public List<Selectoption> getPricebooks(){
    if(pricebooks == null){
    
      pricebooks = new List<SelectOption>{};
      
      pricebooks.add(new selectoption('', 'None'));
      
      User u = [select id, Region__c From User where id =: Userinfo.getUserId()];  
      List<String> regions = new List<String>{};
      if(U.Region__c != null)regions = u.Region__c.split(';');
    
    //  Get the pricebooks
      Map<String, Id> nTOb = new Map<String, Id>{};
      for(Pricebook2 book : [select id, name from Pricebook2]){
        nTOb.put(book.name, book.id);
      }
      
    //  Get the applicable pricebooks
      for(PricebookSelect__c pbs : [Select Id, Region__c,PricebookId_c__c From PricebookSelect__c
                      where Region__c in: regions]){
          

            pricebooks.add(new selectoption(nTOb.get(pbs.Pricebook_Name__c), pbs.Pricebook_Name__c));
                            
      }
      
      if(pricebooks.size() == 1){
        Apexpages.Message nobooks = new apexpages.message(Apexpages.SEVERITY.INFO, 'No pricebooks ');
        Apexpages.addMessage(nobooks);
      }
              
    }
    
    return pricebooks;    
    
  }

 

Thanks a lot in advance !!

  • August 13, 2012
  • Like
  • 0

Hi,

I have a VF page with Standard controller as Pricebook2 and trying to override  "Choose price book" Standard button on OpportunityLineItem. The override dropdown list doesn't showing the VF page.  Any  Idea ?

 

Page:

 

<apex:page standardController="Pricebook2">
     <apex:sectionHeader title="Pricebook" subtitle="yyy"/>
       <apex:form >
         <apex:pageBlock title="Choose Price Book for:">
          <apex:pageBlockButtons location="bottom">
              <apex:commandButton value="Save" action="{!save}"/>
              <apex:commandButton value="Cancel" action="{!cancel}"/>
          </apex:pageBlockButtons>

 

          some other stuff

         </apex:pageBlock>

  </apex:page>

 

Any help must be appreciteated.

 

 

Thanks in advance !!

 

 

  • August 07, 2012
  • Like
  • 0

Hi,

I have a VF page which override Opportunity.Edit button for Partner Portal; On VF page i have some code which disable the Opportunity.CloseDate when a check box is true(checked) on Opportunity. The VF page is working as expected as a standard user but not working as/for Parnter Portal user. Can any one help ?

Here is the page:

<apex:page showHeader="true" standardController="Opportunity" sidebar="false">
 <script>
//  ON LOAD FUNCTIONS
//  ----------------------------------------------------------------------------------------
    function addLoadEvent(func) {
       var oldonload = window.onload;
       if (typeof window.onload != 'function') {
          window.onload = func;
       } else {
          window.onload = function() {
             oldonload();
             func();
            }
        }
     }
    addLoadEvent(
        function() {    disableInputs();    }
    );  

     
//  DISABLE ELEMENTS
//  ----------------------------------------------------------------------------------------
    function disableInputs(){   
        y = document.getElementsByTagName("input");
            for (i=0; i<y.length; i++){
                if(y[i].className == 'disable')y[i].disabled=true;
        }
        
        
    }     
    
</script>
 <apex:composition template="PL_Template">
     <apex:define name="content">
        <apex:actionRegion immediate="true">
        <apex:form >

      <apex:pageBlock title="{!$Label.PRM_General_Opportunity_Edit}" mode="maindetail" id="opportunityPageBlock">
            <apex:pageBlockButtons >
                <apex:commandButton action="{!save}" value="{!$Label.PRM_General_Save}" id="saveCommandLink"/>
                &nbsp;&nbsp;&nbsp;
                <apex:commandButton action="{!saveAndNew}" value="{!$Label.PRM_General_Save_and_New}" id="saveAndNewCommandLink"/>
                &nbsp;&nbsp;&nbsp;
                <apex:commandButton action="{!cancel}" value="{!$Label.PRM_General_Cancel}" id="cancelCommandLink" immediate="true"/>
            </apex:pageBlockButtons>
      <!-- Opportunity Information Fields -->
            <apex:pageBlockSection title="{!$Label.PRM_General_Opportunity_Information}" columns="2" collapsible="false" id="opportunityInformationPageBlock">
                <apex:repeat value="{!$ObjectType.Opportunity.FieldSets.Opportunity_Information}" var="opportunityInformationFields">
                    <apex:inputField value="{!opp[opportunityInformationFields]}" required="{!opportunityInformationFields.Required}" styleClass="{!IF(opportunityInformationFields.FieldPath = 'CloseDate'&& Opportunity.LOCK__c,'disable','')}"/>
                </apex:repeat>
            </apex:pageBlockSection>

    </apex:pageBlock>
        
    </apex:form>
    </apex:actionRegion>
    </apex:define>
  </apex:composition>
</apex:page>

Any help must be appreciated ?

 

 

Best Regards.

  • August 01, 2012
  • Like
  • 0

Hi,

 

I have a VF page which overrides Opportunity Creat / Edit Standard button (Standard Salesforce.com Page) ,  can we have various page layouts for different profiles, different views while Editing / Creating Opportunities ?. Any help ?

 

 

Thanks a lot in advance !!

 

 

 

  • July 25, 2012
  • Like
  • 0

Hi,

 

I  need to write a tirrger to update a check box ( as true) based on value of custom check box on Product. I know there is no direct relationship between two, they have only relationship with OpportunityLineItem only,  i was truck to write a trriger tirgger. Any help must be hightly appreciated.

 

Thanks Inadvance !

 

-SVP

 

 

 

  • July 14, 2012
  • Like
  • 0

Hi,

 

I have to make a field on opportunity to read only state when a check box (another field) is clicked. How to write a trigger ?, Any help must be highly appreciated.

 

 Thanks in advance !

 

 

Regards,

SVP

 

  • July 03, 2012
  • Like
  • 0

Hi,

 

I want to create a web page (VF) via sites that will leverage Web To Case, how to set up web to cases ?.  Any help must be highly appreciated.

 

Thanks in advance !

 

 

  • May 24, 2012
  • Like
  • 0

Hi,

I need to connect with twitter from salesforce, but i'm helpless of how to proceed. Any help ?

 

 

Thanks !

  • April 26, 2012
  • Like
  • 0