• Newbie 2014
  • NEWBIE
  • 55 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 12
    Replies
Hello: Is there any way to display the state or zip or any other column in the company name 'drop down menu' as shown below? We have legitimate same name accounts in our CRM but in different locations. For example, in the figure below there are two 'white river credit union' one in VT, one in WA. We need to differentiate in the dorp down so the user can choose the right account. Would greatly appreciate some guidance. Thanks


new-contact-company-dropdown
In our CRM, we have multiple organizations (Accounts object) with exact same names that are located in different locations; so those duplicate names are legitimate. Now the problem is, we found that if we click “New Contact” from an Account that shares a name with another account, it may NOT assign it to the correct one.

So basically if the account name is a duplicate, SalesForce is showing a drop-down for account names rather than using the account where you clicked “New Contact” from. Then it is sorting the dropdown by some other columns so the selection (if you don’t change it) may not be the account we want.

Salesforce is supposed to use the account ids (instead of the text based names) to work correctly in our case. How can we fix the issue please?

Thank you very much in advance
Hello: Our salesforce CRM has huge amount of ActivityHistory records that are not in use anymore. Our storage limit almost exceeded and we need to purge those unused records ASAP. Some guidance on how to proceed will be life saver really!

I basically need to know HOW CAN I DELETE BUNCH OF RECORDS IF THE SOQL IS LIKE THIS: (SELECT id, subject from ActivityHistories where subject like 'opened email%' and  ownerid = '005600000019XBkAAM' AND lastmodifieddate < blah blah). Salesforce docs says activityhistory is a read-only object (http://www.salesforce.com/us/developer/docs/officetoolkit/Content/sforce_api_objects_activityhistory.htm), if so then how can I truncate the records then? Which tool to use and how?

Please note I tried few things as described below, but didn’t help.

1. I tried to pull activityhistory via excel connector to get the record ids but it kept failing due to internal server error with exception code 5103. I can pull other objects but not this one, not sure why. Feedbacks will be appreciated.

2. I tried to pull the same list of ids thru developer console but after some research found the only way to access the activityhistory object is a nested query format; I used the SOQL below:

SELECT (SELECT id, subject from ActivityHistories where subject like 'opened email%' and  ownerid = '005600000019XBkAAM') FROM Account limit 1000

But the output format I get is like [{“id”: 005600000019XBkAA”, “subject”:…}] which does not serve my purpose. All I need is a select statement returning two columns  - activityhistory.id and activityhistory.subject so that I know total number of rows. How to get the list list I need then?


Thanks very much in advance!
Hello: I need to delete some unused classes from production since it's preventing to deploy my new trigger. But when I googled, I see tons of steps involving force.com IDE. I am not familiar with JAVA at all, C# person. Still tried to download eclipse etc. but installation errored out saying i need java environment or somehting. So I have two questions:

1. Is it possible to delete the prod classes using some cloud based tools or anything on my sandbox? I saw in one place to delete the classes from the sandbox and deply the class directory.. but i don't see any option to include the directory in the outbound change set.. force.com ide allows the directory access only looks like

2. If force.com ide is my only way then I am clue less how many layer of things i have to install to have that up and in what sequence.. please advise.. I got 64 bit win 7 professional OS on my machine.

Looking forward to some directions for the expereinced developers. Thank you very much in advance
Hi: I wrote this simple test class below hardcoding with a id. I executed the select statments in query editor, returning 8 ids correctly. But when run the test class below and check logs, I see it is gettign 0 rows after execution. Can't figure out why that might happen. Any clue will be appreciate. Much thanks

--------
@isTest()
public class deleleteLineItem
{
static testmethod void unittest() {
   
List<opportunitylineitem> ol = new List<opportunitylineitem>();
ol = [select id from opportunitylineitem where opportunityid = '006m0000002IbCiAAK'] ;

for(opportunitylineitem o: ol){
delete o;}

}
}
Hello: I am trying to delete/insert from a test class and positive that the code is error free; my code can retrieve values (i.e. read) from the record I specify alright, but if I want to delete it (i.e. perform write operation), nothing happens! The test class passes, but no deletion happens. Feels like as if the test class has READ-ONLY permission only. Allow me to explain by looking as my code below:

@isTestDel(SeeAllData = True )
public class deleteAcc
{
static testmethod void unittest() {

delete [select id from account where id = '001m0000004Ey05AAC'];
}
}

Just to test something simple, I have hardcoded the id. From developer console if I execute the select statement above, it returns valid result. But when I try to delete the record, does not work. I have googled a whole lot and tried variations of the delete statement using Lists etc., no luck. Then tried to insert a record on the fly and delete the same, insertion didn’t happen to begin with but class ran fine. Tried to delete all records w/o specifying ids, didn't help. Then tried with different kind of objects, acocunts and opportunitylineitem; no luck.

All these leads me to believe my test class does not have write permission on the objects and I am clue less how to un-do that. Any help will be a life saver. Thanks very much
Hello: I have a simplest test class to delete a single record, code below. I have checked the select statement via 'query editor' in developer console; it returns a valid id. I just can't figure out why my delete statement does not work!  My class passes the test alright, but when I go and check the line item under the parent opportunity, I can see the line item is there unaffected. Please advise! Thanks very much



@istest
public class del1
{
static testmethod void unittest() {
 
List<opportunitylineitem> ol = [select id from opportunitylineitem where id =: '00km0000001WVUSAA4'] ;
delete ol;

}
}
Hello: I am new to apex coding, would greatly appreciate some help with the following problem:
In an “after delete” trigger on opportunitylineitem object I have to access the values or stored IDs for two lookup fields -  ‘opportunity” & “product2”. I can access all other field types like quantity, totalprice etc. using trigger.old, but for those lookup fields, I am getting NULLs. Here is my code:

trigger InvoiceLineItemDeletion on OpportunityLineItem (after delete) {

for (OpportunityLineItem o_l : trigger.old) {

      Opportunity parentOpportunity = o_l.Opportunity; \\ “o_l.Opportunity” returns NULL, please specify the correct format        
      Product2 product2Used = o_l.product2; \\ “o_l.product2” returns NULL

      String qty = o_l.quantity \\ “o_l.quantity” returns correct value
      String parentOpp = [select Name from opportunity where Id =: parentOpportunity.id].Name; \\One more question: is this the correct statement using
                                                                                                                                                                          \\ SOQL to access the parent opportunity name?
      String prodUsed = [select Name from Product2 where Id = :Product2Used.id].Name;
     ……
     …..
}     

      
Thanks very much in advance.
Hello: Our organization needs to track the deleted records for the standard objects in salesforce for some reason and we have been relying on the ‘isDeleted’ field for the info. Deleted records are supposed to be kept in place for 15 days with that flag turned on! But we came to notice that the “opportunity product” and “accountcontactrole” tables are removing the deleted records right away instead. I am sure some other tables behaving same way.
To simulate the situation, we added a new accountcontactrole via Salesforce frontend. Then pulled the table via excel connector to verify the new record is in place. Right after we hit the ‘del’ button on the ‘contact role’ section for that record to delete our new entry. As the last step, we exported the entire table from salesforce but did NOT find any trace of that newly created record with isDeleted=true. This proves that salesforce is not keeping the deleted ‘account contact role’ records in the table with isDeleted=true for 15 days until it is permanently taken off!

Please provide me with some insights re: the discovery if you know what’s going on here. Thank you very much
Hello: Is there any way to display the state or zip or any other column in the company name 'drop down menu' as shown below? We have legitimate same name accounts in our CRM but in different locations. For example, in the figure below there are two 'white river credit union' one in VT, one in WA. We need to differentiate in the dorp down so the user can choose the right account. Would greatly appreciate some guidance. Thanks


new-contact-company-dropdown
In our CRM, we have multiple organizations (Accounts object) with exact same names that are located in different locations; so those duplicate names are legitimate. Now the problem is, we found that if we click “New Contact” from an Account that shares a name with another account, it may NOT assign it to the correct one.

So basically if the account name is a duplicate, SalesForce is showing a drop-down for account names rather than using the account where you clicked “New Contact” from. Then it is sorting the dropdown by some other columns so the selection (if you don’t change it) may not be the account we want.

Salesforce is supposed to use the account ids (instead of the text based names) to work correctly in our case. How can we fix the issue please?

Thank you very much in advance
Hello: Our salesforce CRM has huge amount of ActivityHistory records that are not in use anymore. Our storage limit almost exceeded and we need to purge those unused records ASAP. Some guidance on how to proceed will be life saver really!

I basically need to know HOW CAN I DELETE BUNCH OF RECORDS IF THE SOQL IS LIKE THIS: (SELECT id, subject from ActivityHistories where subject like 'opened email%' and  ownerid = '005600000019XBkAAM' AND lastmodifieddate < blah blah). Salesforce docs says activityhistory is a read-only object (http://www.salesforce.com/us/developer/docs/officetoolkit/Content/sforce_api_objects_activityhistory.htm), if so then how can I truncate the records then? Which tool to use and how?

Please note I tried few things as described below, but didn’t help.

1. I tried to pull activityhistory via excel connector to get the record ids but it kept failing due to internal server error with exception code 5103. I can pull other objects but not this one, not sure why. Feedbacks will be appreciated.

2. I tried to pull the same list of ids thru developer console but after some research found the only way to access the activityhistory object is a nested query format; I used the SOQL below:

SELECT (SELECT id, subject from ActivityHistories where subject like 'opened email%' and  ownerid = '005600000019XBkAAM') FROM Account limit 1000

But the output format I get is like [{“id”: 005600000019XBkAA”, “subject”:…}] which does not serve my purpose. All I need is a select statement returning two columns  - activityhistory.id and activityhistory.subject so that I know total number of rows. How to get the list list I need then?


Thanks very much in advance!
Hello: I need to delete some unused classes from production since it's preventing to deploy my new trigger. But when I googled, I see tons of steps involving force.com IDE. I am not familiar with JAVA at all, C# person. Still tried to download eclipse etc. but installation errored out saying i need java environment or somehting. So I have two questions:

1. Is it possible to delete the prod classes using some cloud based tools or anything on my sandbox? I saw in one place to delete the classes from the sandbox and deply the class directory.. but i don't see any option to include the directory in the outbound change set.. force.com ide allows the directory access only looks like

2. If force.com ide is my only way then I am clue less how many layer of things i have to install to have that up and in what sequence.. please advise.. I got 64 bit win 7 professional OS on my machine.

Looking forward to some directions for the expereinced developers. Thank you very much in advance
Hi: I wrote this simple test class below hardcoding with a id. I executed the select statments in query editor, returning 8 ids correctly. But when run the test class below and check logs, I see it is gettign 0 rows after execution. Can't figure out why that might happen. Any clue will be appreciate. Much thanks

--------
@isTest()
public class deleleteLineItem
{
static testmethod void unittest() {
   
List<opportunitylineitem> ol = new List<opportunitylineitem>();
ol = [select id from opportunitylineitem where opportunityid = '006m0000002IbCiAAK'] ;

for(opportunitylineitem o: ol){
delete o;}

}
}
Hello: I am trying to delete/insert from a test class and positive that the code is error free; my code can retrieve values (i.e. read) from the record I specify alright, but if I want to delete it (i.e. perform write operation), nothing happens! The test class passes, but no deletion happens. Feels like as if the test class has READ-ONLY permission only. Allow me to explain by looking as my code below:

@isTestDel(SeeAllData = True )
public class deleteAcc
{
static testmethod void unittest() {

delete [select id from account where id = '001m0000004Ey05AAC'];
}
}

Just to test something simple, I have hardcoded the id. From developer console if I execute the select statement above, it returns valid result. But when I try to delete the record, does not work. I have googled a whole lot and tried variations of the delete statement using Lists etc., no luck. Then tried to insert a record on the fly and delete the same, insertion didn’t happen to begin with but class ran fine. Tried to delete all records w/o specifying ids, didn't help. Then tried with different kind of objects, acocunts and opportunitylineitem; no luck.

All these leads me to believe my test class does not have write permission on the objects and I am clue less how to un-do that. Any help will be a life saver. Thanks very much
Hello: I have a simplest test class to delete a single record, code below. I have checked the select statement via 'query editor' in developer console; it returns a valid id. I just can't figure out why my delete statement does not work!  My class passes the test alright, but when I go and check the line item under the parent opportunity, I can see the line item is there unaffected. Please advise! Thanks very much



@istest
public class del1
{
static testmethod void unittest() {
 
List<opportunitylineitem> ol = [select id from opportunitylineitem where id =: '00km0000001WVUSAA4'] ;
delete ol;

}
}
Hello: I am new to apex coding, would greatly appreciate some help with the following problem:
In an “after delete” trigger on opportunitylineitem object I have to access the values or stored IDs for two lookup fields -  ‘opportunity” & “product2”. I can access all other field types like quantity, totalprice etc. using trigger.old, but for those lookup fields, I am getting NULLs. Here is my code:

trigger InvoiceLineItemDeletion on OpportunityLineItem (after delete) {

for (OpportunityLineItem o_l : trigger.old) {

      Opportunity parentOpportunity = o_l.Opportunity; \\ “o_l.Opportunity” returns NULL, please specify the correct format        
      Product2 product2Used = o_l.product2; \\ “o_l.product2” returns NULL

      String qty = o_l.quantity \\ “o_l.quantity” returns correct value
      String parentOpp = [select Name from opportunity where Id =: parentOpportunity.id].Name; \\One more question: is this the correct statement using
                                                                                                                                                                          \\ SOQL to access the parent opportunity name?
      String prodUsed = [select Name from Product2 where Id = :Product2Used.id].Name;
     ……
     …..
}     

      
Thanks very much in advance.
Hello: Our organization needs to track the deleted records for the standard objects in salesforce for some reason and we have been relying on the ‘isDeleted’ field for the info. Deleted records are supposed to be kept in place for 15 days with that flag turned on! But we came to notice that the “opportunity product” and “accountcontactrole” tables are removing the deleted records right away instead. I am sure some other tables behaving same way.
To simulate the situation, we added a new accountcontactrole via Salesforce frontend. Then pulled the table via excel connector to verify the new record is in place. Right after we hit the ‘del’ button on the ‘contact role’ section for that record to delete our new entry. As the last step, we exported the entire table from salesforce but did NOT find any trace of that newly created record with isDeleted=true. This proves that salesforce is not keeping the deleted ‘account contact role’ records in the table with isDeleted=true for 15 days until it is permanently taken off!

Please provide me with some insights re: the discovery if you know what’s going on here. Thank you very much