• DevADS
  • NEWBIE
  • 305 Points
  • Member since 2013

  • Chatter
    Feed
  • 9
    Best Answers
  • 0
    Likes Received
  • 5
    Likes Given
  • 1
    Questions
  • 77
    Replies
I wrote this code to solve the trialhead but it gives me this error on trialhead 


error:   The page does not include an <apex:image> component

code:
<apex:page showHeader="false">
    <img id="theImage" src="https://developer.salesforce.com/files/salesforce-developer-network-logo.png" />
</apex:page>

trialhead challenge:
Create a Visualforce page without the standard Salesforce header and display an image using the Visualforce image component. 
Challenge Requirements
The page must be named DisplayImage
It must NOT display the standard Salesforce header
It must use a Visualforce apex:image component to display this image - https://developer.salesforce.com/files/salesforce-developer-network-logo.png
 

Hello,

Did anyone else notice that the view state limit in Visualforce pages has been increased from 135 to 170 KB in the new release of Spring 2019

Hello,

I have converted my lead to Oportunity, contact and account.

How are they interlinked, If i need to query each of them from the others, what is the SOQL query, i can use

Thank in advance
Hi,
 
[{"Name": "US-0000314","Project":"TestPOC","Release":"Dec-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000312","Project":"TestPOC","Release":"Dec-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000315","Project":"TestPOC","Release":"Dec-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000318","Project":"TestPOC","Release":"Dec-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000313","Project":"TestPOC","Release":"Dec-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000317","Project":"TestPOC","Release":"Dec-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000320","Project":"TestPOC","Release":"Dec-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000316","Project":"TestPOC","Release":"Dec-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000322","Project":"TestPOC","Release":"Dec-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000319","Project":"TestPOC","Release":"Dec-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000321","Project":"TestPOC","Release":"Dec-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000324","Project":"TestPOC","Release":"Dec-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000328","Project":"TestPOC","Release":"Dec-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000335","Project":"TestPOC","Release":"Feb-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000337","Project":"TestPOC","Release":"Feb-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000329","Project":"TestPOC","Release":"Dec-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000330","Project":"TestPOC","Release":"Dec-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000336","Project":"TestPOC","Release":"Feb-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000332","Project":"TestPOC","Release":"Dec-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000331","Project":"TestPOC","Release":"Dec-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000334","Project":"TestPOC","Release":"Feb-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000333","Project":"TestPOC","Release":"Dec-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000342","Project":"TestPOC","Release":"Dec-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000344","Project":"TestPOC","Release":"Dec-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000345","Project":"TestPOC","Release":"Feb-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000343","Project":"TestPOC","Release":"Feb-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"}]

I want display the above JSON in below table format in Visualforce page. Please help me.

User-added image
Thanks and Regards,
Diwakar G

Hi,

I am having three record type in opportunity like a,b,c.I want to restrict a user e.g Ram Sharma should not create any opportunity with record type b.
Please suggest me how to do that.I cannot change his profile.
Hi all,

I am facing an issue in a before update trigger, I am just trying to add some characters at the end of a String field:

Trigger.new[0].myField__c  =  Trigger.new[0].myField__c  +  ',00' ;

The issue is that when I enter 12 in this field I should get 12,00.
However I get : 12,00,00

So it looks like my string is concatenated twice...could someone help?

Thanks!
  • January 15, 2014
  • Like
  • 0
Hi ,
i have search code below  where i can search a question with its beginning letter or if i give full question but i want to get the question even  if i given any letter  or word in middile of that question. please help me on this .I hope there might be wrong in like condition.Can i please know how can i solve this?

Here is the code for that
Vf page
<apex:page controller="QuesSearchCont" sidebar="false">
<apex:form >
  <apex:pageMessages id="errors" />

  <apex:pageBlock title="Find Me A Question & Answer!" mode="edit">

  <table width="100%" border="0">
  <tr>
    <td width="200" valign="top">

      <apex:pageBlock title="Parameters" mode="edit" id="criteria">

      <script type="text/javascript">
      function doSearch() {
        searchServer(
          document.getElementById("question").value,
          document.getElementById("answer").value);
      }
      </script>

      <apex:actionFunction name="searchServer" action="{!runSearch}" rerender="results,debug,errors">
          <apex:param name="Question__c" value="" />
          <apex:param name="Answer__c" value="" />
       
       
      </apex:actionFunction>

      <table cellpadding="0" cellspacing="0">
      <tr>
        <td style="font-weight:bold;">QUESTION<br/>
        <input type="text" id="question" onkeyup="doSearch();"/>
        </td>
      </tr>
      <tr>
        <td style="font-weight:bold;">ANSWER<br/>
       <input type="text" id="answer" onkeyup="doSearch();"/>
        </td>
      </tr>
            </table>

      </apex:pageBlock>

    </td>
    <td valign="top">

    <apex:pageBlock mode="edit" id="results">

        <apex:pageBlockTable value="{!faq}" var="faqs">

            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Question" action="{!toggleSort}" rerender="results,debug">
                        <apex:param name="sortField" value="question" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
              <apex:outputField value="{!faqs.Question__c}"/>
            </apex:column>

            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Answer" action="{!toggleSort}" rerender="results,debug">
                        <apex:param name="sortField" value="answer" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
               <apex:outputField value="{!faqs.Answer__c}"/>
            </apex:column>
        </apex:pageBlockTable>

    </apex:pageBlock>

    </td>
  </tr>
  </table>

  <apex:pageBlock title="Debug - SOQL" id="debug">
      <apex:outputText value="{!debugSoql}" />        
  </apex:pageBlock> 

  </apex:pageBlock>

  </apex:form>
</apex:page>

Controler:public with sharing class QuesSearchCont {
// the soql without the order and limit
private String soql {get;set;}
  // the collection of contacts to display
  public List<FAQ__c> faq {get;set;}

  // the current sort direction. defaults to asc
  public String sortDir {
    get  { if (sortDir == null) {  sortDir = 'asc'; } return sortDir;  }
    set;
  }

  // the current field to sort by. defaults to last name
  public String sortField {
    get  { if (sortField == null) {sortField = 'Question__c'; } return sortField;  }
    set;
  }

  // format the soql for display on the visualforce page
  public String debugSoql {
    get { return soql + ' order by ' + sortField + ' ' + sortDir + ' limit 20'; }
    set;
  }

  // init the controller and display some sample data when the page loads
  public QuesSearchCont() {
    soql = 'select Question__c, Answer__c from FAQ__c where Question__c!= null';
    runQuery();
  }

  // toggles the sorting of query from asc<-->desc
  public void toggleSort() {
    // simply toggle the direction
    sortDir = sortDir.equals('asc') ? 'desc' : 'asc';
    // run the query again
    runQuery();
  }

  // runs the actual query
  public void runQuery() {

    try {
      faq = Database.query(soql + ' order by ' + sortField + ' ' + sortDir + ' limit 20');
    } catch (Exception e) {
      ApexPages.addMessages(e);
    }

  }

  // runs the search with parameters passed via Javascript
  public PageReference runSearch() {
try{
FAQ__c f=new FAQ__c();
    String question = Apexpages.currentPage().getParameters().get('Question__c');
    String answer = Apexpages.currentPage().getParameters().get('Answer__c');
 

  
    soql = 'select Question__c, Answer__c from FAQ__c where Question__c!= null';
    if (!question.equals(''))
      soql += ' and Question__c LIKE \''+String.escapeSingleQuotes(question)+'%\'';
    if (!answer.equals(''))
      soql += ' and Answer__c LIKE \''+String.escapeSingleQuotes(answer)+'%\'';
   // if (!accountName.equals(''))
     // soql += ' and account.name LIKE \''+String.escapeSingleQuotes(accountName)+'%\'';
  
    // run the query again
    }
     catch(NullPointerException ne){
     ApexPages.addMessages(ne);
    }
    runQuery();

    return null;
    }



}

hi,

can some help me

 List<SObject> ObjectContents;

String query=Select name from contact;

 ObjectContents = database.query(query);

 

if my query returns 2 rows then size of objectcontents wll be how much?

 

Thanks.

  • September 03, 2013
  • Like
  • 0

Hello,

 

I have some doubts around EchoSign App, If anyone has already worked on it or having any experience, Please help me for following scenarios!

 

1) I have a scenario where I want to send the Opportunity data with the Agreement for eSignature. so how can I achieve this?

 

2) When the I will get the Agreement after Signature, I want to extract the Signature of that document & store it on Perticular Detail page like as
in "Authorized By" section of another object.

 

Thanks accolades!

  • September 27, 2013
  • Like
  • 0
I wrote this code to solve the trialhead but it gives me this error on trialhead 


error:   The page does not include an &lt;apex:image&gt; component

code:
<apex:page showHeader="false">
    <img id="theImage" src="https://developer.salesforce.com/files/salesforce-developer-network-logo.png" />
</apex:page>

trialhead challenge:
Create a Visualforce page without the standard Salesforce header and display an image using the Visualforce image component. 
Challenge Requirements
The page must be named DisplayImage
It must NOT display the standard Salesforce header
It must use a Visualforce apex:image component to display this image - https://developer.salesforce.com/files/salesforce-developer-network-logo.png
 
I am having some errors in the below code for the trigger to update contact address with Account Address using apex controller

public class ContactUpdateAccountAddress {
    public static void updatecontacts(List<Contact> contactlist){
        updateAddressToContacts(contactlist);
        
    }
    public static void updateAddressToContacts(List<Contact> contactlist){
        set<id> accIds = new set<id>();
        list<account> updAccaddr = new list<account>();
        for(contact con : contactlist){
            accIds.add(con.accountid);
        }
        system.debug('###'+accIds);
        list<account> acclist = [select id,BillingStreet,BillingCity,BillingState,BillingPostalCode,BillingCountry,(select id,MailingStreet,MailingCity, MailingState,MailingPostalCode,MailingCountry from contacts) from account where id in : accIds];
        for(Account acc : updAccaddr) {
        for(Contact con : contactlist){
           con.MailingStreet =  acc.BillingStreet ;
            contactlist.add(con);
        }
            }
        update contactlist;
    }

trigger ContactUpdateAccountAddressTrigger on Contact (before insert, after update, after delete) {
    if(trigger.isInsert && trigger.isbefore){
        ContactUpdateAccountAddress.updatecontacts(trigger.new);
    }
I would like to extra add space between two strings and insert that into a text area field from a trigger. The text should look like
Avalible Date         Quantity 

Please suggest me..
Is it possible to create field dependency in Visualforce page for two unrelated picklists from different objects without hardcoding in custom controller? (with javascript or any other alternative)

Hello,

Did anyone else notice that the view state limit in Visualforce pages has been increased from 135 to 170 KB in the new release of Spring 2019

Hi,

We have a lighting component opens through quick action popup. After finishing the task we are refreshing the record detail page, closing the popup and showing the toast message but the toast message is firing twice. how to avoid this ? We just need one notification message.

Here is my function from helper js.
updateRS : function(component,event) {
        event.preventDefault();
        var currentOpptyId = component.get("v.recordId");
        console.log("currentOpptyId : " +currentOpptyId);;
        var pushmonth = component.get("v.PushMonth");
        console.log("pushmonth : " +pushmonth);
        var action = component.get("c.pushrs");
        action.setParams({
            "currentOpptyId":currentOpptyId,
            "pushmonth" : pushmonth
        });
        action.setCallback(this, function(response) {
            var state = response.getState();
            if (state === "SUCCESS"){
                var toastEvent = $A.get("e.force:showToast");
                $A.get('e.force:refreshView').fire();
                
                toastEvent.setParams({
                    "title": "Success!",
                    "message": "Success!",
                    type: 'success',
                   // mode: 'pester'
                });
                toastEvent.fire();
                $A.get('e.force:closeQuickAction').fire();
            }
            else{
                alert('Pushing Revenue Schedule Period is not successful');
            }
        });
        $A.enqueueAction(action); 
    },

closeactionhelper : function(component,event) {
        setTimeout(function(){
            	var action = $A.get("e.force:closeQuickAction").fire(); 
		}, 1000);
}



Thanks,
Anupama
 
I have written a trigger on case object having before update and after update as it's events.
In Before update : Where user selects any value of "Assignment Group", based on that Case owner will get update to that particular Queue.
In After Update : Whenever Case owner changes to Queue, this event will perform auto assignment of case to queue members. Till this trigger is working as expected.
But issue occurs, when user wants to update any field on that case and save it AFTER UPDATE logic executes and case owner changed to new queue member of same queue. Assignment Group is same but case owner keeps on changing whenever user updates any value on case.

Trigger Code :
 
trigger caseOwnerUpdate on Case (before insert,before update,after update) 
{
    
   
  // 1.[Based on assignment group selection change the case owner] 
   
	if(Trigger.isBefore && Trigger.isUpdate)
    {
        System.debug('entered if condition');
		
        for(Case c : Trigger.new)
		{
       
            System.debug('Updating logic');
       	    List<Group> qid = [select Id from Group where Name = : c.Assignment_Group__c and Type = 'Queue'];
              for(Group g : qid)
                {
                    c.OwnerId = g.id;
                    System.debug('updated');
                }
        }        
    }
	
  // 2.based on assignment group(queue) perform autoassignment of case to queue members
   if(Trigger.isAfter && Trigger.isUpdate)
   {
	   
    List<Case> updateCS = new List<Case>();
    Map<Id,Case> cases = new Map<Id,Case>();
    
    for (Case cs : Trigger.new)
    {
        if(Trigger.isUpdate) {  
            System.debug('>>>>> Owner ID: '+cs.ownerId+' Temp Owner ID: '+cs.TempOwnerId__c);
            if(cs.TempOwnerId__c <> null && cs.TempOwnerId__c <> '') {
                if(cs.OwnerId <> cs.TempOwnerId__c) {
                    cases.put(cs.id,cs);
                }
            }           
        }   
    }
    if (cases.isEmpty()) return;
    
    for (Case cs : [SELECT OwnerId,TempOwnerId__c FROM Case WHERE id in :cases.keySet()]) {
        cs.OwnerId = cases.get(cs.Id).TempOwnerId__c;
        cs.TempOwnerId__c = 'SKIP'; //flag to stop infinite loop upon update
        updateCS.add(cs);
    }
    System.debug('>>>>>Update Cases: '+updateCS);
    
    //
    //Update last assignment for Assignment Group in batch
    //
    if (updateCS.size()>0) {
        try {
            update updateCS;
        } catch (Exception e){

        }
    }

   }
	
   // Entitlement
	if((Trigger.isBefore && Trigger.isUpdate)||(Trigger.isBefore && Trigger.isInsert))
    {       
    /*
   If the Entitlement Name is not set then, check to see if the Contact on the Case has an active Entitlement
    and select the first one.  If not then check to see if the Account on the Case has an active Entitlement.
   */
   List<Id> contactIds = new List<Id>();
   List<Id> acctIds = new List<Id>();
   for (Case c: Trigger.new){
      if (c.EntitlementId == null && c.ContactId!= null && c.AccountId!= null){
         contactIds.add(c.ContactId);
         acctIds.add(c.AccountId);
      }
   }
   if(contactIds.isEmpty()==false || acctIds.isEmpty()==false){
      /* Added check for active entitlement */
      List <EntitlementContact> entlContacts = [Select e.EntitlementId,e.ContactId,e.Entitlement.AssetId From EntitlementContact e
                                                Where e.ContactId in:contactIds
                                                And e.Entitlement.EndDate >= Today And e.Entitlement.StartDate <= Today];
      if(entlContacts.isEmpty()==false){
         for(Case c: Trigger.new){
            if(c.EntitlementId == null && c.ContactId!= null){
               for(EntitlementContact ec:entlContacts){
                  if(ec.ContactId==c.ContactId){
                     c.EntitlementId = ec.EntitlementId;
                     if(c.AssetId==null && ec.Entitlement.AssetId!=null)
                        c.AssetId=ec.Entitlement.AssetId;
                     break;
                  }
               } // end for
            }
         } // end for
      } else{
         List <Entitlement> entls = [Select e.StartDate, e.Id, e.EndDate, e.AccountId, e.AssetId
                                     From Entitlement e
                                     Where e.AccountId in:acctIds And e.EndDate >= Today And e.StartDate <= Today];
         if(entls.isEmpty()==false){
            for(Case c: Trigger.new){
               if(c.EntitlementId == null && c.AccountId!= null){
                  for(Entitlement e:entls){
                     if(e.AccountId==c.AccountId){
                        c.EntitlementId = e.Id;
                        if(c.AssetId==null && e.AssetId!=null)
                           c.AssetId=e.AssetId;
                        break;
                     }
                  } // end for
               }
            } // end for
         }
      }
   } // end if(contactIds.isEmpty()==false)
        
    }
       
 // based on assignment group assign value to 3 fields 
    
     if(Trigger.isBefore && Trigger.isUpdate)
    {
      for(Case c : Trigger.new)
		{   
			if(c.Assignment_Group__c=='Tech Support'||c.Assignment_Group__c=='GD-IT'||c.Assignment_Group__c=='App-Support'||c.Assignment_Group__c=='GD-RM'||c.Assignment_Group__c=='GD-DB'||c.Assignment_Group__c=='Dev-Ops'||c.Assignment_Group__c=='App-Management'||c.Assignment_Group__c=='PDT-DS-Engg'||c.Assignment_Group__c=='PDT-US-Engg')
            {
                c.Group_Manager_Email__c = 'sgaware148@gmail.com'; c.Escalation_Level_2_Email__c ='sgaware148@gmail.com'; c.Escalation_Level_3_Email__c='sgaware148@gmail.com';
            }
        }
    }
    
    
}

Please suggest.
Hello,

I have converted my lead to Oportunity, contact and account.

How are they interlinked, If i need to query each of them from the others, what is the SOQL query, i can use

Thank in advance
Hi ,
While creating account,  what  are the parameters to be passed in request with REST api. 
Hi,all 
Please solve the problem my question is that 



if the upload the pdf in related list of the Aaacount object then status Approved how is it Possible?

thanks aklkk
  • January 23, 2019
  • Like
  • 0
Hi,
 
[{"Name": "US-0000314","Project":"TestPOC","Release":"Dec-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000312","Project":"TestPOC","Release":"Dec-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000315","Project":"TestPOC","Release":"Dec-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000318","Project":"TestPOC","Release":"Dec-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000313","Project":"TestPOC","Release":"Dec-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000317","Project":"TestPOC","Release":"Dec-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000320","Project":"TestPOC","Release":"Dec-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000316","Project":"TestPOC","Release":"Dec-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000322","Project":"TestPOC","Release":"Dec-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000319","Project":"TestPOC","Release":"Dec-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000321","Project":"TestPOC","Release":"Dec-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000324","Project":"TestPOC","Release":"Dec-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000328","Project":"TestPOC","Release":"Dec-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000335","Project":"TestPOC","Release":"Feb-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000337","Project":"TestPOC","Release":"Feb-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000329","Project":"TestPOC","Release":"Dec-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000330","Project":"TestPOC","Release":"Dec-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000336","Project":"TestPOC","Release":"Feb-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000332","Project":"TestPOC","Release":"Dec-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000331","Project":"TestPOC","Release":"Dec-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000334","Project":"TestPOC","Release":"Feb-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000333","Project":"TestPOC","Release":"Dec-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000342","Project":"TestPOC","Release":"Dec-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000344","Project":"TestPOC","Release":"Dec-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000345","Project":"TestPOC","Release":"Feb-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"},{"Name": "US-0000343","Project":"TestPOC","Release":"Feb-GGGG","Username":"AAA.g@ccc.com","Useremail":"AAA.g@BBB.com"}]

I want display the above JSON in below table format in Visualforce page. Please help me.

User-added image
Thanks and Regards,
Diwakar G

Hi All,

I am new to salesforce.
I have on requirment.When i click on "Show All leads" button on that time only records need to display with new page block.
Below are my code:
-----------------------------------
VF page
----------------------
<apex:page standardController="Lead" Extensions="DisplayingListofrecords_Controller">

<apex:form >
  <apex:pageBlock title="For buttons">
       <apex:commandButton action="{!ShowLeads}" value="Show Leads" reRender="Details"/>
  </apex:pageBlock>
</apex:form>
<apex:outputPanel id="Details">
<apex:actionStatus startText="Requesting............">
  <apex:pageBlock title="Displaying List of accounts" id="Showlistofleads" rendered="false">
    <apex:dataTable value="{!leadlist}" var="a" cellpadding="4" border="1">
        <apex:column >
              <apex:facet name="header">Name</apex:facet>
              {!a.Name}
        </apex:column>  
        <apex:column >
              <apex:facet name="header">Company</apex:facet>
              {!a.Company}
        </apex:column>  
        <apex:column >
              <apex:facet name="header">Status</apex:facet>
              {!a.Status}
        </apex:column>  
        <apex:column >
              <apex:facet name="header">Industry</apex:facet>
              {!a.Industry}
        </apex:column>  
        <apex:column >
              <apex:facet name="header">Email</apex:facet>
              {!a.Email}
        </apex:column>  
        <apex:column >
              <apex:facet name="header">LeadSource</apex:facet>
              {!a.LeadSource}
        </apex:column>  
        <apex:column >
              <apex:facet name="header">Lead Score</apex:facet>
              {!a.Lead_Score__c}
        </apex:column>          
    </apex:dataTable>
</apex:pageBlock>
</apex:actionStatus>
</apex:outputPanel>
</apex:page>
Controller
-------------------
public with sharing class DisplayingListofrecords_Controller {

    Public List<Lead> leadlist {get;set;}
    public DisplayingListofrecords_Controller(ApexPages.StandardController controller) {
     
   
    }
    
    public PageReference ShowLeads()
    {
         leadlist = [select Name,Company,Status,Industry,Email,LeadSource,Lead_Score__c from lead];
         
         return null;
    }

}
 
According to salesforce's standard functionality,while creating Case, Case gets assigned by Case Assignments Rules. If Case Assignment Rule fails, Case gets assigned to default Case Owner. I either do not want this. I want to assign the Case to the user mentioned in one of the fields on Case, which is dynamic. I have already tried with process builder and before insert trigger, but in both cases, Case gets assigned to default owner. Can someone suggest me any solution?
Hi Friends 
 I want to Insert Note under related list of Opportunity
 using Apex Code Script.
User-added image
Can Someone Please Help me to acheive this task.
Any help would be appreciated.
Hi, 
 
  I am confused with negative value adding in a condition This might be a simple question please suggestion 
  
   I need add below condition 
   Sales Ops  ==> [ Between 0.99 to 25 ] 
   CRO ==> [Between -10.01 to 0.00 ]
   CFO ==> [Between -10.00 to 25.01 ]
  
 I tried with below condition for some reason it does seems to be right Please suggest me how to add the range condition. 
   Decimal Dt = -12;
 
    If( Dt >= 0.99 && Dt <= 25.00){ 
        System.Debug('Sales Ops');
         }
    
    If( Dt >= -10.01 && Dt <= 0.00){ 
        System.Debug('CRO or SVP');    
         }
      
     if( Dt <= -10.00 && Dt >= 25.01){ 
        System.debug('CFO');
        }



Thanks
Sudhir





    


 
  • February 28, 2018
  • Like
  • 0

Hello,

Did anyone else notice that the view state limit in Visualforce pages has been increased from 135 to 170 KB in the new release of Spring 2019

Hi folks
All of our non-batch scheduled apex classes (where the limit is supposed to be 100 according to the documentation as we read it) suddenly started erroring out with Spring '15 saying the limit is 5. These are NOT batch jobs.  We have activated FlexQueue anyway. 
It appears others have found this issue. E.g. http://salesforce.stackexchange.com/questions/66607/scheduled-apex-limit-exceeded-spring-15

I tried making a case with SF but could not get past the standard support who pointed me to the batch limit documentation and flex queue. 

We'd be super grateful if anyone could tell us if:
1) SF recognizes this as a bug
2) If anything is being done about it
3) If there are known workarounds.

Thanks
Hi All,

I had scheduled around 22 Jobs till last Friday on on SF Org with different schedules. All these 22 jobs were visible in Scheduled Jobs Tab. Starting from this Monday(16th Feb 2015) I'm getting an Error : System.AsyncException: You have exceeded the maximum number (5) of Apex scheduled jobs when I try to schedule the same number of Jobs.
Its allowing only 5 Jobs to be submitted. 

Org might have been upgraded to Spring 2015 over the weekend. As per the Spring 2015 notes, we can use Apex Flex Queues to shcedule upto 100 Apex Jobs. We tried activating the Apex Flex Queue from Critical Updates section, but still the issue persists.

Need advise on what can be done to get the limit back to 100.
Hi there

This is weird..  Never thought I've encountered that before.  Is it new...?

The following code works, just as you would expect.

<apex:page standardController="account">
    <apex:repeat value="{!account.contacts}" var="CONTACT">
        <apex:outputField value="{!CONTACT.name}" />
    </apex:repeat>
</apex:page>

However, if I change the outputField to this (only hanged the apex:outputField line),

<apex:page standardController="account">
    <apex:repeat value="{!account.contacts}" var="CONTACT">
        <apex:outputField value="{!contact.name}" />
    </apex:repeat>
</apex:page>

I got this error mssage:
Error: Unknown property 'AccountStandardController.contact'

This is really against what I have believed for a long time that VF is case insensitive.

Has anyone else seen this before?

Note:  I originally had var="Contact".  My above code, var="CONTACT", is simply for illustrations.

Thanks
king

As many of you have discovered, our developer community is awesome. The wealth of knowledge here is phenomenal. This is an all volunteer community and people who take the time to help and post answers do so totally on their own initiative. With that said when someone provides the right answer to your question please take the time to mark their answer as the accepted solution. Also give them a kudos if they've really gone the extra mile to help out. Show some love ;)