• SJTECH2009
  • 24 Points
  • Member since 2009

  • Chatter
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
  • 13

I'm a little new, so this might be simple, but I've searched around in docs and can't find it


I've got a custom field that uses a date field type and I want to switch it to a checkbox format for reporting purposes.  When I got to switch it, it says that it can't because that field is being referenced by 4 workflow rules and 20-25 tasks.  I don't care if I lose the data currently associated with the field.  Is there a way to switch this over easier?

i  keep on getting the error when ever i change the case owner to Queue.  case object linked to CustomObject PortalCase__c .This Object is Replica of Case object . Case owner is lookup field in both objects where user and queue can be owners. for user it is working perfectly.


please help me.


Thanks & Regards,


Message Edited by SJTECH2009 on 12-09-2009 01:12 AM
Message Edited by SJTECH2009 on 12-09-2009 01:12 AM

I am trying to write my first Apex test class and am running into problems. When I test the code I am receiving one test failure and am getting the following the error message:


System.QueryException: List has no rows for assignment to SObject

 Stack Trace:

Class.testTriggerUpdateOppRevised5.UpdateOppRevisedTest: line 6, column 10 External entry point 


Here is my test class code:



@isTestprivate class testTriggerUpdateOppRevised5 { static testMethod void UpdateOppRevisedTest() { Task t = new task (subject='Generate Re-Quote'); t = [select Id, subject from Task where id = :t.id]; system.debug(t.subject); system.assertEquals('Generate Re-Quote',T.Subject); //Setup User User u1 = [select id from user where alias = 'auser']; //Run as U1 System.RunAs(u1) {List<Generate_Re_Quote__c> deleteName = new List<Generate_Re_Quote__c>(); //Clean up data System.debug('Setting up testing - deleting any mileage records for ' +UserInfo.getUserName() + ' from today'); deleteName = [SELECT Name from Generate_Re_Quote__c WHERE createdDate = TODAY and createdById = :u1.id]; if(!deleteName.isEmpty()) { delete deleteName; }System.debug('Inserting TestGenerate... (single record validation)'); Generate_Re_Quote__c testName = new Generate_Re_Quote__c(name = 'Robert', Requested_Date_To_Complete_Re_Quote__c = date.parse('12/12/2008'), Opportunity_Name__c = 'Test', What_Needs_to_be_re_Quoted__c = 'nothing' ); insert testName; //validate single insert /*for (Generate_re_Quote__c grq:[select Opportunity_Name__c FROM Generate_Re_Quote__c WHERE createdDate = TODAY and createdByid = :u1.id and Requested_Date_To_Complete_Re_Quote__c != null]);*/ //{grq != null; // System.assertEquals(grq !=null); //end RunAs(u1)*/ // validate single insert }}}


 Here is my  Apex Trigger the code is testing:



trigger UpdateOppRevised5 on Generate_Re_Quote__c(Before Insert, Before Update){ Set<Id> oppIds = new Set<Id>(); for(Generate_Re_Quote__c g : trigger.new){ System.debug('**** 0 opp id : '+g.Opportunity_Name__c); oppIds.add(g.Opportunity_Name__c); } System.debug('****1 : Opp Id size '+ oppIds.size()); List<OpportunityTeamMember> Otms = [Select id, opportunityid, TeamMemberRole,UserId from OpportunityTeamMember where OpportunityId in:oppIds and TeamMemberRole = 'Product Specialist']; System.debug('****2 : Otms size '+ oppIds.size()); if (Otms.size() > 0) { List<Task> tasks = new List<Task>(); Map<id, OpportunityTeamMember> mOtms = new map<id, OpportunityTeamMember>(); for(OpportunityTeamMember o: Otms) { mOtms.put(o.opportunityid, o); } //Loop through the records and create a task //Loop through the records and create a task id userid; for(Generate_Re_Quote__c g : trigger.new){ userid= mOtms.get(g.Opportunity_Name__c).UserId; system.debug('UserId: ' + userid); Task t = new Task(whatID =trigger.new[0].Opportunity_Name__c, ActivityDate=trigger.new[0].Requested_Date_To_Complete_Re_Quote__c, Description=trigger.new[0].What_needs_to_be_Re_quoted__c, subject='Generate Re-Quote', ownerid= userid); Database.DMLOptions dmlo = new Database.DMLOptions(); dmlo.EmailHeader.triggerUserEmail = true; database.insert(t, dmlo); Tasks.add(t); } }}


What am I missing in the test class and can anyone help me with a code sample?


Thank you very much. 


Hello All.


I have a some question(s) regarding Field Level Accessibility:


1. My goal is to add a field to an object (eg. Account should hold a udf "NumberOfInteractions"). I want that the field should only be available to certain applications within Salesforce (eg a custom application - ResumeApp). I have attempted to do as mentioned above but the field is always visibl/accessable from other appliations as well. I want to hide the field in applications where its not needed. It will be used in both the force.com and the Apex/VisualForce pages I am building. 


2. How do I share my profile with other members of my team, where by in my absense another member can have read/write access to the data in my profile without having to log into my profile.


Your help will be greatly appeciated. Thanks





I am currently formatting a currency manually for a class which is not intended to be displayed on a SF page, hence cannot use apex.output* objects. (It is being used in an email that is "built" in the class.)  This is not allowing me to use any of SF wizardry ... is there a method that will allow me to include a format string to convert the Decimal value that will use the current locale settings?  (Is 123456.78 displayed as 123,456.78 or 123.456,78?)   If not, then how about a format string that will allow me to indicate I want 2 decimal places?  (I can get the commas using


But it doesn't display the .00 at the end.)






Message Edited by VanyaR on 12-31-2009 05:19 AM
  • December 31, 2010
  • Like
  • 0

Hi ,

   In my organization we are heavily using  customer portal and Partner portal. Inside the partner portal I need to show two tabs 1.Partner accounts(for viewing all the subsequent partners of current partner) and 2.Customer Accounts(for viewing all the subsequent customers of current partner). Can anyone suggest me how to achieve this ? If at all it can be done.


Thanking you



How can I associate a contact with more than one account? I am using the developer edition.


Instead of


contact.AccountId = strAccountId;


I need


contact.AccountId[0] = strAccountId1;
contact.AccountId[1] = strAccountId2;





Im trying to do a list of the top 10 contact rows. Is it possible to select TOP10 or something similar?

Is there a referece document of the SQL syntax or is it standard SQL?



This is the class im experimenting with.


public with sharing class RepeatCon {

    List<Contact> pos = [SELECT TOP10 Id, Name FROM Contact];

    public List<Contact> getPos() {
        return pos;



Note that i dont know much about APAX yet.

I feel a need of control,something lke datagrid in salesforce so that i can fill the datagrid from database,make changes and again using loops save all the data once.


Is there any control or functionality provided by salesforce.





  • December 09, 2009
  • Like
  • 0

I have the following trigger on a Task... it works fine when entering one task at a time. 

However, when I send out mass emails, the activity is logged, but the trigger doesn't fire?


I read an older post that stated mass emails will not fire the triggers...

Is there a way to get the trigger to fire when a mass email is sent...


Below is the trigger...


trigger updatelastemail on Task (after insert) {
  Task t = Trigger.new[0];
  if(t.WhoId != null) {
    Lead l = [select Id, LastEmail__c from Lead where Id=:t.WhoId];
    if(l != null) {
      l.LastEmail__c = t.Email_Number__c;
      update l;


Any suggestions will be greatly appreciated.



When creating a custom report using the Matrix Report layout, you can only go two levels in when you specify your row headings (subtotal by...... and then by...).  I need to go three and possibly four levels down for the reports we need to create.  I need to use the Matrix Report layout since it uses the "Specify your column Headings" section.


Is there a way to get this done?  Are there settings in the salesforce.com site that would allow me to go to this level of detail for the reports we need to create?




Todd Kruse 

I am trying to create a report that will show only Opp. that had a certain stage in their History. In addition, I want to show some details of those Opp. ACCOUNT.
Message Edited by roeyg on 12-07-2009 01:10 AM
  • December 07, 2009
  • Like
  • 0

 Hi there!


I have a entry form containing


customer Name      lookup relationship

item name              lookup relationship

month                    combo having month frm jan to dec

forecast qty            text field


i made some entries and then created UI page with following code:


<apex:page standardController="Forecast_Entry__c" extensions="ForecastEntryExtension" > <h1>Sales Forecast</h1> <apex:pageBlock > <apex:pageBlockSection title="Forecast Records"> <apex:dataTable value="{!ForecastRecords}" var="Forecastentry" styleClass="list"> <apex:column > <apex:facet name="header">Customer Name</apex:facet> <apex:outputField value="{!Forecastentry.Customer_Name__c}"/> </apex:column> <apex:column > <apex:facet name="header">Item Name</apex:facet> <apex:outputField value="{!Forecastentry.Item_Name__c}"/> </apex:column> <apex:column > <apex:facet name="header">Month</apex:facet> <apex:outputText value="{!Forecastentry.Month__c}"/> </apex:column> <apex:column > <apex:facet name="header">Forecast Qty </apex:facet> <apex:outputText value="{!Forecastentry.Forecast_Qty__c}"/> </apex:column> <apex:column > <apex:facet name="header">Contact Name </apex:facet> <apex:outputField value="{!Forecastentry.Contact__c}"/> </apex:column> </apex:datatable> </apex:pageBlockSection> </apex:pageBlock> <apex:detail ></apex:detail> <apex:detail subject="{!Forecast_Entry__c.Customer_Name__c}" relatedList="false" /> </apex:page>

its displays somewhat like dis :


Customer Name      Item Name   Month   Forecast Qty


abc                          pqr               jan09      1200

cde                          xyz              jan09       1500

cde                          xyz              feb09       1700

cde                          mno             jan09       2100

efg                           mno            mar09       900



 But i want to summarize the data based on distinct month horizontally and forecast qty below to it as shown   below:



Customer Name    Item Name     Jan09          Feb09             Mar09

 abc                         Pqr               1200       

 cde                         xyz               1500          1700

 cde                         mno              2100

 efg                          mno                                                       900

 I want the column header should be dynamic and automatically set as per distinct month available in table data during page display. say here it showing jan09 to mar 09 but sometime it can jan09 to feb09 only or  sometime jan09 to oct09 or sooo on.....




Please help me out.... i will be thankful to u...





  • November 30, 2009
  • Like
  • 0

I'm a little new, so this might be simple, but I've searched around in docs and can't find it


I've got a custom field that uses a date field type and I want to switch it to a checkbox format for reporting purposes.  When I got to switch it, it says that it can't because that field is being referenced by 4 workflow rules and 20-25 tasks.  I don't care if I lose the data currently associated with the field.  Is there a way to switch this over easier?