• priyanka.mv26
  • NEWBIE
  • 109 Points
  • Member since 2012

  • Chatter
    Feed
  • 4
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 20
    Questions
  • 45
    Replies

Hi All,

 

I am new to salesforce platform. I know basic concepts of Apex and VisualForce. I practiced Blog application (http://www.forcetree.com/2009/08/building-blog-applicationwebsite-using.html).

 

I am interested to learn session concepts and advanced concepts.

 

Could you please suggest me some sample webapplications from scratch like registration page and login page.

 

Thanks & Regards,

Gangadhar

I am to Force.com ide Please give me solutions how to configure ide and run apex class

Hi,

I want to listen to updates in Salesforce for records integrated with another system which updates details via webhook. 

I think it can be done using below methods, please advise if this is correct approach or is there any better way. 
  • Using site & expose REST API (if unauthorized)
  • Use standard REST API/custom REST API(both requires Salesforce access/login) 
Are the platform events appropriate to this use case? Does this require Salesforce authentication?
Hi, 

I have setup a community for B2B partner users, and a custom object which has lookup to Contact & Account. The sharing set is enabled and provided to provide access to custom object records and the community is enabled with super user access and has only one role(as per SF recommendation to have lesser roles if possible). 

For example, I have a scenario where Account A is enabled as partner. It has 3 contacts Person A, B & C. All 3 users are partner users, User A has super user access. 

There are 5 records R1 to R5, all records are owned by internal users but shared to external users via sharing set. R1 is shared with Person A. R2,R3 is shared with Person B. R4, R5 shared with Person C. The users are able to see these records.

My issue here is, Since R1 is assigned with super user access he should be able to view records his peers(Person B&C) can see. However, he is unable to see it. 

Please advise what I am missing here. 
Which is best way to integrate slack and Salesforce for searching objects not supported via Salesforce Slack App. Most of the examples, I see it is the integration done via Heroku app for creating custom commands. 

What is the advantage of integrating via Heroku app. Is it possible for direct REST Web Service in Apex and invoke in from Slack?
When to prefer LWC over flows? What is the limitation of Salesforce flows. 
Hi,

I am invoking a login method api call and receving bearer token which is valid for 7 days. Is it possible for using the same token in multiple transaction? Or is it valid only for single SF transaction. If it can be used for multiple transaction without making login calls everytime, pls advise the best way to do it. 
While setting up community with case entitlements, the case milestone is not visible on Community login(case detail page). The user license used is 'Customer Community Plus'.

The entitlement & case milestone are working fine & displayed properly in Admin view.

But while logging in as community plus user, the case milestone clock is not visible via page layout setup.

As a workaround, tried to view it via VF page, which is working.

What is the step need to done to make the case milestone visible in Community login page via standard setup.

Admin View:
User-added image

Community View using VF page:​

User-added image
Hello,

I have a requirement where we have setup Email-to-Case setup. Our SLA is not based on stage of the case and not from start of the case to case closure. Instead, our SLA depends on time to reply for each email received for the case. 

For example, lets say, case has been created since an email is received, and lets say the SLA is 3 hours. then the clock to start once the case is created and should stop once the email is replied back. 

In case of 2 emails received on the same case, for ex., 9 AM and 11 AM, then the respective SLA is 12 noon & 1PM respectively. 

1. Is there any way to have dynamic multiple clocks based on number of emails not replied back? 

2. If the 1st point is not possible, is it possible to reset the clock once the 1st email is replied. For ex.,Until first email is replied,clock to show timer till 12 noon.  Once the first email is replied, the clock should start from the 2nd email received time and the clock to show the remaining time until 1PM. 

Is it possible or is there any way in salesforce where the SLA can be setup for each email received? Could you please advise if there is anye best way to achieve the solution.

Thanks a lot in advance. 

I wanted to create a lookup from Task/Event to another Event. Is it possible in Salesforce? If not, what could be the work around?

Basically wanted to track all the followup task or events created for a parent event.

There are emails associated with case object. Some of the users are getting Insufficient Privileges while clicking 'Reply' button but able to forward the emails only for some records.

The profile has read, edit, create, read all access to case. 

The records for which they are giving error, tried to gave Read Write access via manual sharing. Still the users are receving the error.

What could be the reason salesforce is not letting them to reply the email but forward.

Thanks a lot in advance. 

I have a Dashboard with two components. Each component has its own source report. These two components already has record count field based on certain filter criteria(given in the source report).

 

My requirement is to add another record count field to these Dashboard components based on another filter logic.

 

Is this possible? Or do I need to modify the report filter itself to new filter condition and get the single record count based on updated logic?

 

Thanks in advance

I have a managed field from a package. The requirement is such that I can not add this field to page layout. But when I create or clone a record some managed code throws the error that the particular field is required. Since it is not included in page layout, users can not set any value.

Is there any way I can set a default value for this field?

Thanks in advance.

I am trying to send an email from trigger using SingleEmailMessage.

 

As of now, I am composing my email body using the method setHTMLBody inside the trigger itself and the email recipients are user, contact and some hard-coded email address also.

 

My email has many recipients and I have some complex logic so i have to go for visualforce email template.

 

While i tried, I found the following points:

1. I have to use singleemailmessage only as i have to use VisualForce email template

2. More than one id cannot be added in the setTargetObjectId method so I cannot mail to more than one person.

3. Also if i use email template, i have to specify the recipient type as User/Lead/Contact but in my case I have to send email to user & contact & some email address. As of now, i am doing it using setToAddresses method.

 

Now, is it possible to replace the email body using VisualForce email template instead of composing it using setHTMLBody method?

I am adding cookie to my page in the controller using 

 

ApexPages.currentPage().setCookies(new Cookie[]{CookieName});

 

When am trying to get the code coverage, my test class is not covering the above line.

How to get the code coverage for the above setcookie method in the test class.

I am adding cookie to my page in the controller using 

 

ApexPages.currentPage().setCookies(new Cookie[]{CookieName});

 

When am trying to get the code coverage, my test class is not covering the above line.

How to get the code coverage for the above setcookie method in the test class.

What is the difference between LastModifiedDate and System ModStamp fields in Salesforce

I am facing the error 'Web service callout failed: Unable to parse callout response. Apex type not found for element storageList' but my WSDL file does not contain any element like StorageList.

 

The URL for my WSDL files are https://vault.netvoyage.com/ndApi/directory.aspx?WSDL and https://vault.netvoyage.com/ndApi/storage.aspx?WSDL.  

 

Please help. Thanks in advance..

I am trying to access NetDocuments API from Salesforce. 
I am not sure how do we maintain session between successive calls to API.
Please let me know if you could help me out.
Thanks in advance.

hi am posting my code here.. pls provide me the test class,, thanks a lot.. its urgent.. plssss

 

public with sharing class RelatedListController
{
private Account accnt;
public integer max{get; set;}
public boolean visible{get;set;}
public String alphabet{get; set;}
public string soql{get;set;}
public ApexPages.StandardSetController paginationController {get;set;}
private boolean IsFiltered;
public void passAlphabet()
{
alphabet= ApexPages.CurrentPage().getParameters().get('alphabet');
IsFiltered = true;
}
public RelatedListController(ApexPages.StandardController controller)
{
this.accnt = (Account)controller.getRecord();
}
public ApexPages.StandardSetController setCon
{
get
{
string query;
if(setcon == null || IsFiltered==true)
{
IsFiltered =False;
if(alphabet == 'A'|| alphabet == 'B' || alphabet == 'C' || alphabet == 'D'|| alphabet == 'E' || alphabet == 'F' || alphabet == 'G' || alphabet == 'H' || alphabet == 'I' || alphabet == 'J' || alphabet == 'K' || alphabet == 'L' || alphabet == 'M' || alphabet == 'N' || alphabet == 'O' || alphabet == 'P' || alphabet == 'Q' || alphabet == 'R' || alphabet == 'S' || alphabet == 'T' || alphabet == 'U' || alphabet == 'V' || alphabet == 'W' || alphabet == 'X' || alphabet == 'Y' || alphabet == 'Z')
{
/* some query */
}
else if(alphabet == 'Other')
{
/* some query */
}
else
{
/* some query */
}
setCon = new ApexPages.StandardSetController(Database.getQueryLocator(query));
max = setCon.getResultSize();
if(max > 20)
{
visible = true;
}
else
{
visible = false;
}
}
return setCon;
}
set;
}
public List<Inventor__c> getInventors()
{
return (List<Inventor__c>) setCon.getRecords();
}
public List<InvWrapper> getInventorsWithIndex()
{
List<Inventor__c> invs = this.getInventors();
List<InvWrapper> InvWrappered = new List<InvWrapper>();
Integer idex = 1;
for (Inventor__c inv : invs)
{
InvWrappered.add(new InvWrapper(inv, idex));
idex++;
}
return InvWrappered;
}
public class InvWrapper
{
public Inventor__c inv { get; set; }
public Integer tabIndex { get; set; }
public ApexPages.StandardSetController paginationController {get;set;}
public InvWrapper(Inventor__c inv, Integer tabIndex)
{
this.inv = inv;
this.tabIndex = tabIndex;
}
}
public Boolean hasNext
{
get
{
return setCon.getHasNext();
}
set;
}
public Boolean hasPrevious
{
get
{
return setCon.getHasPrevious();
}
set;
}
public Integer pageNumber
{
get
{
return setCon.getPageNumber();
}
set;
}
public void first()
{
setCon.first();
}
public void last()
{
setCon.last();
}
public void previous()
{
setCon.previous();
}
public void next()
{
setCon.next();
}
public void cancel()
{
setCon.cancel();
}
}

Which is best way to integrate slack and Salesforce for searching objects not supported via Salesforce Slack App. Most of the examples, I see it is the integration done via Heroku app for creating custom commands. 

What is the advantage of integrating via Heroku app. Is it possible for direct REST Web Service in Apex and invoke in from Slack?

Hello,

I have a list button that executes the below javascript function to open a new subTab in console :

if(sforce.console.isInConsole()){
    srcUp(url);
} else {
   window.location.href = url;
}


The problem is when in console when i click the button it redirects me to salesforce classic page for like 2 seconds and then go back to console application.

Note : My user is a service cloud user.

Thank you.

 

I have a managed field from a package. The requirement is such that I can not add this field to page layout. But when I create or clone a record some managed code throws the error that the particular field is required. Since it is not included in page layout, users can not set any value.

Is there any way I can set a default value for this field?

Thanks in advance.

Hi,

 

I am trying to integrate the mail chimp with salesforce. For this i have wrote the http callouts. I am getting the result in xml. But the xml result having more than one elements. How can i parse this and how can i display all fields in vf page.

 

I have wrote the program like this.

public class mailchimp1
{
public string body1{set;get;}
String from_name;
String from_email;
public void detail()
{
Http h = new Http();
HttpRequest req = new HttpRequest();
final string username = 'xxxxxx';
final string password = 'xxxxx';
Blob headerValue = Blob.valueOf(username + ':' + password);
String authorizationHeader = 'BASIC ' +EncodingUtil.base64Encode(headerValue);
req.setHeader('Authorization',authorizationHeader);
//req.setHeader('Content-length', '1753' );
req.setHeader('Host','http://us5.api.mailchimp.com/1.3/ ');
req.setHeader('Connection','keep-alive');
req.setHeader('Content-Type', 'application/xml;charset=UTF-8');
req.setMethod('GET');
//req.setbody('http://api.createsend.com/api/v3/clients.xml');
//req.setEndpoint('http://us5.api.mailchimp.com/1.3/ ');
req.setEndpoint('http://us5.api.mailchimp.com/1.3/?output=xml&method=campaigns&apikey=eb7d2ec8ba15120cc1115c44d32a35cd-us5&campaign_id=89405&list_id=90cdce872a&start=0&limit=1000');
HttpResponse res = h.send(req);
system.debug('********'+res.getbody());
body1=res.getbody();
Dom.Document doc = res.getBodyDocument();
//Retrieve the root element for this document.
Dom.XMLNode address = doc.getRootElement();
from_name= address.getChildElement('from_name',from_name).getText();
from_email = address.getChildElement('from_email',from_email).getText();
 // print out specific elements
    
        System.debug('Name== ' + from_name);
        System.debug('email=== ' + from_email);
        
        // Alternatively, loop through the child elements.
    
        // This prints out all the elements of the address
    
        for(Dom.XMLNode child : address.getChildElements()) {
           System.debug('c==='+child.getText());
        }
}
}

 

I am getting the result as

<MCAPI type="array">
<total type="integer">21</total>
<data type="array">
<struct key="0" type="array">
<id type="string">5bef810a37</id>
<web_id type="double">94233</web_id>
<list_id type="string">90cdce872a</list_id>
<folder_id type="double">0</folder_id>
<template_id type="double">0</template_id>
<content_type type="string">html</content_type>
<title type="string">testvf</title>
<type type="string">regular</type>
<create_time type="string">2012-09-07 10:09:42</create_time>
<send_time type="NULL" />
<status type="string">save</status>
<from_name type="string">lakshmi</from_name>
<from_email type="string">nagalakshmi_b@dskvap.com</from_email>
<subject type="string">testvf</subject>
<to_name type="string">lakshmi</to_name>
<archive_url type="string">http://eepurl.com/psBDz</archive_url>
<emails_sent type="integer">0</emails_sent>
<inline_css type="boolean" />
<analytics type="string">N</analytics>
<analytics_tag type="string" />
<authenticate type="boolean" />
<ecomm360 type="boolean" />
<auto_tweet type="boolean" />
<auto_fb_post type="string" />
<auto_footer type="boolean" />
<timewarp type="boolean" />
<timewarp_schedule type="NULL" />
<tracking type="array">
<html_clicks type="boolean">1</html_clicks>
<text_clicks type="boolean">1</text_clicks>
<opens type="boolean">1</opens>
</tracking>
<segment_text type="string">No segment used</segment_text>
<segment_opts type="array" />
<type_opts type="array" />
</struct>
<struct key="3" type="array">
<id type="string">69c9dd75ee</id>
<web_id type="double">93077</web_id>
<list_id type="string">90cdce872a</list_id>
<folder_id type="double">0</folder_id>
<template_id type="double">0</template_id>
<content_type type="string">html</content_type>
<title type="string">campaignthroughform</title>
<type type="string">regular</type>
<create_time type="string">2012-09-06 12:34:28</create_time>
<send_time type="NULL" />
<status type="string">save</status>
<from_name type="string">lakshmi</from_name>
<from_email type="string">nagalakshmi_b@dskvap.com</from_email>
<subject type="string">campaignthroughform</subject>
<to_name type="string">naga</to_name>
<archive_url type="string">http://eepurl.com/pdzrz</archive_url>
<emails_sent type="integer">0</emails_sent>
<inline_css type="boolean" />
<analytics type="string">N</analytics>
<analytics_tag type="string" />
<authenticate type="boolean" />
<ecomm360 type="boolean" />
<auto_tweet type="boolean" />
<auto_fb_post type="string" />
<auto_footer type="boolean" />
<timewarp type="boolean" />
<timewarp_schedule type="NULL" />
<tracking type="array">
<html_clicks type="boolean">1</html_clicks>
<text_clicks type="boolean">1</text_clicks>
<opens type="boolean">1</opens>
</tracking>
<segment_text type="string">No segment used</segment_text>
<segment_opts type="array" />
<type_opts type="array" />
</struct>
<struct key="4" type="array">
<id type="string">45d150a7e8</id>
<web_id type="double">93069</web_id>
<list_id type="string">90cdce872a</list_id>
<folder_id type="double">0</folder_id>
<template_id type="double">0</template_id>
<content_type type="string">html</content_type>
<title type="string">samplecamapign</title>
<type type="string">regular</type>
<create_time type="string">2012-09-06 12:29:16</create_time>
<send_time type="NULL" />
<status type="string">save</status>
<from_name type="string">lakshmi</from_name>
<from_email type="string">nagalakshmi_b@dskvap.com</from_email>
<subject type="string">samplecamapign</subject>
<to_name type="string">naga</to_name>
<archive_url type="string">http://eepurl.com/pdzrD</archive_url>
<emails_sent type="integer">0</emails_sent>
<inline_css type="boolean" />
<analytics type="string">N</analytics>
<analytics_tag type="string" />
<authenticate type="boolean" />
<ecomm360 type="boolean" />
<auto_tweet type="boolean" />
<auto_fb_post type="string" />
<auto_footer type="boolean" />
<timewarp type="boolean" />
<timewarp_schedule type="NULL" />
<tracking type="array">
<html_clicks type="boolean">1</html_clicks>
<text_clicks type="boolean">1</text_clicks>
<opens type="boolean">1</opens>
</tracking>
<segment_text type="string">No segment used</segment_text>
<segment_opts type="array" />
<type_opts type="array" />
</struct>
</data>
</MCAPI>

When i am executing the above code i am getting error as 'Attempt to de-reference a null object' . Please any one help me.

 

Thanks,

Lakshmi

Hi,

 

I have a simple update trigger that modify the references of object thread when a Case is updated. The test is successful in sandbox environment but I have a problem on the assertion when I try to deploy It on the server and the deploy fails. . 

Someone can help me?

 

Thanks

 

Following the code:

 

trigger AccountUpdate on Case (before update) {
     
    for (Case c: Trigger.new){
        Case oldCase = Trigger.oldMap.get(c.ID);
        
        if (c.AccountId != oldCase.AccountId || c.ContactId != oldCase.ContactId) {
            List<Thread__c> threadList = [SELECT Account__c FROM Thread__c WHERE Case__c= :c.id];
            
            if(!threadList.isEmpty()){
                for(Thread__c t: threadList){
                    System.debug('#### Aggiorno i Thread...con '+c.AccountId);
                    t.Account__c = c.AccountId;
                    t.Contact__c = c.ContactId;
                }
                update threadList;
            }
        }
    }
    
    
}

 

@isTest
private class TriggerTests {
  
    
   static testMethod void AccountUpdateTriggerTest(){
       
        Account acct = new Account(name='test account');
        Contact ct = new Contact(AccountId=acct.Id,lastname='testing',firstname='E2C');
        insert acct;
        insert ct;
       
        Case c = new Case();
        c.AccountId = acct.id;
        c.ContactId = ct.id;
        insert c;
        
       List<Thread__c> threadList = new List<Thread__c>();
       for(Integer i=0; i<5; i++){
            Thread__c t = new Thread__c();
            t.Case__c = c.id;
            t.Account__c = c.AccountId;
            t.Contact__c = c.ContactId;
            threadList.add(t);
        }
        insert threadList;
       
        Account acct1 = new Account(name='test account nuovo');
        Contact ct1 = new Contact(AccountId=acct1.Id,lastname='testing_nuovo',firstname='E2C_nuovo');
        insert acct1;
        insert ct1;
        
        c.AccountId = acct1.id;
        c.ContactId = ct1.id;
        update c;
        
        threadList = [SELECT Account__c,Contact__c FROM Thread__c WHERE Case__c= :c.id];
        for(Thread__c th : threadList){
            System.assertEquals(c.AccountId,th.Account__c);
            System.assertEquals(c.ContactId,th.Contact__c);
        }
    } 

}
    

 

Hi guys,

Am  stuck here and I really need your help.

I have two custom objects Jobs__c and Shortlists__c.

Jobs__c is the Parent object and Shortlists__c is the child object.

 

Each Job can have many shortlists. Now what I want is to write a query will retrieve Job Name with corresponding number of shortlists

 

 

E.g.

 

______________________
Job Name       No.Shortlists
______________________
J2ee                 10           

______________________

  • August 27, 2012
  • Like
  • 0

I have a page that is giving the user the option to add line items to a catalog order. I'm able to display the catalog items, my debug code is showing that the setter is getting the integer entered into the input field, but either no line items get added or all items are added, not just the ones that have a value entered in the field.  I'm not seeing the issue and am hoping that the community sees something I"m missing. 

 

Here is my controller: 

public with sharing class selectableProduct {

    public Material_Order__c record;
    public Integer amount{get; set;}
    public Product_vod__c prod{get;set;}
    public List<Product_vod__c> productList=new List<Product_vod__c>();
    public List<Material_Order_Line_Item__c> linesToAdd=new List<Material_Order_Line_Item__c>();

    //set current material order in focus
    public selectableProduct(ApexPages.StandardController stdController){
        record = [SELECT id, Name, Date__c, Status__c, Notes__c
                    FROM Material_Order__c 
                    WHERE id =:ApexPages.currentPage().getParameters().get('id')];

    }
    
    //get list of available products to order
    public List<Product_vod__c> getProductList(){
        productList = [SELECT id, Name, Image__c FROM Product_vod__c WHERE Product_Type_vod__c = 'Order' ORDER BY Name ASC];
        return productList;
    }
    
    public Integer getAmount(){
        return amount;
      }
   public void setAmount(Integer a){
       this.amount = a;
       }
    
    //set amounts of selected items and insert line items on material order
    public pageReference placeOrder(){
    
        pageReference orderQtys = new PageReference('/'+record.id);
 
        for(Product_vod__c ps : productList){

            Material_Order_Line_Item__c newLine = new Material_Order_Line_Item__c();
          
           if((amount != NULL) || (amount != 0)){
            newLine.Products__c = ps.id;
            newLine.Quantity__c = amount;
            newLine.Material_Order__c = record.id;

            linesToAdd.add(newLine);
            }
        }
        insert linesToAdd;
        return orderQtys;
    }
    
}

 

And here is the VF Code: 

<apex:page standardController="Material_Order__c" extensions="selectableProduct">
<apex:form >
<apex:pageBlock title="Products">
  <apex:pageBlockButtons >
    <apex:commandButton action="{!placeOrder}" value="Submit"/>
  </apex:pageBlockButtons>
<apex:pageBlockSection title="Available Line Items" columns="1">
  <apex:dataTable value="{!productList}"  var="prod" width="95%" cellpadding="5">
    <apex:column width="10%" headerValue="Amount">
      <apex:facet name="header"/>
      <apex:inputText value="{!amount}"/>
    </apex:column>
    <apex:column width="20%">
      <apex:facet name="header">Product</apex:facet>
      <apex:outputText value="{!prod.Name}"/>
    </apex:column>
    <apex:column width="70%">
      <apex:facet name="header">Image</apex:facet>
      <apex:outputField value="{!prod.Image__c}"/>
    </apex:column>
  </apex:dataTable>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 

Thanks for your help in advance!

JoAnn

What is the difference between LastModifiedDate and System ModStamp fields in Salesforce

hi every one,
     I am trying to implement a google chart using group by post code and status. my requirement is to group it by postcode where i do have a lot of post codes and its firing an error "Too Many Soql Queries-101".code error is indicated in red.

my code goes like this:-
 
public class columntest {
 public String getChartData()
{
 return chartData;
}
 public columntest()
{
userid = userinfo.getuserid();
       u = [Select ContactId, Id, Name from User u  where Id =: userid];
       System.Debug('ContactId :' +u.ContactId);
       ctid = u.ContactId;            
       c = [select Account.Id, Id  from Contact where id =: ctid];       
       acct = [Select id, Corporate_Customer__c from account where id =: c.Account.Id];       
       aid = c.Account.Id;       
       corporateid = acct.Corporate_Customer__c;
for(Custom_report__c r:[SELECT id,Postcode__c FROM Custom_report__c where Postcode__c != null and Account_LandLord_Id__c=:corporateid])
 {
   string test1 = string.valueof(r.Postcode__c);
    if(citymap.get(test1)==null)
    {
      list1.add(r);
      citymap.put(test1,test1);
     }
  }     
 //obtain a list of picklist values
 Schema.DescribeFieldResult F = Custom_report__c.status__c.getDescribe();
 List<Schema.PicklistEntry> P = F.getPicklistValues();
 //where chart data should be stored.
 List<ChartDataItem> items = new List<ChartDataItem>();
 //iterate through each picklist value and get number of accounts
integer k=0;
for(Custom_report__c c: list1)
{
 st[k]= c.postcode__c;
 k++;
}
for(integer m=0; m<st.size();m++)
{
 if(st[m]!=null)
 size++;
}
 for(integer i=0; i<size;i++)
 {
  post = st[i];
 postCount = [select count() from Custom_report__c  where Account_LandLord_Id__c =: corporateid and Postcode__c =: post ];
 if (postcount>0)
 postsize +=1;
 }
 for(Schema.PicklistEntry pValue : P)
 {
    if(corporateid != null)
  {
    for(integer i=0; i<postsize;i++)
 {
  post = st[i];
    Count = [select count() from Custom_report__c  where status__c = :pValue.getValue() and Account_LandLord_Id__c =: corporateid and Postcode__c =: post];   
     if (Count > 0)
      items.add(new ChartDataItem(pValue.getValue() , Count.format()));
   else
     items.add(new ChartDataItem(pValue.getValue() , Count.format()));
  }
  }
    else
    {
    Count = [select count() from Custom_report__c where status__c = :pValue.getValue() and AccountId__c =: aid  ];
    if (Count > 0)
      items.add(new ChartDataItem(pValue.getValue() , Count.format()));
    else
     items.add(new ChartDataItem(pValue.getValue() , Count.format()));
    }  
 }
 
Thanks in Advance,
Newbie

hi,

              Am trying to make the class dynamic..am getting error at parentQuery...getting unexpected token: 'Project__c'  in which 

Project__c is parent name in the query...

 

 

string parentQuery = 'SELECT Id FROM ' + parentName + ' where id=\'' + parentID + '\'';
 SObject ParentObject = Database.query(parentQuery)[0];

 

thanks in advance...

  • August 03, 2012
  • Like
  • 0

Hi all ,

 i want to display all the contact fileds in vf apge.for example When click and drage the firstname in contact field then automatilclly text field appears in the vf page.Any one can u please help me this.

 

 

Thanks in advance

anu.............

Hi, everyone

 

I need your help to understand and fix this problem:

I built an apex text class in a sandbox environment (i'm using eclipse) but when I run this apex test class I'm getting this error: System.QueryException: List has no rows for assignment to SObject. The problem is that the object really has records both in sandbox and in production environment !!!! I run that query in Force.com Explorer, salesforce.shema Explorer, etc. and there I can see the existing records but in the test all the time throws that error... Could anyone please guide me why is it happening and how can it be fixed?

I had to write a record type  in a test class.What i did was I hard coded the record type id.Is is this a proper way or is there any alternate way to do it

 

 

Example

 

RecordTypeId='47uyfkfkhs65fufdu'

 

 

Is hard coding a record type a good practice

Any ideas as to what a SerializationException is? I could not find anything in the documentation.

Code:
Force.com Sandbox

Apex script unhandled exception by user/organization: 00550000000rTQA/00DT0000000EwRY

Visualforce Page: /apex/approveDealReg

System.SerializationException: Not Serializable: System.Savepoint

Class.approveDealRegVF.geterror: line 99, column 13

Debug Log:
***Begining Page Log for /apex/approveDealReg

Element j_id7 called method {!save} returned type PageReference: none20080610195821.020:Class.approveDealRegVF.getforwardOpp: line 76, column 16:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:External entry point:     returning SOBJECT:Split_Credit__c from method public SOBJECT:Split_Credit__c getforwardOpp() in 0 ms
20080610195821.020:External entry point:     returning SOBJECT:Opportunity from method public SOBJECT:Opportunity getexpirationDate() in 0 ms
20080610195821.020:External entry point:     returning SOBJECT:Task from method public SOBJECT:Task getreminderTask() in 0 ms
20080610195821.020:External entry point:     returning SOBJECT:Split_Credit__c from method public SOBJECT:Split_Credit__c getISR() in 0 ms
20080610195821.020:External entry point:     returning SOBJECT:Split_Credit__c from method public SOBJECT:Split_Credit__c getAE() in 0 ms
20080610195821.020:External entry point:     returning SOBJECT:Split_Credit__c from method public SOBJECT:Split_Credit__c getPBM() in 0 ms
20080610195821.020:External entry point:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:Class.approveDealRegVF.getshowRegApproval: line 172, column 16:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:Class.approveDealRegVF.getshowRegApproval: line 172, column 65:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:External entry point:     returning Boolean from method public Boolean getshowRegApproval() in 0 ms
20080610195821.020:Class.approveDealRegVF.getShowFowardApproval: line 180, column 16:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:Class.approveDealRegVF.getShowFowardApproval: line 180, column 65:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:External entry point:     returning Boolean from method public Boolean getShowFowardApproval() in 0 ms
20080610195821.020:External entry point:     returning Boolean from method public Boolean getdisableAccount() in 0 ms
20080610195821.020:External entry point:     returning Boolean from method public Boolean getShowContact() in 0 ms
20080610195821.020:External entry point:     returning Boolean from method public Boolean getreminder() in 0 ms
20080610195821.020:Class.approveDealRegVF.getAccounts: line 201, column 43:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:Class.approveDealRegVF.getAccounts: line 201, column 92:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:External entry point:     returning LIST:System.SelectOption from method public LIST:System.SelectOption getAccounts() in 0 ms
20080610195821.020:External entry point:     returning String from method public String getaccountMergeID() in 0 ms
20080610195821.020:External entry point:     returning LIST:System.SelectOption from method public LIST:System.SelectOption getTerritories() in 0 ms
20080610195821.020:External entry point:     returning String from method public String getTerritoryID() in 0 ms
20080610195821.020:External entry point:     returning String from method public String getprimaryContact() in 0 ms
20080610195821.020:External entry point:     returning String from method public String getbody() in 0 ms
20080610195821.020:External entry point:     returning from end of method public void setaccountMergeID(String) in 0 ms
20080610195821.020:External entry point:     returning Boolean from method public Boolean getShowContact() in 0 ms
20080610195821.020:External entry point:     returning SOBJECT:Opportunity from method public SOBJECT:Opportunity getexpirationDate() in 0 ms
20080610195821.020:External entry point:     returning from end of method public void setReminder(Boolean) in 0 ms
20080610195821.020:External entry point:     returning Boolean from method public Boolean getreminder() in 0 ms
20080610195821.020:External entry point:     returning from end of method public void setTerritoryID(String) in 0 ms
20080610195821.020:External entry point:     returning SOBJECT:Split_Credit__c from method public SOBJECT:Split_Credit__c getISR() in 0 ms
20080610195821.020:External entry point:     returning SOBJECT:Split_Credit__c from method public SOBJECT:Split_Credit__c getAE() in 0 ms
20080610195821.020:External entry point:     returning SOBJECT:Split_Credit__c from method public SOBJECT:Split_Credit__c getPBM() in 0 ms
20080610195821.020:External entry point:     returning from end of method public void setprimaryContact(String) in 0 ms
20080610195821.020:External entry point:     returning from end of method public void setbody(String) in 0 ms
20080610195821.020:Class.approveDealRegVF.save: line 353, column 16:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:Class.approveDealRegVF.save: line 357, column 16:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:Class.approveDealRegVF.save: line 357, column 66:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:Class.approveDealRegVF.save: line 357, column 115:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:Class.approveDealRegVF.save: line 363, column 26: Creating savepoint: SavepointValue0
20080610195821.020:Class.approveDealRegVF.save: line 380, column 51: SOQL query with 3 rows finished in 9 ms
20080610195821.020:Class.approveDealRegVF.save: line 385, column 13: SelectLoop:LIST:SOBJECT:User
20080610195821.020:Class.approveDealRegVF.save: line 400, column 20:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:Class.approveDealRegVF.save: line 400, column 69:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:Class.approveDealRegVF.save: line 410, column 34:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:Class.approveDealRegVF.save: line 417, column 20:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:Class.approveDealRegVF.save: line 417, column 69:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:Class.approveDealRegVF.save: line 435, column 54: Database.convertLead(Database.LeadConvert)
20080610195821.020:Class.approveDealRegVF.save: line 435, column 54:     DML Operation executed in 7 ms
20080610195821.020:External entry point:     returning System.PageReference from method public System.PageReference save() in 23 ms
20080610195821.020:External entry point:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:Class.approveDealRegVF.getshowRegApproval: line 172, column 16:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:Class.approveDealRegVF.getshowRegApproval: line 172, column 65:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:External entry point:     returning Boolean from method public Boolean getshowRegApproval() in 1 ms
20080610195821.020:External entry point:     returning SOBJECT:Opportunity from method public SOBJECT:Opportunity getexpirationDate() in 0 ms
20080610195821.020:Class.approveDealRegVF.getShowFowardApproval: line 180, column 16:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:Class.approveDealRegVF.getShowFowardApproval: line 180, column 65:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:External entry point:     returning Boolean from method public Boolean getShowFowardApproval() in 1 ms
20080610195821.020:Class.approveDealRegVF.getAccounts: line 201, column 43:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:Class.approveDealRegVF.getAccounts: line 201, column 92:     returning SOBJECT:Lead from method public SOBJECT:Lead getsourceLead() in 0 ms
20080610195821.020:External entry point:     returning LIST:System.SelectOption from method public LIST:System.SelectOption getAccounts() in 0 ms
20080610195821.020:External entry point:     returning Boolean from method public Boolean getdisableAccount() in 0 ms
20080610195821.020:External entry point:     returning String from method public String getaccountMergeID() in 0 ms
20080610195821.020:External entry point:     returning Boolean from method public Boolean getShowContact() in 0 ms
20080610195821.020:External entry point:     returning Boolean from method public Boolean getreminder() in 0 ms
20080610195821.020:External entry point:     returning String from method public String geterror() in 0 ms

 


 



Message Edited by TehNrd on 06-10-2008 01:11 PM