• prazon
  • NEWBIE
  • 30 Points
  • Member since 2012

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

I am working on a sandbox of unlimited edition and here is following code, still getting the error:

 

{!REQUIRESCRIPT("/soap/ajax/25.0/connection.js")}

var connection = sforce.connection;
alert('connection: '+connection);
var contractId = "{!Deal_Description__c.Contract__c}";
alert(contractId);
var con = new sforce.SObject("Contract");
con.Id = contractId;
con.Deal_Description__c = "{!Deal_Description__c.Key_Information__c}";
alert(con);
connection.update([con]);
alert("Copied To Contract.");

  • August 13, 2012
  • Like
  • 0

Hi I have following piece of code , where I am trying to link an external URL from the visualforce page but here it is always adding the sfdc server instance in front of the url so the url is not opening at all. Please tell me how to avoid the server url in front: https://<server_name>.cs4.visual.force.com/apex/http//www.google.co.uk

<apex:pageBlockSection columns="1">
                    <!--<apex:commandLink action="{!websiteLink}" value="{!Contract.Partner_Website__c}" id="theCommandLink" target="_blank"/>-->
                    <apex:outputLink value="http//www.google.co.uk" target="_blank">{!Contract.Partner_Website__c}</apex:outputLink>
                    <apex:inputField value="{!Contract.Description}" style="height:150px;width:100%"/>
                    <apex:inputField value="{!Contract.Komentar_fuer_Freigabe__c}" style="height:110px;width:100%"/>
                </apex:pageBlockSection>      

 

 

 

 

 

Hi,

 

I have a visualforce component  which is not taking in any CSS. Previously it was working fine but now suddenly it is not taking any CSS defined, cannot really get the problem, help is needed, Here I am posting the code:

 

<messaging:emailTemplate subject="Go Live on Groupon – Welcome Back!" recipientType="Contact" relatedToType="Schaltungsobjekt__c">
<messaging:htmlEmailBody >
<c:ETContractReFeatureGoLive1 SchaltungsobjektId="{!relatedTo.Id}"/>
 

</messaging:htmlEmailBody>
<messaging:attachment renderAs="PDF" filename="Deal Sheet.pdf">

       <c:ETContractGoLIve2 SchaltungsobjektId="{!relatedTo.Id}"/>

    </messaging:attachment>
</messaging:emailTemplate>

 and the component:

 

<apex:component controller="ETContractController"  access="global">
<apex:attribute name="SchaltungsobjektId" description="The Schaltungsobjekt Id" type="String" assignTo="{!SchaltungsobjektId}"/>
<html>
<head>
<style type="text/css">

.head_text{
    font-style: arial;
    font-family: arial, Helvetica, sans-serif;
    font-size: 14px;
    color: #000;
    text-decoration: none;
    font-weight:bold;
      }
.content_text{
    text-decoration: none;
    clear:both;
    font-style: arial;
    font-family: arial, Helvetica, sans-serif;
    font-size: 13px;
    color: #000;
    
      }
.content_text1{
      font-style: arial;
    font-family: arial, Helvetica, sans-serif;
    font-size: 13px;
    color: #ff0022;
    text-decoration: none;
      }
.content_text_border{
     font-style: arial;
    font-family: arial, Helvetica, sans-serif;
    font-size: 13px;
    color: #000;
    text-decoration: none;
    border:#000000 solid 1px;
    align: left
      }

</style>
</head>

<table width="603" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="left" valign="top"><!--<div align="justify">-->
      <table width="100%" border="0" cellspacing="0" cellpadding="0">

        <tr>
          <td width="603" align="left" valign="top"><apex:image id="theImage" value="{!$Resource.ET_Header}" width="603" height="118"/></td>
        </tr>
        <tr>
          <td align="left" valign="top">
          <br /><span class="content_text"><strong>
               Deal sheet for contract number: {!Schaltungsobjekt.Vertrag__r.ContractNumber}</strong><br />
                <strong>Partner: {!Schaltungsobjekt.Account__r.Name}</strong><br />
                <strong>Going Live date:  {!StartDate}</strong></span><br /> 
              <br />
              <!--<span class="content_text"><strong><u>DEAL REFERENCE:</u></strong><strong><u>{!CDA.CDA_Number__c}</u></strong></span><br />
              <br />-->
          <div align="justify"> 
              <apex:dataTable value="{!CDAs}" styleClass="content_text_border" var="cont" border="1" cellpadding="1px">
        <apex:column >
            <apex:facet name="header">Deal Headline</apex:facet>
            <apex:outputfield value="{!cont.Deal_Headline__c}" />
        </apex:column>
        <apex:column >
            <apex:facet name="header">Deal&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br/>Reference</apex:facet>
            <apex:outputfield value="{!cont.CDA_Number__c}" />
        </apex:column>
        <apex:column >
            <apex:facet name="header">Estimated voucher sales*</apex:facet>
            <apex:outputfield value="{!cont.Confirmed_Cap__c}" />
        </apex:column>
        <apex:column >  
            <apex:facet name="header">Original Price</apex:facet>
            <apex:outputfield value="{!cont.Orginal_Price__c}" />
        </apex:column>
            <apex:column >
            <apex:facet name="header">Discount</apex:facet>
            <apex:outputfield value="{!cont.Discount__c}" />
        </apex:column>
        <apex:column >
            <apex:facet name="header">Groupon Price</apex:facet>
            <apex:outputfield value="{!cont.Groupon_Price__c}" />
        </apex:column>
        <apex:column >
            <apex:facet name="header">Success Fee</apex:facet>
            <apex:outputfield value="{!cont.Commission__c}" />
        </apex:column>
        <apex:column >
            <apex:facet name="header">VAT <br/> payable <br/>on&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/> Success Fee</apex:facet>
            <apex:outputfield value="{!cont.VAT__c}" />
            
        </apex:column>
        <apex:column >
            <apex:facet name="header">Payout <br/>to&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/> Partner</apex:facet>
            <span style="font-weight:bold;"><apex:outputfield value="{!cont.Groupon_payout_per_voucher__c}" /></span>
        </apex:column>        
</table>
      <!--</div>--></td>
  </tr>
</table>

</html>
</apex:component>

 

I have a web to lead web form where all other data is getting inserted but not the date field.

It is a date field not a date/time field and we are putting date in UK standard DD/MM/YYYY.

 

I also tried standard SFDC format that is YYYY-MM-DD, still it is facing the problem..what can be the possible issue ??

 

 

I have the following code for radio button. But these radio buttons render horizontally I want to render them veritically. Is there any way to do that ?

 

<apex:selectRadio value="{!productSelected}">
                <apex:selectOptions value="{!items}"/>                
            </apex:selectRadio>

 

  • April 25, 2012
  • Like
  • 0

 

I want to display and hide a pageblocksection item based on a inputChechbox checked or not. Is there any sample code ? Please help me on this.

  • April 20, 2012
  • Like
  • 0

Hi Guys,

 

I have this requirement, any idea how can I make use of checkboxes as radio buttons ? I don't need radio buttons

 

 

  • April 04, 2012
  • Like
  • 0

Hi,

 

I have the following javascript function to be accessed from apex:checkbox but the method is not getting invoked at all I am not getting the alert..Can somebody say is there any error?

 

 <script type="text/javascript">
       function SetSel(elem)
            {
              alert("Hi");
              var elems = document.getElementsByTagName("{!$Component.theForm.theListBlock.productBlock.selectLine1}");
              var currentState = elem.checked;
              var elemsLength = elems.length;
            
              for(i=0; i<elemsLength; i++)
              {
                if(elems[i].type === "checkbox")
                {
                   elems[i].checked = false;   
                }
              }
            
              elem.checked = currentState;
            }​
   
   </script>



...................

 <apex:outputPanel id="theListBlock">
    <apex:pageBlock mode="edit" id="productBlock">
        <apex:panelGrid cellpadding="2" cellspacing="2" columns="2" width="100%" bgcolor="#E1E6EE">
            <apex:outputPanel >
            <apex:image value="{!URLFOR($Resource.bz,'icons/product.png')}" height="30"/>
            <apex:outputText value="Select Deal Category" styleclass="header"/>
            </apex:outputPanel>
        </apex:panelGrid>
        <apex:pageBlockTable value="{!PWlist}" var="p" rules="cols" rows="50" >
            <apex:column width="25">
            
            
            <apex:inputCheckbox value="{!p.checked}" id="selectLine1" onclick="SetSel(this)"/>
            </apex:column>
            <apex:column headerValue="Deal Category">
                <apex:outputField value="{!p.product.name}"/>
            </apex:column>        
        </apex:pageBlockTable>
    </apex:pageBlock>
    </apex:outputPanel>







....................

 

  • April 04, 2012
  • Like
  • 0

I have a visualforce page which have inputarea which is editable for profiles who donot have field level permission not to edit it. In the object it cannot be edited by that profile but it can still be edited in the visualforce page

 

I have with sharing clause in the attached controller. What can be the possible solution ?

  • April 04, 2012
  • Like
  • 0

Hi,

 

How to handle this error. Although I have put exception handler in the class this error is not getting trapped. If anybody knows kindly apprise me off

 

Regards

 

Prazon

  • April 04, 2012
  • Like
  • 0

 

 

I have an object Flag_Reporter__c which is child object in master detail relationship with Account...in an account trigger I have set the following code..in test class I having error: System.LimitException: Too many SOQL queries: 101

 

trigger Trg_After_Flag_Updater on Account (after update) {
    
    
    Boolean updateFlag = false;
    Boolean insertFlag = false;
    
    List<Flag_Reporter__c> lstFlagReporter = new List<Flag_Reporter__c>();
    
        Set<ID> aID = trigger.newMap.keySet();
        
        
        
        Map<ID,Flag_Reporter__c> fRC= New Map<ID,Flag_Reporter__c>();
        
        List<Flag_Reporter__c> flags = [Select Overall_Status__c,Overall_Status_Ranking__c,Account_Flag__r.Id,Flag_for_Editorial__c from Flag_Reporter__c Where Account_Flag__c IN : aID];
        for(Flag_Reporter__c fr: flags){        
            fRC.put(fr.Account_Flag__r.Id,fr);
        }
    for(Account accFlag:Trigger.new){
        
        Flag_Reporter__c fr;
        String editorial;
        if(fRC.get(accFlag.Id)!=NULL)
            fr = fRC.get(accFlag.Id);
        
        if(fr!=NULL){
            updateFlag = true;
            
            if(fr.Overall_Status__c == 'RED')
                fr.Overall_Status_Ranking__c = 1;
            else if(fr.Overall_Status__c == 'YELLOW')
                fr.Overall_Status_Ranking__c = 6;
            else if(fr.Overall_Status__c == 'GREEN')
                fr.Overall_Status_Ranking__c = 8;
                
             if(accFlag.Partner_Reviews__c!=NULL){
                if(accFlag.Partner_Reviews__c == '1')
                   fr.Flag_for_Editorial__c= 'RED';
                else 
                    fr.Flag_for_Editorial__c= 'GREEN';
             }
             lstFlagReporter.add(fr);
        }if(fr == NULL){
            insertFlag=true;
            lstFlagReporter.add(new Flag_Reporter__c(Account_Flag__c=accFlag.Id));   
        }
           
        
    
    }try{
        if(updateFlag==true)
            update lstFlagReporter;  
            
         if(insertFlag==true)
            insert lstFlagReporter;    
            
    }catch(Exception ex){
        ex.getMessage();
    }


}

 


stack is showing error in this place:

 

List<Flag_Reporter__c> flags = [Select Overall_Status__c,Overall_Status_Ranking__c,Account_Flag__r.Id,Flag_for_Editorial__c from Flag_Reporter__c Where Account_Flag__c IN : aID];

 

  • March 31, 2012
  • Like
  • 0

 

 

In the visual force page layout I have made the following fields in edit mode

 

<apex:inputField value="{!opp.Name}"/>
            <apex:inputField value="{!opp.StageName}" onchange="probPopulator()"/>
            <apex:inputField value="{!opp.Ablehnungsgrund__c}"/>


In the class it is following:

Opportunity opp{get;set;}

 

 

 

but unlike normal edit page layout probability is not auto populating. Please tell me what can be the way out.

  • March 30, 2012
  • Like
  • 0

Hi I am trying to go for this code in custom button in a page layout but cannot make Account as standard controller or pass a custom controller. Can anybody please help

 

{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}



function insertScript(){ 
	
        var box = new SimpleDialog("hersh"+Math.random(), true); 
	      parent.box = box; 
	      box.setTitle("Account Page"); 
	      box.createDialog(); 
	      box.setWidth(350); 
	      box.setContentInnerHTML("<apex:page standardController="{!Account}"><h1>Congratulations {!Account.Name}</h1><br/>This is your new Page<br/><button class='btn'       onclick='window.parent.box.hide(); return false;'>Cancel</button></apex:page>"); 
	      box.setupDefaultButtons(); 
	      box.show(); 

} 


insertScript();

 

  • March 28, 2012
  • Like
  • 0

Hi

 

I want to create a visualforce page from a custom button which will render like a modal window showing the page layout behind obscured like a modal window rather than navigating to another visualforce page. 

 

Please tell me in details.

 

Regards

 

Prazon

  • March 23, 2012
  • Like
  • 0

Hi I have done the following code the value is not saving in the database. Please help me

 

<apex:outputText value="{!$ObjectType.Flag_Reporter__c.fields.Flag_for_Editorial__c.label}: " style="color:black;font-size:14px"/>
                    <apex:selectRadio value="{!editorial}" required="true">
                            <apex:actionSupport event="onchange" action="{!EditMethod}"/>
                            <apex:selectOptions value="{!items}"/>
                    </apex:selectRadio>
                </td>

 class is here

public String editorial{get;set;}

public void EditMethod(){
        flagReport[0].Flag_for_Editorial__c = this.editorial;
    }

public Pagereference save(){
        Boolean edited = false;
        if(flagReport[0].Flag_for_Editorial__c!= NULL){
           
            edited = true;
        }

 try{
            if(edited == true){
                update flagReport;
}

}

 

  • March 22, 2012
  • Like
  • 0

How can I make a modal dialog page from a custom button. Guys if you have any idea please get back to me

  • March 20, 2012
  • Like
  • 0

Hi,

 

Please look into the class where test coverage is coming zero inspite of  testmethod

 

public with sharing class Account_Flag_Status_Controller {
    
    public Id AccountId{get;set;}
    public List<Flag_Reporter__c> flagReport{get;set;}
    public Account_Flag_Status_Controller(ApexPages.StandardController controller) {
        AccountId= ApexPages.currentPage().getParameters().get('id');
        flagReport = new List<Flag_Reporter__c>();
    }
    
    public class FlagColors{
        public String overallStatus{get;set;}
        public String leadFlag{get;set;}
        public String creditFlag{get;set;}  
        public String venueFlag{get;set;} 
        public String companyFlag{get;set;}
        public String editorial{get;set;}
        public String websiteFlag{get;set;}
        public String msFlag{get;set;}
        public String pmFlag{get;set;}
        public String escalationFlag{get;set;}
        public String FlagComments{get;set;}
        public String OverallComments{get;set;}
    }
    
    public Pagereference back() {
        Pagereference contractPage = new Pagereference('/' + AccountId);
        return contractPage;
    }
    
    public FlagColors colorSetter{
    get{
    
        FlagColors flagColors = new FlagColors();
        try{
            flagReport = [Select Overall_Status__c, LeadQualityFlag__c, CreditCheckFlag__c,Venue__c, CompanyAgeFlag__c,Flag_for_Editorial__c, WebsiteFlag__c, Overall_Mystery_Shopping__c,Overall_PM_Assessment__c,Overall_Escalation__c, Flag_comments__c, Overall_comments__c  from Flag_Reporter__c Where Account_Flag__c=:AccountId LIMIT 1];
        }catch(Exception ex){
            flagColors.overallStatus = 'Green.png';
            flagColors.leadFlag = 'Green.png';
            flagColors.creditFlag= 'Green.png';
            flagColors.venueFlag= 'Green.png';
            flagColors.companyFlag= 'Green.png';
            flagColors.editorial= 'Green.png';
            flagColors.websiteFlag= 'Green.png';
            flagColors.msFlag= 'Green.png';
            flagColors.pmFlag= 'Green.png';
            flagColors.escalationFlag= 'Green.png';
            
            return flagColors;
            
        }
        if(flagReport[0].Overall_Status__c == 'RED')
            flagColors.overallStatus = 'Red.png';
        else if(flagReport[0].Overall_Status__c == 'GREEN')
            flagColors.overallStatus = 'Green.png';
        else if(flagReport[0].Overall_Status__c == 'YELLOW')
            flagColors.overallStatus = 'Yellow.png';
            
        if(flagReport[0].LeadQualityFlag__c == 'RED')
            flagColors.leadFlag = 'Red.png';
        else if(flagReport[0].LeadQualityFlag__c == 'GREEN')
            flagColors.leadFlag = 'Green.png';
        else if(flagReport[0].LeadQualityFlag__c == 'YELLOW')
            flagColors.leadFlag = 'Yellow.png';
            
        if(flagReport[0].CreditCheckFlag__c == 'RED')
            flagColors.creditFlag = 'Red.png';
        else if(flagReport[0].CreditCheckFlag__c == 'GREEN')
            flagColors.creditFlag = 'Green.png';
        else if(flagReport[0].CreditCheckFlag__c == 'YELLOW')
            flagColors.creditFlag = 'Yellow.png';
            
        if(flagReport[0].Venue__c == 'RED')
            flagColors.venueFlag = 'Red.png';
        else if(flagReport[0].Venue__c == 'GREEN')
            flagColors.venueFlag = 'Green.png';
        else if(flagReport[0].Venue__c == 'YELLOW')
            flagColors.venueFlag = 'Yellow.png';
        
        if(flagReport[0].CompanyAgeFlag__c == 'RED')
            flagColors.companyFlag = 'Red.png';
        else if(flagReport[0].CompanyAgeFlag__c == 'GREEN')
            flagColors.companyFlag = 'Green.png';
        else if(flagReport[0].CompanyAgeFlag__c == 'YELLOW')
            flagColors.companyFlag = 'Yellow.png';
        
        
        if(flagReport[0].Flag_for_Editorial__c == 'RED')
            flagColors.editorial = 'Red.png';
        else if(flagReport[0].Flag_for_Editorial__c == 'GREEN')
            flagColors.editorial= 'Green.png';
        else if(flagReport[0].Flag_for_Editorial__c == 'YELLOW')
            flagColors.editorial= 'Yellow.png';
                        
        if(flagReport[0].WebsiteFlag__c == 'RED')
            flagColors.websiteFlag = 'Red.png';
        else if(flagReport[0].WebsiteFlag__c == 'GREEN')
            flagColors.websiteFlag = 'Green.png';
        else if(flagReport[0].WebsiteFlag__c == 'YELLOW')
            flagColors.websiteFlag = 'Yellow.png';
                        
        if(flagReport[0].Overall_Mystery_Shopping__c == 'RED')
            flagColors.msFlag = 'Red.png';
        else if(flagReport[0].Overall_Mystery_Shopping__c == 'GREEN')
            flagColors.msFlag = 'Green.png';
        else if(flagReport[0].Overall_Mystery_Shopping__c == 'YELLOW')
            flagColors.msFlag = 'Yellow.png';
        
        if(flagReport[0].Overall_PM_Assessment__c == 'RED')
            flagColors.pmFlag = 'Red.png';
        else if(flagReport[0].Overall_PM_Assessment__c == 'GREEN')
            flagColors.pmFlag = 'Green.png';
        else if(flagReport[0].Overall_PM_Assessment__c == 'YELLOW')
            flagColors.pmFlag = 'Yellow.png';                
                        
          if(flagReport[0].Overall_Escalation__c == 'RED')
            flagColors.escalationFlag = 'Red.png';
        else if(flagReport[0].Overall_Escalation__c == 'GREEN')
            flagColors.escalationFlag= 'Green.png';
        else if(flagReport[0].Overall_Escalation__c == 'YELLOW')
            flagColors.escalationFlag = 'Yellow.png';
         
         if(flagReport[0].Flag_comments__c != NULL)
             flagColors.FlagComments = flagReport[0].Flag_comments__c;
         else
             flagColors.FlagComments = 'No comment so far';
         
         if(flagReport[0].Overall_comments__c != NULL)
             flagColors.OverallComments = flagReport[0].Overall_comments__c;
         else
             flagColors.OverallComments = 'No comment so far';
                  
        return flagColors ;
    }
    
    
    }
    static testMethod void testWithFlag() {
    
        Account flagTestAccount = new Account(Name='Flag Test Account',Actual_Physical_Country__c='UK',BillingCountry='UK',Partner_Reviews__c='1');
        insert flagTestAccount;
        
        Account flagTestAccount1 = new Account(Name='Flag Test Account',Actual_Physical_Country__c='UK',BillingCountry='UK',Partner_Reviews__c=NULL);
        insert flagTestAccount1;
        
        Account_Flag_Status_Controller cntrl = new  Account_Flag_Status_Controller( new ApexPages.StandardController(flagTestAccount));
        
        System.assertNotEquals(cntrl.AccountId, NULL);        
        System.assertEquals(cntrl.back().getURL(), '/' + cntrl.AccountId);
       
        
        Account_Flag_Status_Controller cntrl1= new  Account_Flag_Status_Controller( new ApexPages.StandardController(flagTestAccount));
        System.assertEquals(cntrl1.back().getURL(), '/' + cntrl1.AccountId);
    }

}

 

  • March 18, 2012
  • Like
  • 0

Guys ,

 

I am having the following trigger which should one row of data, instead it is instead it is inserting 4 rows. Can anybody tell me what can be the solution?

 

 

List<Flag_Reporter__c> lstFlagReported = [Select Id, Account_Flag__c from Flag_Reporter__c];
    List<Flag_Reporter__c> lstFlagReporterUpdate = new List<Flag_Reporter__c>();
    
    List<Escalation_Flag__c> lstEscalataionFlag = new List<Escalation_Flag__c>();
        Integer casNum=0;
    
    Boolean updateFlag = false;
    Boolean insertFlag = false;
    Boolean mysteryFlag = false;
    for(Case cas:Trigger.new){
        if(cas.Issue_Category__c == 'Escalated Issue'){
            if(Trigger.isInsert){
                for(Flag_Reporter__c flag:lstFlagReported ){
                    
                        if(cas.AccountId==flag.Account_Flag__c){
                             insertFlag = true;
                             
                            if(cas.Issue_DetailsPS__c == 'Additional Surcharge' || cas.Issue_DetailsPS__c == 'ASA Issue' || cas.Issue_DetailsPS__c == 'Business Closed' || cas.Issue_DetailsPS__c == 'Partner Not Honouring Vouchers' || cas.Issue_DetailsPS__c ==  'Term of Deal Dispute'){
                                casNum = 1;                               
                                
                            }else if(cas.Issue_DetailsPS__c == 'Difficulty/Unable to Contact Partner'){
                                casNum = 4;
                                
                            }else{
                                casNum = 6;
                                
                            }
                        }   
                             
                     lstEscalataionFlag.add(new Escalation_Flag__c(Flag_Reporter__c=flag.Id, Case__c=cas.Id, Number_trg__c=casNum));        
               }
                    
                }
            }
}
try{
                
        if(insertFlag == true)
            insert lstEscalataionFlag;            
        
    }catch(Exception ex){
        ex.getMessage();
    }
    

}

 

 

Here there is only one Flag_Reporter__c record against one Account.

  • March 12, 2012
  • Like
  • 0

Hi,

 

I want to expose some fields of an object over email with an embedded page/page layout where I want customer to give their feedback and save those data without logging in the main system.

If its possible can anybody explain please.

 

Regards

 

Prazon

  • March 02, 2012
  • Like
  • 0

Hi ,

 

I am following the the code below for google map rendition in VF page in Account page layout yet it is coming blank. Please help

 

 

http://salesforce.phollaio.com/2010/03/18/inline_google_maps_using_visualforce/

 

Regards

 

Prazon

  • February 29, 2012
  • Like
  • 0

I am working on a sandbox of unlimited edition and here is following code, still getting the error:

 

{!REQUIRESCRIPT("/soap/ajax/25.0/connection.js")}

var connection = sforce.connection;
alert('connection: '+connection);
var contractId = "{!Deal_Description__c.Contract__c}";
alert(contractId);
var con = new sforce.SObject("Contract");
con.Id = contractId;
con.Deal_Description__c = "{!Deal_Description__c.Key_Information__c}";
alert(con);
connection.update([con]);
alert("Copied To Contract.");

  • August 13, 2012
  • Like
  • 0

Hi,

 

I have a visualforce component  which is not taking in any CSS. Previously it was working fine but now suddenly it is not taking any CSS defined, cannot really get the problem, help is needed, Here I am posting the code:

 

<messaging:emailTemplate subject="Go Live on Groupon – Welcome Back!" recipientType="Contact" relatedToType="Schaltungsobjekt__c">
<messaging:htmlEmailBody >
<c:ETContractReFeatureGoLive1 SchaltungsobjektId="{!relatedTo.Id}"/>
 

</messaging:htmlEmailBody>
<messaging:attachment renderAs="PDF" filename="Deal Sheet.pdf">

       <c:ETContractGoLIve2 SchaltungsobjektId="{!relatedTo.Id}"/>

    </messaging:attachment>
</messaging:emailTemplate>

 and the component:

 

<apex:component controller="ETContractController"  access="global">
<apex:attribute name="SchaltungsobjektId" description="The Schaltungsobjekt Id" type="String" assignTo="{!SchaltungsobjektId}"/>
<html>
<head>
<style type="text/css">

.head_text{
    font-style: arial;
    font-family: arial, Helvetica, sans-serif;
    font-size: 14px;
    color: #000;
    text-decoration: none;
    font-weight:bold;
      }
.content_text{
    text-decoration: none;
    clear:both;
    font-style: arial;
    font-family: arial, Helvetica, sans-serif;
    font-size: 13px;
    color: #000;
    
      }
.content_text1{
      font-style: arial;
    font-family: arial, Helvetica, sans-serif;
    font-size: 13px;
    color: #ff0022;
    text-decoration: none;
      }
.content_text_border{
     font-style: arial;
    font-family: arial, Helvetica, sans-serif;
    font-size: 13px;
    color: #000;
    text-decoration: none;
    border:#000000 solid 1px;
    align: left
      }

</style>
</head>

<table width="603" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="left" valign="top"><!--<div align="justify">-->
      <table width="100%" border="0" cellspacing="0" cellpadding="0">

        <tr>
          <td width="603" align="left" valign="top"><apex:image id="theImage" value="{!$Resource.ET_Header}" width="603" height="118"/></td>
        </tr>
        <tr>
          <td align="left" valign="top">
          <br /><span class="content_text"><strong>
               Deal sheet for contract number: {!Schaltungsobjekt.Vertrag__r.ContractNumber}</strong><br />
                <strong>Partner: {!Schaltungsobjekt.Account__r.Name}</strong><br />
                <strong>Going Live date:  {!StartDate}</strong></span><br /> 
              <br />
              <!--<span class="content_text"><strong><u>DEAL REFERENCE:</u></strong><strong><u>{!CDA.CDA_Number__c}</u></strong></span><br />
              <br />-->
          <div align="justify"> 
              <apex:dataTable value="{!CDAs}" styleClass="content_text_border" var="cont" border="1" cellpadding="1px">
        <apex:column >
            <apex:facet name="header">Deal Headline</apex:facet>
            <apex:outputfield value="{!cont.Deal_Headline__c}" />
        </apex:column>
        <apex:column >
            <apex:facet name="header">Deal&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br/>Reference</apex:facet>
            <apex:outputfield value="{!cont.CDA_Number__c}" />
        </apex:column>
        <apex:column >
            <apex:facet name="header">Estimated voucher sales*</apex:facet>
            <apex:outputfield value="{!cont.Confirmed_Cap__c}" />
        </apex:column>
        <apex:column >  
            <apex:facet name="header">Original Price</apex:facet>
            <apex:outputfield value="{!cont.Orginal_Price__c}" />
        </apex:column>
            <apex:column >
            <apex:facet name="header">Discount</apex:facet>
            <apex:outputfield value="{!cont.Discount__c}" />
        </apex:column>
        <apex:column >
            <apex:facet name="header">Groupon Price</apex:facet>
            <apex:outputfield value="{!cont.Groupon_Price__c}" />
        </apex:column>
        <apex:column >
            <apex:facet name="header">Success Fee</apex:facet>
            <apex:outputfield value="{!cont.Commission__c}" />
        </apex:column>
        <apex:column >
            <apex:facet name="header">VAT <br/> payable <br/>on&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/> Success Fee</apex:facet>
            <apex:outputfield value="{!cont.VAT__c}" />
            
        </apex:column>
        <apex:column >
            <apex:facet name="header">Payout <br/>to&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/> Partner</apex:facet>
            <span style="font-weight:bold;"><apex:outputfield value="{!cont.Groupon_payout_per_voucher__c}" /></span>
        </apex:column>        
</table>
      <!--</div>--></td>
  </tr>
</table>

</html>
</apex:component>

 

Hi developers,

 

I think here goes my last question about visualforce :) by now...

 

Y have my lead edit page as follows:

 

<apex:page standardController="Lead" showHeader="true">
    <apex:sectionHeader title="Edit Fiscal Information" subtitle="{!Lead.Company}"/>  
    <apex:form>
        <apex:pageBlock title="Edit Fiscal Information" id="Edit_Fiscal_Information" mode="Edit">
            <apex:pageMessages />
            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!save}"/>
                <apex:commandButton value="Cancel" action="{!cancel}"/>
            </apex:PageBlockButtons>
                <apex:pageBlockSection title="Basic Information - All fields required" columns="2">
                    <apex:inputField value="{!lead.Street_fiscal__c}" label="Street (Fiscal)*"/>
                    <apex:inputField value="{!lead.City_fiscal__c}" label="City (Fiscal) *"/>
                    <apex:inputField value="{!lead.Post_Code_fiscal__c}" label="Post Code (Fiscal) *"/>
                    <apex:inputField value="{!lead.Country_Fiscal__c}" label="Country (Fiscal) *"/>
              </apex:pageblockSection>

 Now, when I request a field, for example "!lead.Street_fiscal__c and I define the label "Street (Fiscal) *", I would like the label to be shown in blue color because this is a special field that is compulsory for a process and I want my users to detect it somehow...

 

I tried using style, but the style is apply to the contect of the Street_fiscal field, not to the label itself.

 

Can I do that somehow?

 

Thanks a lot.

 

Antonio

I have a web to lead web form where all other data is getting inserted but not the date field.

It is a date field not a date/time field and we are putting date in UK standard DD/MM/YYYY.

 

I also tried standard SFDC format that is YYYY-MM-DD, still it is facing the problem..what can be the possible issue ??

Hi Guys,

 

I have this requirement, any idea how can I make use of checkboxes as radio buttons ? I don't need radio buttons

 

 

  • April 04, 2012
  • Like
  • 0

I have a visualforce page which have inputarea which is editable for profiles who donot have field level permission not to edit it. In the object it cannot be edited by that profile but it can still be edited in the visualforce page

 

I have with sharing clause in the attached controller. What can be the possible solution ?

  • April 04, 2012
  • Like
  • 0

Hi,

 

How to handle this error. Although I have put exception handler in the class this error is not getting trapped. If anybody knows kindly apprise me off

 

Regards

 

Prazon

  • April 04, 2012
  • Like
  • 0

 

 

I have an object Flag_Reporter__c which is child object in master detail relationship with Account...in an account trigger I have set the following code..in test class I having error: System.LimitException: Too many SOQL queries: 101

 

trigger Trg_After_Flag_Updater on Account (after update) {
    
    
    Boolean updateFlag = false;
    Boolean insertFlag = false;
    
    List<Flag_Reporter__c> lstFlagReporter = new List<Flag_Reporter__c>();
    
        Set<ID> aID = trigger.newMap.keySet();
        
        
        
        Map<ID,Flag_Reporter__c> fRC= New Map<ID,Flag_Reporter__c>();
        
        List<Flag_Reporter__c> flags = [Select Overall_Status__c,Overall_Status_Ranking__c,Account_Flag__r.Id,Flag_for_Editorial__c from Flag_Reporter__c Where Account_Flag__c IN : aID];
        for(Flag_Reporter__c fr: flags){        
            fRC.put(fr.Account_Flag__r.Id,fr);
        }
    for(Account accFlag:Trigger.new){
        
        Flag_Reporter__c fr;
        String editorial;
        if(fRC.get(accFlag.Id)!=NULL)
            fr = fRC.get(accFlag.Id);
        
        if(fr!=NULL){
            updateFlag = true;
            
            if(fr.Overall_Status__c == 'RED')
                fr.Overall_Status_Ranking__c = 1;
            else if(fr.Overall_Status__c == 'YELLOW')
                fr.Overall_Status_Ranking__c = 6;
            else if(fr.Overall_Status__c == 'GREEN')
                fr.Overall_Status_Ranking__c = 8;
                
             if(accFlag.Partner_Reviews__c!=NULL){
                if(accFlag.Partner_Reviews__c == '1')
                   fr.Flag_for_Editorial__c= 'RED';
                else 
                    fr.Flag_for_Editorial__c= 'GREEN';
             }
             lstFlagReporter.add(fr);
        }if(fr == NULL){
            insertFlag=true;
            lstFlagReporter.add(new Flag_Reporter__c(Account_Flag__c=accFlag.Id));   
        }
           
        
    
    }try{
        if(updateFlag==true)
            update lstFlagReporter;  
            
         if(insertFlag==true)
            insert lstFlagReporter;    
            
    }catch(Exception ex){
        ex.getMessage();
    }


}

 


stack is showing error in this place:

 

List<Flag_Reporter__c> flags = [Select Overall_Status__c,Overall_Status_Ranking__c,Account_Flag__r.Id,Flag_for_Editorial__c from Flag_Reporter__c Where Account_Flag__c IN : aID];

 

  • March 31, 2012
  • Like
  • 0