• U Jay
  • NEWBIE
  • 145 Points
  • Member since 2013

  • Chatter
    Feed
  • 4
    Best Answers
  • 1
    Likes Received
  • 1
    Likes Given
  • 22
    Questions
  • 42
    Replies
my vfp code:
<apex:page controller="GetURLCOREnew">
  <apex:outputText  value="{!myurll}"/>
</apex:page>

controller:
public class GetURLCOREnew {

    public string sfURL= System.URL.getSalesforceBaseUrl().getHost();
    public string myURL= 'https://'+sfUrl+'/apex/CoreBenefit_PDF?id='+;
   
    public String getsfurll() {
        return sfURL;     
    }
    public String getmyurll() {
        return myURL;     
    }
}

the outpul should be:          https://vsp--kmbuild--c.cs10.visual.force.com/apex/CoreBenefit_PDF?id=kA3J0000000CbHQ

i should get the id from the visualforce page

Thanks in advance
I have this formula to caclulate the age of an employee:


IF(ISBLANK(Birthdate__c),
0,
IF(TODAY()-DATE(YEAR(TODAY()),MONTH(Birthdate__c),DAY(Birthdate__c))<0,
YEAR(TODAY())-YEAR(Birthdate__c)-1,
YEAR(TODAY())-YEAR(Birthdate__c)
)
)

There is one person with their birthdate on on a Leap year and is giving me #ERROR in the Age field.  What can I do to add Leap year information?

Thanks.
  • October 06, 2014
  • Like
  • 0
Hi people,

I wanted some clarifications on the set of questions w.r.t Salesforce Dev 401 examination.

Following are the set of questions :


1. Dynamic Dashboards can have a Scheduled Refresh ?  
   A.   True
   B.   False

2. When you delete an analytic snapshot, the source report and target object are also deleted?  
   A.   True
   B.   False

3. How many external Id’s are allowed on an object ?  
    A.   1
    B.   7
    C.   3 
    D. 4
4. Default values can be set on the Dependent Picklist Fields ?  
    A.   True
    B.   False
5. Do the Access granted to reports by the Folders roll up via the role Hierarchy ?  
    A.   Yes 
    B.   No
6. Standard reports parameters (Available Fields, Criteria, time Frame) be changed and saved in the same Standard Report ?  
    A.   True  
    B.   False

7. Can we change URL of the context-specific Help links on any salesforce.com page (one for all)?  
    A.  True
    B.  False

8. Standard components on home page is not editable except  
    A.  Dashboard Snapshot
    B.  Items to Approve
    C.  Recent Items
    D.  Create New...
    E.  Calendar
    F.  Tasks
    G.  Customer Portal Welcome
    H.  Messages & Alerts()
    I.  Custom Links

9. 'Custom links' standard component contains up to how many bookmarks? 
   A.   5
   B.   10
   C.   20
   D.   15

10. Which kinds of custom component can be added to home page?  
   A.  Links
   B.  Image Area
   C.  Bookmarks
   D.  Script Area
   E.  Image/Logo()
   F.  HTML Area

Please do the needful.


Regards,
Vignesh Nayak S
I have a trigger on object. I tried to write a test class for the trigger. When i run the test class on the line that insert the object of trigger, i got an error:

System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_EXECUTE_FLOW_TRIGGER, The record couldn’t be saved because it failed to trigger a flow. A flow trigger failed to execute the flow with version ID 301g000000016GM. Contact your administrator for help.: []


Can anybody help me to figure out the reason ?

Thanks in advance.
  • January 11, 2016
  • Like
  • 0
Hi all,

I have a requirement to send set of PDF pages to a user as a single pdf.Can anybody help me to get an apex code to combine multiple PDF (Visualforce render as PDF) into one?


Thanks in advance.
  • January 05, 2016
  • Like
  • 0
OVER_QUERY_LIMIT on google map for large amount of accounts.


Hi all ,
              I am using a professional edition. I want to display set of accounts in the google map. The shows displays pretty good when number of accounts displayed are less. When it is more, gerring an exception 'OVER_QUERY_LIMIT'. Anybody got similer exception ? Any help? My code is given below. Thanks in advance
  • December 08, 2015
  • Like
  • 0
Hi all ,
              I am using a professional edition. I want to display set of accounts in the google map. The shows displays pretty good when number of accounts displayed are less. When it is more, gerring an exception 'OVER_QUERY_LIMIT'. Anybody got similer exception ? Any help? My code is given below. Thanks in advance


<apex:page standardController="Account" sidebar="false" recordSetVar="Accounts"> <html> <head> <title>Google Maps JavaScript API v3 Example: Geocoding Simple</title> <style type="text/css"> html { width:100%;height: 100% } body { width:100%;height: 100%; margin: 0; padding: 0 } #map-canvas { width:1000;height:1000;margin:0 auto; } div{vertical-align:middle;} .wrapper{max-width:1200px;margin:auto;} .legend-container{width:200px;margin-left:5px;display:inline-block} .legend-tile{color:#777;font-size:10px;padding:5px; width:195px; max-height:50px; display:inline-block; margin:10px; border:4px solid; border-radius:4px;} .legend-tile img{ width:20px;} </style> <script type="text/javascript" src="https://maps.google.com/maps/api/js?v=3&key=AIzaSyDD1LnFxjvmx06ik9HlRtk5jW2wPY_XvPY&sensor=false&callback=initialize"></script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script> function initialize(){ var map = new google.maps.Map(document.getElementById('map_canvas'), { zoom: 2, minZoom:2, center: new google.maps.LatLng(43.253205,-80.480347), mapTypeId: google.maps.MapTypeId.ROADMAP }); var infowindow = new google.maps.InfoWindow(); var geocoder = new google.maps.Geocoder(); var marker, i=0; var rating; var type; var markercolor; var address=""; var shippingstreet; var shippingcity; var shippingstate; var shippingpostalcode; var shippingcountry; <apex:repeat value="{!Accounts}" var="accnt"> rating = "{!accnt.Active__c}"; type = "{!accnt.Type}"; i = i+1; //alert("{!accnt.BillingLatitude}"); //alert("{!accnt.BillingLongitude}"); if( rating == "true" && type == "Competitor/Chemical Supplier"){ markercolor = "{!URLFOR($Resource.VianceMapPin,'VianceMap/red.png')}"; } else if ( rating == "true" && type == "Treater"){ markercolor = "{!URLFOR($Resource.VianceMapPin,'VianceMap/yellow.png')}"; } else if( rating == "false" && type == "Competitor/Chemical Supplier"){ markercolor = "{!URLFOR($Resource.VianceMapPin,'VianceMap/blue.png')}"; } else if ( rating == "false" && type == "Treater"){ markercolor = "{!URLFOR($Resource.VianceMapPin,'VianceMap/green.png')}"; } shippingstreet = "{!accnt.ShippingStreet}"; shippingcity = "{!accnt.ShippingCity}"; shippingstate = "{!accnt.ShippingState}"; shippingpostalcode = "{!accnt.ShippingPostalCode}"; shippingcountry = "{!accnt.ShippingCountry}"; if(shippingstreet != "undefined"){ address = address + shippingstreet +","; } if(shippingcity != "undefined"){ address = address + shippingcity +","; } if(shippingstate != "undefined"){ address = address + shippingstate +","; } if(shippingpostalcode != "undefined"){ address = address + shippingpostalcode +","; } if(shippingcountry != "undefined"){ address = address + shippingcountry; } geocodeAddress("{!accnt.Name}, "+address ,markercolor,i); setInterval(geocodeAddress, 2000); address = ""; </apex:repeat> function geocodeAddress(location,markercolor,i) { //alert(location); geocoder.geocode( { 'address': location}, function(results, status) { //alert(status); if (status == google.maps.GeocoderStatus.OK) { //alert(results[0].geometry.location); map.setCenter(results[0].geometry.location); createMarker(results[0].geometry.location,"<b>"+location+"</b>",markercolor); } else { //alert("some problem in geocode" + status); if (status == "OVER_QUERY_LIMIT"){ //Integer start = System.Now().millisecond(); //while(new System.Now().millisecond()< (start+2000)); //geoCodeAddress(location,markercolor,i); setTimeout(function(){ geoCodeAddressMethosInvoker(location,markercolor,i); }, 3000); //setTimeout(function(){ alert("Hello"); }, 3000); // sleep(1000); //startTimer(); } } }); } function createMarker(latlng,html,markercolor){ var marker = new google.maps.Marker({ position: latlng, map: map, icon: new google.maps.MarkerImage(markercolor) }); google.maps.event.addListener(marker, 'mouseover', function() { infowindow.setContent(html); infowindow.open(map, marker); }); google.maps.event.addListener(marker, 'mouseout', function() { infowindow.close(); }); } } </script> </head> <body style="margin:0px; padding:0px;"> <div class="wrapper"> <div id="map_canvas" style="width: 990px; height: 400px; display:inline-block;"/> <script>initialize();</script> <div class="legend-container"> <div class="legend-tile" style="border-color:#EDB6B6;"> <div style="display:inline-block;"><apex:image url="{!URLFOR($Resource.VianceMapPin,'VianceMap/red.png')}"/></div><div style="display:inline-block;/*width:213px;*/">Active Competitor/Chemical Supplier</div> </div> <div class="legend-tile" style="border-color:#BFD5EC;"> <div style="display:inline-block;"><apex:image url="{!URLFOR($Resource.VianceMapPin,'VianceMap/blue.png')}"/></div><div style="display:inline-block;/*width:213px;*/">Inactive Competitor/Chemical Supplier</div> </div> <div class="legend-tile" style="border-color:#F1F5A8;"> <div style="display:inline-block;"><apex:image url="{!URLFOR($Resource.VianceMapPin,'VianceMap/yellow.png')}"/></div><div style="display:inline-block;/*width:213px;*/">Active Treater</div> </div> <div class="legend-tile" style="border-color:#CCEBAF;"> <div style="display:inline-block;"><apex:image url="{!URLFOR($Resource.VianceMapPin,'VianceMap/green.png')}"/></div><div style="display:inline-block;/*width:213px;*/">Inactive Treater</div> </div> </div> </div> </body> </html> </apex:page>
 
  • December 08, 2015
  • Like
  • 0
I have a set of input fields with field level mandatory condition. And an inputText with a null check. If i miss more than one input field, show all the error messages together. If fail inputText only, shows error properly. But if i miss inputText and inputFields, Can see only errormessages for inputfields only. :(
What is the reason ? Any solution? Thanks in advancce :)
  • May 04, 2015
  • Like
  • 0
Can i convert a number / currency to TEXT without lose trailing zeroes.

<apex:outputText value="{!SUBSTITUTE(TEXT(additionalCost.List_Price__c),'.',',')}" />
  • March 20, 2015
  • Like
  • 0
I have to replace . With , in from the decimal / currency value within visualforce page using output text without output field.

<apex:outputPanel rendered="{!localeValue != 'Eng'}">

<apex:outputText value="{!countryCurrencySymbol} {!SUBSTITUTE(TEXT(additionalCost.Actual_Price_without_Discount__c),'.',',')}" rendered="{!NOT(ISNULL(additionalCost.Actual_Price_without_Discount__c))}"/>

</apex:outputPanel>




This is my code. Replacement took plae nicely. But the terminating zeroes will not display.

Value in db = 12.30

Value displayed = 12,3

value required = 12,30




Value in db = 12.34000

Value displayed = 12,34

value required = 12,34000




What change i should make?
  • March 19, 2015
  • Like
  • 0
How can set fixed width for all columns in a apex:panelGrid in salesforce visualforce page that render as PDF.
Style section not worked properly when i am using renderAs="PDF" :(
Any help?
Thanks in advance.
  • October 23, 2014
  • Like
  • 0
public void sendHouseHoldmailingAddressNotificationAction(){
         Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();for(String destinationEmailItem : fetchDestination()){
             String emailAddr = destinationEmailItem.Email;
             <<<some code>>>
          }
}
public List<Contact> fetchDestination(){
         List<Contact> destination = new List<Contact>();
         for(Contact contactRecord : [SELECT id, Account.BillingCity, Account.Billingstate, Age_Group__c, npsp__Current_Address__c,AccountID, Account.Invalid_Address__c, Email
                                      FROM Contact
                                      WHERE Account.Invalid_Address__c = True AND Age_Group__c = 'Adult' AND Email != null]){
             destination.add(contactRecord);   
         }
         if(destination.size() > 0){
             return destination;
         }
         else{
             return null;
         }
     }
I got error "SendMailingAddressNotificationAcntCntrlr Compile Error: Initial term of field expression must be a concrete SObject: String at" bold line. Why?
Thanks in advance.
  • September 24, 2014
  • Like
  • 0
@isTest
public class TestCopyEmailToAllAssociatedTransactions{
   public static testMethod void TestCopyEmailToAllAssociatedTransactionsController(){
        contact contactRecord = new Contact();
        contactRecord.lastName = 'Test last name';
        insert contactRecord;
       
        Opportunity opportunityRecord = new Opportunity();
        opportunityRecord.Name = 'Test Opportunity';
        opportunityRecord.StageName ='Finalized';
        opportunityRecord.CloseDate = date.Today();
        opportunityRecord.Contact__c = contactRecord.id;
        insert opportunityRecord;
       
        ChargentSFA__Transaction__c transactionRecord = new ChargentSFA__Transaction__c();
        transactionRecord.ChargentSFA__Response_Message__c = 'OK';
        transactionRecord.ChargentSFA__Response_Status__c ='Approved';
        transactionRecord.ChargentSFA__Opportunity__c = opportunityRecord.id;
        insert transactionRecord;

       
        contactRecord.Email= 'test@test.com';
        update contactRecord;
   }
}
Tis is my test class. The bolded section generate a trigger failure
System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, ChargentSFA.TransacionTrigger: execution of AfterInsert

caused by: System.NullPointerException: Attempt to de-reference a null object
What will be the reason?
Thanks in advance.
  • September 23, 2014
  • Like
  • 0
This is my code :-
page=>
<messaging:emailTemplate relatedToType="Account" subject="Congregation point of contact notification" recipientType="Contact" >
    <messaging:plainTextEmailBody >
        <html>
            <body>
                <p>Hi {!relatedTo.Point_of_contact__r.Name}</p>
                <p>Below is the list of congregation accounts where you are the point of contact.</p>
                <c:CongrgationPointOfContact accountID="{!relatedTo.ID}"/>
            </body>
        </html>
    </messaging:plainTextEmailBody>
</messaging:emailTemplate>
component =>
<apex:component access="global" controller="congrgationPointOfContactController">
    <apex:attribute name="accountID" type="Id" description="Id of the account" assignTo="{!accountIdValue}"/>

    <apex:dataTable value="{!contactList}" var="CongrgationAccountListItem" border="1px" cellpadding="1">
        <apex:column >
            <apex:facet name="header">Congregation Account Name(Home meeting)</apex:facet>
            <apex:outputText value="{!CongrgationAccountListItem.Name}"/>
        </apex:column>
        <apex:column >
            <apex:facet name="header">Congregation Account ID(Home meeting)</apex:facet>
            <apex:outputText value="{!CongrgationAccountListItem.ID}"/>
        </apex:column>
        <apex:column >
            <apex:facet name="header">Congregation Account ID(Home meeting)</apex:facet>
            <apex:outputText value="{!CongrgationAccountListItem.accountID}"/>
        </apex:column>
    </apex:dataTable>
</apex:component>
controller =>
/******************************************************************************
* @File Name         : congrgationPointOfContactController
* @Description       : class for CongrgationPointOfContact component
* @Copy Right        : NEYM
* @Modification Log  : 17-Sept-2014
* =============================================================================
* Ver    Date                   Author            Modification
* -----------------------------------------------------------------------------
* 1.0    17-Sept-14             QBurst            Created
********************************************************************************/
public class congrgationPointOfContactController{
    public Id accountIdValue {get;set;}
    //public Id contactIdValue {get;set;}
    public List<Account> getCongrgationAccountList(){
        List<Account> accountList = new List<Account>();
        for(Account accountItem : [SELECT id, Name, Point_of_contact__c
                                         
                                   FROM account
                                   WHERE recordTypeID = '012L0000000DELE' AND Id = :accountIdValue]){
            accountList.add(accountItem);                         
        }
        return accountList;  
    }
    public List<Contact> getContactList(){
        System.debug('*******************************accountIdValue'+accountIdValue);
        List<Contact> contactList = new List<Contact>();
        for(Contact contactItem : [SELECT id, Name, AccountID
                                         
                                   FROM contact
                                   WHERE AccountID = :accountIdValue]){
            contactList.add(contactItem);                         
        }
        return contactList;  
    }
}
=====================================
When i save the visual force template shows as below =>
<html>
<body>
<p>Hi </p>
<p>Below is the list of congregation accounts where you are the point of contact.</p><table class="rich-table " id="j_id0:emailTemplate:j_id3:j_id4:j_id7:j_id8:j_id9" border="1px" cellpadding="1" cellspacing="0"><colgroup span="3"></colgroup><thead class="rich-table-thead"><tr class="rich-table-subheader "><th class="rich-table-subheadercell " scope="col" colspan="1" id="j_id0:emailTemplate:j_id3:j_id4:j_id7:j_id8:j_id9:j_id10header"><div id="j_id0:emailTemplate:j_id3:j_id4:j_id7:j_id8:j_id9:j_id10header:sortDiv">Congregation Account Name(Home meeting)</div></th><th class="rich-table-subheadercell " scope="col" colspan="1" id="j_id0:emailTemplate:j_id3:j_id4:j_id7:j_id8:j_id9:j_id13header"><div id="j_id0:emailTemplate:j_id3:j_id4:j_id7:j_id8:j_id9:j_id13header:sortDiv">Congregation Account ID(Home meeting)</div></th><th class="rich-table-subheadercell " scope="col" colspan="1" id="j_id0:emailTemplate:j_id3:j_id4:j_id7:j_id8:j_id9:j_id16header"><div id="j_id0:emailTemplate:j_id3:j_id4:j_id7:j_id8:j_id9:j_id16header:sortDiv">Congregation Account ID(Home meeting)</div></th></tr></thead><tbody id="j_id0:emailTemplate:j_id3:j_id4:j_id7:j_id8:j_id9:tb"><tr class="rich-table-row rich-table-firstrow "><td class="rich-table-cell " id="j_id0:emailTemplate:j_id3:j_id4:j_id7:j_id8:j_id9:0:j_id10" colspan="1">Jeffrey Hipp</td><td class="rich-table-cell " id="j_id0:emailTemplate:j_id3:j_id4:j_id7:j_id8:j_id9:0:j_id13" colspan="1">003L000000LF1xtIAD</td><td class="rich-table-cell " id="j_id0:emailTemplate:j_id3:j_id4:j_id7:j_id8:j_id9:0:j_id16" colspan="1"></td></tr><tr class="rich-table-row "><td class="rich-table-cell " id="j_id0:emailTemp
........
instead of proper table display.
What will be the reason?
Any help?
  • September 17, 2014
  • Like
  • 0
Can anybody share experience with litle- co chargent integration for salesforce ?
It would be helpful for me , if you share any doc or tool  with step by step procedure.
Thanks in advance.
  • September 15, 2014
  • Like
  • 0
In my opportinity database , passport expiration month and year. I have to send email to all opportunity billing emails, whose expiration month and year is just 1 month (ie send email today if expiration month is (10: october and year is 2014)). What is a better way to do it?
Any step by step procedure?
Thanks in advance.
  • September 01, 2014
  • Like
  • 0
How can get an alert on click a custom button indetail page of record if a condition met othervise lead to a new window.
  • August 29, 2014
  • Like
  • 0
How can show an error message if a field in a tab is null near a button in the same tab on click it.othervice load a new url in a new window?
  • August 29, 2014
  • Like
  • 0
How can close current window on a button click after action in salesforce?
Have a button on a page layout in a tab.
When i click the button , will open a new visualforce page in new window.
When i click action button, have to close current window .
How can i achieve it?
Any help?
My current code :-
<apex:page controller="CommitteePositionRoleChangeController" showHeader="False">
    <script>
        function closeWindow() {
            alert(1);
            window.close();
        }
    </script>
    <apex:form >
       
        <apex:outputPanel >
            <apex:outputText value="Select New Contact"/>
            <apex:inputField value="{!positionCommitteService.Contact__c}"/>
            <apex:commandButton value="OK" action="{!committeePositionRoleChangeAction}" rerender="statusMessagePanel" onComplete="closeWindow()"/>
        </apex:outputPanel>
        <apex:outputPanel id="statusMessagePanel">
            <apex:pageMessages rendered="{!showStatusMessage}"/>
        </apex:outputPanel>
    </apex:form>            
</apex:page>
Thanks in advance. :)
  • August 29, 2014
  • Like
  • 0
Installed a managed package, which contain simply 2 pages, controllers, stylles, scripts etc.
Then created a site using the apge within the pacjkage. When i clicked an action button, Recieved the exception , “List has more than 1 row for assignment to SObject
Error is in expression '{!saveingData}' in page donation:donationform: (Donation)
An unexpected error has occurred. Your solution provider has been notified. (Donation) “
What will be the reason? Anything regarding the installation or configuration.
Any help?
Thanks in advance.
  • August 27, 2014
  • Like
  • 0
I have to build a dynamic query.
I have a multi picklist with values(say X ) 'a','b','c' and 'd'.
I have to build a select query to fetch record where X contain 'b'.
How can i do it?
  • July 09, 2014
  • Like
  • 0
I need an alogorithm to get same value after encryption if i use same string.
<apex:page controller="encryptNewController">
    <apex:form >  
         <apex:outPutLabel value="Encrypted by Code"/>
         <apex:inputsecret value="{!encryptedByCode}"/>
       
       
         <apex:commandButton value="Save" action="{!saveValues}"/>
         <apex:outputText value="{!decryptedDataString}"/>
    </apex:form>
</apex:page>


public with sharing class encryptNewController {

     Public Encrypt_Object__c encryptObject {get;set;}
     Public String encryptedByCode {get;set;}
     Public String decryptedDataString {get;set;}
     Blob cryptoKey;
     public encryptNewController(){
          encryptObject=new Encrypt_Object__c();
     }
     public void saveValues(){
            List<CryptoKey__c> keyValue = [SELECT  Key__c FROM CryptoKey__c where id != null];
                String cryptoKeyString;
                System.debug('000000000000000000000000000000000000000000keyValue'+keyValue);
                if(keyValue.size() > 0){
                    cryptoKeyString = keyValue[0].Key__c;
                    cryptoKey = EncodingUtil.base64Decode(cryptoKeyString);
                System.debug('000000000000000000000000000000000000000000cryptoKey'+cryptoKey);
            }          
            encryptObject.Encrypted_by_Code__c = encryptToken(encryptedByCode);
          
            insert encryptObject;
            Encrypt_Object__c insertedencryptObject = [Select id,Encrypted_by_Code__c from Encrypt_Object__c where id=: encryptObject.id][0];
            decryptedDataString =decryptToken(insertedencryptObject.Encrypted_by_Code__c);           
     }
 
     public String encryptToken(String strOriginal){
        Blob encryptedData;
        if(cryptoKey != null){
            String strUrlUTF8 = EncodingUtil.urlEncode(strOriginal, 'UTF-8');
            Blob b = Blob.valueOf(strUrlUTF8);
            System.debug('@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@cryptoKey'+cryptoKey);
            encryptedData = Crypto.encryptWithManagedIV('AES256', cryptoKey, b);
            return  EncodingUtil.base64Encode(encryptedData);
        }else{
            return null;
        }
      
      }
   
      public String decryptToken(String encryptedString){
        if(cryptoKey != null){
         Blob b = EncodingUtil.base64Decode(encryptedString);
         Blob decryptedData = Crypto.decryptWithManagedIV('AES256', cryptoKey, b);
         String strUrlUTF8 = decryptedData.toString();
         return EncodingUtil.urlDecode(strUrlUTF8, 'UTF-8');
        }else{
            return null;
        }
      }  
}
================================================
This is my page and class to encrypt the string entered and save on databease.
Each time the 'Key__c' is same as i take from custom settings.
But when i enter 'abc' and save two times the entered value is different.
What is the reason?
Isn't  same string encrypt with same key generate same encrypted value?
Thanks in advance
  • April 09, 2014
  • Like
  • 0
I have a text field (Must Not text encrypted type ) say password.I am using it within my visual force page.
<apex:inputField html-placeholder="Enter Password"  value="{!contactReg.Password_Text__c}"/>
When i click save button the entered value must save as encrypted format.
How can i do it?
  • April 04, 2014
  • Like
  • 0
I have tw pages.Using the value in pageA i set a list.I can see the exact list in debug too.Redirectiong from pageA to pageB.After load it the list shows null.Why?

Code part...
Both pages using same controller.
if((contList.size() != 0 )&& (healthForm==true)){
               pageReferenceHealthForm=  new pageReference('/apex/pageB');
               pageReferenceHealthForm.setRedirect(true);
               return pageReferenceHealthForm;
      }
  • April 02, 2014
  • Like
  • 1
Hi Expert. I have a code below. Can anyone help to fix to avoid SOQL exception :

List<RecordType> recordTypes = [SELECT Id, Name FROM RecordType Where Name='Non-Compliance' Limit 1];
        String recordTypeId=recordTypes[0].Id;
        
        for(Task item : taskUpsertList){
            List<Non_Compliance__c> newNonComplianceList = mapNonCompliance.get(item.Subject.substring(0,4));
            for(Non_Compliance__c nc : newNonComplianceList){
                item.Subject = nc.Name;
                item.Legislative_Reference__c = nc.Legislative_Reference__c;
                item.Compliance_Issue__c = nc.Compliance_Issue__c;
                item.Offence_Reference__c = nc.Offence_Reference__c;
                item.Offender__c = nc.Offender__c;
                item.Offence_Penalty__c = nc.Offence_Penalty__c;
                item.Penalty_Notice_Penalty__c = nc.Penalty_Notice_Penalty__c;
                item.Outcome__c = nc.Outcome__c;
                item.Type = nc.RecordType.Name;
                item.Description = nc.Comments__c;
                item.Priority = nc.Priority__c;
                if(nc.RecordType.Name == 'Line Item Non-Compliance'){
                    item.Line_Item_Category_Id__c  = nc.Line_Item_Category__r.Id;
                }
                item.Non_Compliance_Id__c = nc.Id;
                item.Non_Compliance_Number__c = nc.Non_Compliance_Number__c;
                item.RecordTypeId = recordTypeId;
            }
        }
Can i convert a number / currency to TEXT without lose trailing zeroes.

<apex:outputText value="{!SUBSTITUTE(TEXT(additionalCost.List_Price__c),'.',',')}" />
  • March 20, 2015
  • Like
  • 0
Hi, 

We have created VF page to show google maps on for different routes. It is working fine yesterday but now we are facing "Over query limit" and "Zero_results". 

please help me

Thanks Advance.
 
hello all,

i am working on a visualforce page and i want to replace the dot in decimal with comma can and one help me please .

<apex:column headerValue="Preço de lista">
<apex:outputText value="{!oliWrapper.price}" id="unitPrice"/>
</apex:column>

Thanks in Advance

 
Hi, This following code is in my apex class.
In my test clas i can cover up List and followed by if condition, the bold part is not covering up. Please share me if any one have idea.

List < Forecast_Revenue_Report__c > getFlagVal = [SELECT Flag__c FROM Forecast_Revenue_Report__c WHERE Forecast_Month__c = : this.month1];
if(!getFlagVal.isEmpty()){

     this.flag = getFlagVal[0].Flag__c;

Thanks.
Hi 
I am creating a visual force page and I have to add a funnel chart in the visual force page similar to dashboard funnel component.
 
Hey guys,
I am trying to create visualforce pages from existing HTML code I have. Here is my apex so far:

<apex:page showHeader="false" standardStylesheets="false" sidebar="false">
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="shortcut icon" href="../../assets/ico/favicon.ico">

    <title>Login into the blah blah</title>

    <!-- Bootstrap core CSS -->
    <link href="css/bootstrap.css" rel="stylesheet">
    <link href="css/overrides.css" rel="stylesheet">
    <link href="css/login.css" rel="stylesheet">

    <!-- Just for debugging purposes. Don't actually copy this line! -->
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>

  <body>
    <div id="perc-container">
    <div id="header">
      <div class="secondary-nav" style="background-color: #fff;"> 
        <div class="container">
          <div class="row">
            <div class="col-lg-12" style="background-color: white;"> 
                <button class="show-search">Search</button>
                <div class="global-search">
                    <form class="global-search-inner">
                    <input type="text" class="search-main"> 
                    <input type="submit" class="search-main-submit" value="" >
                    <span class="search-icon"></span> 
                    </form>
                                  
                </div>
                <ul class="nav navbar-nav">
                    <li><a href="#">About Us</a></li>
                    <li><a href="#">Contact Us</a></li>
                     <li><a href="#">Visit Us</a></li>
                </ul>
            </div>               
          </div>
        </div>
      </div>
      <div class="primary-nav">
        <div class="container">
          <div class="row">
            <div class="col-lg-12">
                <div class="navbar-header">
                  <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                  </button>
                  <a href="#" class="mobile-search-btn hidden-lg"></a>
                  <a class="navbar-brand logo" href="#"></a>
                  <a href="" class="mobile-login hidden-lg">Login</a>
                </div>
                <div class="mobile-search hidden-lg clearfix">
                    <div class="global-search">
                        <form class="global-search-inner">
                        <input type="text" class="search-main"> 
                        <input type="submit" class="search-main-submit" value="" >
                        </form>                                  
                    </div>
                </div>
                <div class="collapse navbar-collapse">
                  <ul class="nav navbar-nav">
                    <li class="active"><a href="#">Home</a></li>
                    <li><a href="#about">Stuff</a></li>
                    <li><a href="#contact">Stuff</a></li>
                    <li><a href="#about">Submit Your Stuff</a></li>
                    <li><a href="#contact">Make an Appointment</a></li>
                   
                  </ul>
                </div><!--/.nav-collapse -->
              </div>
            </div>
          </div>
        </div>
    </div><!-- /#header -->

    <div id="main" class="landing">      
      
      <div class="section welcome-ctr">
        <div class="container">
            <div class="row">                 
                <div class="col-lg-12">
     <div class="backg-art">
    <img src="images/StuffLogo.png" alt="Stuff">
  
      <div class="form-contain">
        <form class="form-login" role="form">
          <input type="username" class="form-control" placeholder="username" required autofocus>
          <input type="password" class="form-control" placeholder="password" required>
          <button class="btn btn-sm btn-primary btn-block forgot-password btn-width btn-shade" type="submit">Login</button>
          <label class="forgot-password"><a href="#">Forgot Password</a></label>
          <label class="checkbox">
            <input type="checkbox" value="remember-me">
            Remember me</label>
        </form>
      </div>
    </div>
                   <!-- /.row --> 
                                    
                </div>
                                
            </div>                       
        </div>
      </div><!-- /.section -->  

    </div><!-- /#main -->
    <div id="footer" class="section">
        <div class="container hidden-xs">
            <div class="row"> 
                <div class="special-col">
                    <h2>Quick Links</h2>
                    <li><a href="#">Home</a></li>
                    <li><a href="#">Stuff</a></li>
                    <li><a href="#">Discussion</a></li>
                    <li><a href="#">Submit Your Stuff</a></li>
                    <li><a href="#">Our Process</a></li>
                    <li><a href="#">About Us</a></li>
                    <li><a href="#">Site Map</a></li>
                </div>
                <div class="special-col">
                    <h2>Stufforate</h2>
                    <li><a href="#">About Us</a></li>
                    <li><a href="#">Site Map</a></li>
                    <li><a href="#">Stuffs</a></li>
                    <li><a href="#">Legal</a></li>
                    <li><a href="#">Contact Us</a></li>
                    <li><a href="#">Privacy Policy</a></li>
                    <li><a href="#">Stuff Store</a></li>
                </div> 
               
               
            </div>                       
        </div>
        <div class="container visible-xs">
                <div class="row">
                    <div class="panel-group" id="accordion">
                              <div class="panel panel-default">
                                <div class="panel-heading">
                                  <h2 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">Quick Links<span></span></a></h2>
                                </div>
                                <div id="collapseOne" class="panel-collapse collapse">
                                  <div class="panel-body">
                                  <li><a href="#">Home</a></li>
                    <li><a href="#">Stuff</a></li>
                    <li><a href="#">Discussion</a></li>
                    <li><a href="#">Submit Your Stuff</a></li>
                    <li><a href="#">Our Process</a></li>
                    <li><a href="#">About Us</a></li>
                    <li><a href="#">Site Map</a></li>
                                  </div>
                                </div>
                              </div>
                              <div class="panel panel-default">
                                <div class="panel-heading">
                                  <h2 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" href="#collapseTwo">Stuff Solutions<span></span></a></h2>
                                </div>
                                <div id="collapseTwo" class="panel-collapse collapse">
                                  <div class="panel-body">
                                      <li><a href="#">About Us</a></li>
                    <li><a href="#">Site Map</a></li>
                    <li><a href="#">Stuff</a></li>
                    <li><a href="#">Legal</a></li>
                    <li><a href="#">Contact Us</a></li>
                    <li><a href="#">Privacy Policy</a></li>
                    <li><a href="#">Stuff Store</a></li>
                                  </div>
                                </div>
                              </div>
                              
                            </div>
                </div>
            
        </div>
        <div class="container">
            <div class="row"> 
                <p class="copyright">©2014 Stuff Services, Inc.</p>
            </div>                       
        </div>
    </div><!-- /.footer -->
    <div id="video-modal" role="dialog" class="modal fade">     
            <div class="modal-content">
            <button type="button" class="close" data-dismiss="modal"><span>x</span></button>        
            <video autoplay src=""></video>
            </div> 
    </div>
    </div>
    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="js/lib/jquery.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/settings.js"></script>
  </body>
</html>

</apex:page>

I get the following error:
Error: StuffCenterLogin line 24, column 4: The element type "link" must be terminated by the matching end-tag "</link>"
Error Error: The element type "link" must be terminated by the matching end-tag "</link>".

Any ideas?
I'm new to visualforce

Thanks!
hi all,

i need to create a custom button on event object on click of which an edit page of a custom object opens up and after the custom obj record is
saved,the event objects related to field is populated with the custom object record

How can i best achieve this?


Thanks

I wrote a code for the following output:

<apex:page standardController="Account" recordSetVar="RecordsSet">
<apex:form >
    <apex:pageBlock >
        <apex:pageblocksection >
            <apex:pageblockTable value="{!RecordsSet}" var="rec" id="TableOne">
                <apex:column ><apex:facet name="header"></apex:facet>
                    <apex:commandLink value="{!rec.name}"/>
                </apex:column>
            </apex:pageblockTable>
        </apex:pageblocksection>
    </apex:pageBlock>
</apex:form>
</apex:page>

User-added image


But, Here i need when i click on any of the records then i want to display related contacts for that account in the TableTwo in the same page using PageReference or any other methods.............

I Would appriciate any king of replay..................
Hi,

When I open a VF-page in Winter 15, it shows smaller than it is in Summer 14. Any idea anyone?
Regards Monique
Hi people,

I wanted some clarifications on the set of questions w.r.t Salesforce Dev 401 examination.

Following are the set of questions :


1. Dynamic Dashboards can have a Scheduled Refresh ?  
   A.   True
   B.   False

2. When you delete an analytic snapshot, the source report and target object are also deleted?  
   A.   True
   B.   False

3. How many external Id’s are allowed on an object ?  
    A.   1
    B.   7
    C.   3 
    D. 4
4. Default values can be set on the Dependent Picklist Fields ?  
    A.   True
    B.   False
5. Do the Access granted to reports by the Folders roll up via the role Hierarchy ?  
    A.   Yes 
    B.   No
6. Standard reports parameters (Available Fields, Criteria, time Frame) be changed and saved in the same Standard Report ?  
    A.   True  
    B.   False

7. Can we change URL of the context-specific Help links on any salesforce.com page (one for all)?  
    A.  True
    B.  False

8. Standard components on home page is not editable except  
    A.  Dashboard Snapshot
    B.  Items to Approve
    C.  Recent Items
    D.  Create New...
    E.  Calendar
    F.  Tasks
    G.  Customer Portal Welcome
    H.  Messages & Alerts()
    I.  Custom Links

9. 'Custom links' standard component contains up to how many bookmarks? 
   A.   5
   B.   10
   C.   20
   D.   15

10. Which kinds of custom component can be added to home page?  
   A.  Links
   B.  Image Area
   C.  Bookmarks
   D.  Script Area
   E.  Image/Logo()
   F.  HTML Area

Please do the needful.


Regards,
Vignesh Nayak S

I am trying to round the decimal places that are being displayed in an outputField to remove trailing zeros. The custom field that I am trying to display is set to be a number with 7 decimal places. There are cases though where not all 7 decimal places will be used, so I want to strip away trailing zeros.


Example: If I had 10.0001000 I want it to display as 10.0001 on my Visualforce page.

 

I tried doing something like this:

 

<apex:outputField value="{0}">
   <apex:param value="{!ROUND(customField__c, number)}" />
</apex:outputField>

 This returned an error value for <apex:outputField> is not a dynamic binding!

 

If I change it to an outputText it works, but I need this field to be based on user locale which is why I was using an outputField.

 

Thanks in advance!

  • August 22, 2012
  • Like
  • 0

Hi,

 

 am trying to send the mass email to contacts.I am getting the error as  below.Am doing this in a DE org.

 


System.EmailException: SendEmail failed. First exception on row 0; first error: NO_MASS_MAIL_PERMISSION, Single email is not enabled for your organization or profile. Single email must be enabled for you to use this feature.

 

 

My coding as  below

 

 private final List<Id> contactids;
  public List<Contact> con;
  public testemail(ApexPages.StandardController controller)
  {
     con = [select Id from Contact limit 5];    
     contactids=new  List<Id>();     
     for(Integer i=0;i<con.size();i++)
     {    
      contactids.add(con[i].Id);       
     } 
  }

  public void SendEmail()
  {
      Messaging.MassEmailMessage mail = new Messaging.MassEmailMessage();
      mail.setTargetObjectIds(contactids);   
      mail.setTemplateId('00X90000000ZQgA');
      Messaging.sendEmail(new Messaging.MassEmailMessage[] { mail });
  } 

 

 

  Can anybody tell me how to enable single email/mass email?

 

  Thanks  for any help

 

 

  • January 18, 2010
  • Like
  • 0

Hi there. I'm wondering if anybody in the past has merged 2 or more pdf files using the getContent()

method or something similar? Is this possible?

Thanks

  • February 24, 2009
  • Like
  • 0
Hi.

In the VF I used the date format as YYYY-MM-dd in the 
<apex:outputText value="{0,date,YYYY/MM/dd}">
Before the last week of the year it was OK. When the new year falls in the  last week of Decemeber comes the issue.
For example
2014:
S   M  T  W Th F Sat
28 29 30 31 1   2 3

In the above calendar 1st Jan of 2015 falls in the Thurusday.So when I viewd the records of 28,29,30 of December 2014 It showed as
2015-12-28
2015-12-29
2015-12-30
2015-12-31

After that I came to know that
@"YYYY" is week-based calendar year.
@"yyyy" is ordinary calendar year.
http://realmacsoftware.com/blog/working-with-date-and-time

cheers
suresh