• Colin Loretz
  • NEWBIE
  • 5 Points
  • Member since 2007

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

On Friday night, over 400 records were deleted from Salesforce at the exact same time. Using SOQLXplorer, I can see the records when querying for deleted records and they all were deleted at the same time by the same username after hours. However they did not delete anything.

 

This occurred on a production install for a client and their recycling bin has not been emptied but the records do not show up in the recycling bin.

 

Is there any way to revert these deleted records? Apex undelete() doesn't work because they are not visible in the recycling bin.

 

I've put in a case with Salesforce but have not yet received a reply. The records deleted in question are used for tracking individuals and their health insurance, which as of Friday, the system believes they do not have insurance so this is a very important issue.

 

I have used SOQLXplorer to export the records to a csv, so that if i can't undelete them, I can at least reimport them. This will however cause the records to have new salesforce IDs, which I want to avoid if possible.

 

Any suggestions or alternatives?

 

Thank you.

I'm using javascript to set a value in an apex:inputHidden field. That value is not passed on to the controller even though it is bound to a variable in the controller. 

 

Javascript: 

 

        document.getElementById('timeEntry:j_id82:0:j_id86:j_id88:j_id89:selectedDay').value = currentDate;

 

Visualforce:

<apex:inputHidden id="selectedDay" value="{!selectedDay}" />

 

APEX:

  public String selectedDay { get; set; }

 

I used javascript alert() statements to check the value of the apex:inputHidden field and the value of currentDate is being set properly. However, when using selectedDay in my controller, it is null. The inputField has the value but the controller is not aware of the field's contents.

 

Am I missing a step in here somewhere that allows this to happen? 

 

Thanks. 


Howdy all,

I've implemented dependent selectLists in the interface below. The issue I'm having is that the lists only work when only 1 set exists. IE: 1 row for time entry in this case. When I add a row to the interface, it creates a new timeEntry instance and the selectLists in the bottom-most row work properly, but any above that do not work.

Is there a way to dynamically rerender a row in a table or some VF component? Ideally, each row or each outputPanel would have a different ID but I can't seem to set the rerender="" attribute dynamically.

Code:
<apex:actionRegion >
<apex:selectList value="{!selectedProject}" size="1">
<apex:selectOptions value="{!ProjectOptions}" />
<apex:actionSupport event="onchange" rerender="mondayTask" status="loading" />
</apex:selectList>
</apex:actionRegion>                  

<apex:outputPanel id="mondayTask">
<apex:selectList value="{!taskId}" size="1" multiselect="false">
<apex:selectOptions value="{!taskItems}"/>
</apex:selectList>
</apex:outputPanel>




Here is the code for the VF section:
Code:
<apex:outputPanel id="mondayTable"> 

 <apex:form >
 <table cellpadding = "0" cellspacing = "0">
  <tr class = "header">
        <td>Projects</td>
        <td>Tasks</td>
        <td>Description</td>
        <td width = "50">Time</td>
       </tr>
  <apex:repeat value="{!mondayTime}" var="t">
 <tr>
  <td>
   <apex:actionRegion >
          <apex:selectList value="{!selectedProject}" size="1">
           <apex:selectOptions value="{!ProjectOptions}" />
     <apex:actionSupport event="onchange" rerender="mondayTask" status="loading" />
          </apex:selectList>
         </apex:actionRegion>                  
        </td>
        <td>
   <apex:outputPanel id="mondayTask">
          <apex:selectList value="{!taskId}" size="1" multiselect="false">
         <apex:selectOptions value="{!taskItems}"/>
       </apex:selectList>
         </apex:outputPanel>
        </td>
  <td><apex:inputText value="{!t.description}" /></td>
  <td><apex:inputText value="{!t.hours}" /></td>
 </tr>
  </apex:repeat>
  <tr>
   <td>&nbsp;</td>
   <td>&nbsp;</td>
   <td>&nbsp;</td>
   <td><apex:commandButton action="{!addEntry}" value="add row" rerender="mondayTable" status="loading"/></td>
   <td><apex:commandButton action="{!saveMondayTime}" value="save" /></td>
  </tr>
 </table>
 </apex:form>
 </apex:outputPanel>

 



My objects are:

Object: Partner_Sent__c (object used for Many-to-Many)
Fields: CVB_Partner__c (Lookup to CVB_Partner__c object), Opportunity__c (Lookup to Opportunity object)

Object: Opportunity
Fields: Id, Name, Partner_Selected__c (Lookup to CVB_Partner__c)

Object: CVB_Partner__c
Fields: Id, Name

I want to do a query that gives me all CVB_Partner__c objects with the related Partner_Sent__c where the Partner_Selected__c is equal to the parent partner.

The code is much easier to understand:
Code:
Select Id, Name, (Select Id, Name, Opportunity__r.Partner_Selected__c from Partner_Sent__c where Opportunity__r.Partner_Selected__c = CVB_Partner__r.Id) from CVB_Partner__c

Unfortunately, I'm getting an error that states CVB_Partner__r.Id is not a valid field.

Am I doing something wrong or is this even possible?

Thanks!
 



Code:
partnerResults = [Select Id, Name, 
(Select Id, Name, Opportunity__c, Opportunity__r.StageName from Partners_Sent__r
where Opportunity__c != null AND Opportunity__r.CloseDate = THIS_YEAR)
from CVB_Partner__c where Id in :partnerList];

 
I'm having an issue writing this dynamically. I would like to do so and substitute THIS_YEAR with a date picklist. However, when I write it as a query String, I get an error from the colon (:) in front of partnerList.

How might I do an 'IN' statement within a dynamic apex query?

Thanks.

Colin
Hey everyone,

I'm trying to build a tree component and am able to go down two levels but I'm not sure how (or if) it would be possible to continue adding levels.


I'm already building the above tree with the following code:
Controller:
public ProjectTask__c [] getTasks()
 {
  return [Select Id, Name, (Select Id, Name from Tasks__r)  from ProjectTask__c where Project__c = :projectId];
 }

 
VF Page:
<ul id ="tree" class="treeview">
 <apex:repeat value="{!tasks}" var="t">
  <li><span class = "file"><a href = "/{!t.id}">{!t.name}</a></span>
   <ul>
    <apex:repeat value="{!t.Tasks__r}" var="st">
     <li><span class = "file"><a href = "/{!st.Id}" />{!st.name}</a></span></li>
    </apex:repeat>
   </ul>
  </li>
 </apex:repeat>
</ul>

 If I have any items below 1.1 or 2.1, such as 1.1.1, 1.1.1.1, etc. what would be the best way to build a list of this nature?

Thanks,
Colin


When creating products in Salesforce, I have the need to create products with prices of up to 4 decimal places. IE: $0.0085

When that value is entered, the record is saved as $0.00. Our organization is setup to handle up to 4 decimal places in values. It does not even attempt to round the value to $0.01, it just drops the last two decimals.

As a test, I created my own Product and Pricebook objects, entered the price of $0.0085 in a currency field and the value is maintained perfectly. I would prefer to keep everything in the standard Products object because of the existing functionality that exists for them.

Has anyone else encountered this or know a work around?
I'm having an issue with the data from a map being truncated.

I have a map consisting of:

Code:
Map<ID, CVB_Contact__c> m = new Map<Id, CVB_Contact__c>();

Everything works fine when I run some logic and add records to the map, I can see in my log that the data is being added to the map. However, if I try to output the map to the log file I get:
Code:
{Id:{record}, Id:{record}, Id:{record}, Id:{record}, 
Id:{record}, Id:{record}, Id:{record}, Id:{record}, Id:{record}, Id:{record}, ...}

Basically, it's truncating it after 10 map records.

I'm passing this map to a php script using an external callout and need to fix the truncation. Is there a limit to the size of a map? If so, what other options do I have?

I have tried sending the map in both GET and POST but neither affect the truncation as I can see that it is truncated in the log, before I even send it.
 
Thanks




Message Edited by Colin Loretz on 08-25-2008 09:38 AM
I have put together a few visualforce pages and the following is the workflow from an opportunity:

Opportunity (standardObject)
     ||
  Custom button (to reviewRFP)
     ||
reviewRFP (visualforce page - standard Opportunity controller with controller extension)
     ||
  CommandButton (<apex:CommandButton value="Select Recipient Partners" onclick="window.parent.location.href='/apex/selectPartners?oppId={!Opportunity.Id}';" />)
     ||
 selectPartners (visualforce page - custom controller)


This whole process works perfectly for me when I am in Development Mode.
The CommandButton (in green) will only refresh the page when Development Mode is turned off.

I've checked the profiles by going to Setup > Manager Users > Profiles. I checked each profile's Enabled Apex Class Access and Enabled Visualforce Page Access and have added all the relevant items.

I encountered this problem with CommandButtons not showing up on a visualforce page powered by a standard controller. The solution was to create an empty controller extension and voila! In this case, I'm already using a controller extension and nothing is happening. The last issue can be found here: http://community.salesforce.com/sforce/board/message?board.id=Visualforce&message.id=3416#M3416

Can anyone help me out with this one?



Edited:
Another note: I can navigate straight to the visualforce page and everything works fine. It appears as though the button is the only misfunctioning part of this puzzle.




Message Edited by Colin Loretz on 07-31-2008 03:48 PM

Message Edited by Colin Loretz on 07-31-2008 03:53 PM

I wrote the following code (replaced object/field names for simplicity) to handle rollup summary fields in Apex. It works pretty well but I frequently get errors when operating on bulk records or if no records exist (out of bounds, etc).

ParentObject__c :has_many Objects__c

Can anyone provide input as to whether or not I'm handling this type of task properly?

Code:
trigger rollupTrigger on Object__c (after insert, after update, after delete) {
    
    double totalSum = 0;
  
    Object__c myObjects = trigger.new;
    
    if(Trigger.isUpdate || Trigger.isInsert)
    {
            for(Object__c object : myObjects) //assume more than 1 record in trigger.new
            {
              for(ParentObject__c parent : [select Id, Name from ParentObject__c where Id = :object.Parent_Object__c]) //get the parent object
              {
                for(Object__c childObject : [select Id, Name, Number__c where Parent_Object__c = :parent.Id]) //get all the objects that belong to the parent object
                {
                  totalSum += childObject.Number__c;   //sum the field of choice
                }
                parent.Total__c = totalSum;   //set the total in the parent
                update parent                       // update the parent
              }
            }
    }
    else if(Trigger.isDelete)
    {
        Object__c [] oldObjects = Trigger.old;
        
      for(Object__c oldObject :oldObjects)    //assume deletion of more than 1 record
      {
        for (ParentObject__c parentObject : [select id, Name, Number__c, Total__c where Id = :oldObject.Parent_Object__c]) //get the parent object(s)
        {
          for (Object__c childObject : [select id, Name, Number__c from Object__c where Parent_Object__c = :parentObject.id])   //get the records that belong to the parent
          {
             totalSum += childObject.Number__c;  //sum the fields after a record has been deleted
          }
            parentObject.Total__c = totalSum;   //set new total in parent
            update parentObject;                      //update parent
        }   
      } //end oldObject for loop
    } //end else if
    
} //end trigger

Thanks!
 

I have already deployed a package to a production org. I've made changes to the triggers in the developer org and reuploaded the package.

When I install it, will it only update the items that have been changed or give it a new fresh install?

I'm trying not to lose my tab, search, and page layouts as well as a few custom buttons I added after the first installation.
I have created a VF page to override the view of an object. The override is already setup so when I go to view the object by clicking on it in the Object's tab or in the Recent sidebar, the commandButtons (edit/delete) don't appear. The page renders as I coded it, minus those buttons.

The url for the view is composed of the salesforce url with the object Id
https://ssl.salesforce.com/a0M000000004KAT

If I go to
https://ssl.salesforce.com/apex/viewProject?id=a0M000000004KAT

The commandButtons show up. I'm not sure what is going on because the override should "transparently" allow for this connection to be made.

I also overrode the edit functionality and the Save/Cancel buttons do show up. It only seems to be a problem on the view.

My suspicion is in permissions but the profiles have access to edit/delete/save/view on all the objects and I can do all of those actions with a standard view.

Can anyone offer some insight on this? Thanks!
Hi there,

I'm having some issues deploying a large amount of Apex code to my production org. I have spent the last week writing Apex test methods and the average coverage is well above 75% for all the code. I run the Apex Code Test Runner in Eclipse and it mentions that most of my triggers at are 100%, a few just below.

I go to the project > Force.com > Deploy to Server

Once I enter the destination information, select the actions to act on, and hit "validate deployment", it returns saying that it has failed.

The reason for the failure being that the average coverage for my code is only 27%. I know this to be false so I'm not sure why the tests work (with 0 failures) when developing in Eclipse or even in the Sandbox UI but not when deploying to a production.

Do tests get run differently in a production instance?

Message Edited by Colin Loretz on 07-11-2008 01:21 AM

Message Edited by Colin Loretz on 07-11-2008 01:21 AM
I have a need to generate a dynamic query string for a SOQL query but the statement won't accept a string for a query.


string qstring = "select Id, Field from Object where x = 'y' or x = 'z' and z = 'x' or z = 'y'";

List<Object> objects = new List<Object>(qstring);

Is there a way to do this? I need to build the query string because, based on a multiselect field, there could be anywhere from 1 to 10 OR statements for each field
Hi all,

I found this documentation on querying multiselect fields.

When you do a query like:
Code:
MSP1__c includes ('AAA;BBB', 'CCC') 

 the query filters on values in the MSP1__c field that contains either of these values:

    * AAA and BBB selected
    * CCC selected.

So the ';' represents AND.

If we break it up:

Code:
MSP1__c includes ('AAA', 'BBB', 'CCC')

 represents AAA or BBB or CCC.

 Is there a way to query using OR instead?

I'm passing my variable, lets say CategoryOptions to a class. The code becomes

Code:
MSP1__c includes (CategoryOptions)

 The problem with this is that it will only return values that match the selected Categories exactly. I need any records that has any single 1 of the options in the multiselect field.

My idea is to just parse the variable CategoryOptions and build a query, seperating all the values with commas.

Code:
MSP1__c includes (Cat1, Cat2, Cat3, etc).

 Is that the best and/or only way to do this?



Hi all,

I've been working with Apex triggers in a development environment but I'm unable to deploy them to a production environment. I have been able to deploy Apex classes with their respective testMethods but am unable to deploy the Triggers.

I created a trigger on an Opportunity and created a testMethod in an Apex class, however it does not appear as though the test is working.

I've even tried to deploy the LeadDupeTrigger from the Apex Cookbook - and the tests don't appear to be running. (Again the tests with just Apex Classes work fine).

The Code Coverage Results say:
myTriggerTester (Class) - 0 Lines not tested, 100% covered

However, the debug log (set to max verbosity) displays the following:
Code:
Debug Log:

Cumulative profiling information:

No profiling information for SOQL operations.

No profiling information for SOSL operations.

No profiling information for DML operations.

No profiling information for method invocations.

 
I created a simple trigger to test deployment, it is below:
Code:
trigger populateDates on Opportunity (before insert, before update) {

 Opportunity [] opp = Trigger.new;
 
 for (Integer i = 0; i < opp.size(); i++)
 {
  opp[i].Arrival_Date__c = date.today();
 }

}

 And the testMethod:

Code:
public class myTriggerTester {
 
 static testMethod void TEST_populateDates() {
 
   Account testAccount = new Account (
               Name = 'Testing'
       );
       insert testAccount;

       Opportunity firstOpp = new Opportunity (
               Name = 'Test',
               Account = testAccount,
               CloseDate = date.today(),
               StageName = 'Strong Potential',
               Proposal_Deadline__c = date.today()
       );
  
  System.assertEquals(null, firstOpp.Arrival_Date__c);
  
  insert firstOpp;
  
  System.assertEquals(date.today(), firstOpp.Arrival_Date__c);
 }
}

 


Clearly most sales teams will be selling products that are worth more than $1.00.
 
However, I have a need to create a pricebook of items with prices of:
$0.035
$0.020
$0.0175
$0.015
 
When you edit the record, you see the actual, 3-4 digit values but the summaries show only 2 decimals.
 
Is there a way to allow for the summary to show the actual price, without rounding up to 2 decimal points?

I have two objects:

AccountPriceBookEntry__c and TimeSheetEntry__c

  • AccountPriceBookEntry__c has a Price__c field that stores the price of an Employee's rate for that particular account
  • TimeSheetEntry__c has a Rate__c field that should store the price from the AccountPriceBookEntry__c
  • TimeSheetEntry__c is where an employee fills out a time sheet and selects an AccountPriceBookEntry__c from a lookup field
  • I need the Time Sheet Entry's Rate__c field to be updated based on the Price__c field in the other object
Code:
trigger updateRate on TimeSheetEntry__c (after insert, after update) {
 
 List<String> TimeRate = new List<String>();
 
 for (Integer i = 0; i < Trigger.new.size(); i++)
 {
  TimeRate.add(Trigger.new[i].Account_Price_Book_Entry__c);
 }
 
 List<AccountPriceBookEntry__c> rateList = new List<AccountPriceBookEntry__c>([Select Price__c from AccountPriceBookEntry__c where Id in :TimeRate]);
 
 for (Integer i = 0; i < Trigger.new.size(); i++)
 {
  if (Trigger.new[i].Account_Price_Book_Entry__c != null)   
  {
   Trigger.new[i].Rate__c = rateList[i].Price__c;
  }
 }

}


 Am I way off base here?

I get an exception error that says

Code:
Error:Apex trigger updateRate caused an unexpected exception, contact your administrator: updateRate: execution of AfterUpdate caused by: System.Exception: Record is read-only: Trigger.updateRate: line 16, column 28

Cheers!
 

I'm trying to deploy Apex code for the first time and I've run into an issue.

I've tried using both the Force.com IDE and Apache Ant/CMD line methods for deployment and I can't deploy to a live production environment.

When I run "ant deploy" with my connection info setup for a developer account, the build is successful. When I change the connection info to represent a live environment, I get the following error:
Code:
BUILD FAILED
C:\Documents and Settings\cloretz\Desktop\salesforce_ant\sample\build.xml:12: Fa
iled:
testcase in class 'compileAndTest' method 't1' failure:System.DmlException: Inse
rt failed. First exception on row 0; first error: INVALID_FIELD_FOR_INSERT_UPDAT
E, Account: bad field names on insert/update call: Name: [Name]
stack-trace:
Class.compileAndTest.t1: line 7, column 9

Code coverage error on phoneSetter: Test coverage of selected Apex Trigger is 0%
, at least 1% test coverage is required
Code coverage error: Test coverage of selected Apex Class and Trigger is 25%, at
 least 75% test coverage is required




I have a button that is running javascript and passes the Opp Amount over to this custom object. However, it does not pass just the amount of 4,000.00, but USD 4,000.00. It will not accept the value with the alpha characters. Is there a way to pass just the numeric value?

Code:
00N00000006ysxb={!Opportunity.Amount}

 

Howdy all,

I've implemented dependent selectLists in the interface below. The issue I'm having is that the lists only work when only 1 set exists. IE: 1 row for time entry in this case. When I add a row to the interface, it creates a new timeEntry instance and the selectLists in the bottom-most row work properly, but any above that do not work.

Is there a way to dynamically rerender a row in a table or some VF component? Ideally, each row or each outputPanel would have a different ID but I can't seem to set the rerender="" attribute dynamically.

Code:
<apex:actionRegion >
<apex:selectList value="{!selectedProject}" size="1">
<apex:selectOptions value="{!ProjectOptions}" />
<apex:actionSupport event="onchange" rerender="mondayTask" status="loading" />
</apex:selectList>
</apex:actionRegion>                  

<apex:outputPanel id="mondayTask">
<apex:selectList value="{!taskId}" size="1" multiselect="false">
<apex:selectOptions value="{!taskItems}"/>
</apex:selectList>
</apex:outputPanel>




Here is the code for the VF section:
Code:
<apex:outputPanel id="mondayTable"> 

 <apex:form >
 <table cellpadding = "0" cellspacing = "0">
  <tr class = "header">
        <td>Projects</td>
        <td>Tasks</td>
        <td>Description</td>
        <td width = "50">Time</td>
       </tr>
  <apex:repeat value="{!mondayTime}" var="t">
 <tr>
  <td>
   <apex:actionRegion >
          <apex:selectList value="{!selectedProject}" size="1">
           <apex:selectOptions value="{!ProjectOptions}" />
     <apex:actionSupport event="onchange" rerender="mondayTask" status="loading" />
          </apex:selectList>
         </apex:actionRegion>                  
        </td>
        <td>
   <apex:outputPanel id="mondayTask">
          <apex:selectList value="{!taskId}" size="1" multiselect="false">
         <apex:selectOptions value="{!taskItems}"/>
       </apex:selectList>
         </apex:outputPanel>
        </td>
  <td><apex:inputText value="{!t.description}" /></td>
  <td><apex:inputText value="{!t.hours}" /></td>
 </tr>
  </apex:repeat>
  <tr>
   <td>&nbsp;</td>
   <td>&nbsp;</td>
   <td>&nbsp;</td>
   <td><apex:commandButton action="{!addEntry}" value="add row" rerender="mondayTable" status="loading"/></td>
   <td><apex:commandButton action="{!saveMondayTime}" value="save" /></td>
  </tr>
 </table>
 </apex:form>
 </apex:outputPanel>

 



I have a VF page with Controller Extension that very much resembles the example at http://wiki.apexdevnet.com/index.php/Wrapper_Class.  I had it all working great as it resembles that class.

I received a new requirement to add a String field into the wrapper and to add an inputText field onto the VF page.  So I added a new "public String problemDescription {get; set;}"  property into the wrapper class.  I then added an inputText field with a value attribute of that field, allowing the user to enter a value, process the records and use that input value in the Apex method.

For some reason, that field in the wrapper class is not picking up the value entered into the VF page.  If I hardcode a value as a default in the wrapper class constructor, that value will appear in my VF page.  However, if I overwrite that value in the page, the controller will not pick up on the new value.  It only uses the initial value.

The strange thing is that I have an inputCheckbox on my page bound to the selected property of the wrapper class and the controller picks up the value set on the page.  For some reason, it won't pickup my new value.  Ideas?

I can post the code if my explanation doesn't make sense, but I thought I'd keep it as simple as possible and ask people to start with that example on the wiki and try to add a String to the wrapper class and get the controller to read the values submitted from the page.
  • December 19, 2008
  • Like
  • 0
My objects are:

Object: Partner_Sent__c (object used for Many-to-Many)
Fields: CVB_Partner__c (Lookup to CVB_Partner__c object), Opportunity__c (Lookup to Opportunity object)

Object: Opportunity
Fields: Id, Name, Partner_Selected__c (Lookup to CVB_Partner__c)

Object: CVB_Partner__c
Fields: Id, Name

I want to do a query that gives me all CVB_Partner__c objects with the related Partner_Sent__c where the Partner_Selected__c is equal to the parent partner.

The code is much easier to understand:
Code:
Select Id, Name, (Select Id, Name, Opportunity__r.Partner_Selected__c from Partner_Sent__c where Opportunity__r.Partner_Selected__c = CVB_Partner__r.Id) from CVB_Partner__c

Unfortunately, I'm getting an error that states CVB_Partner__r.Id is not a valid field.

Am I doing something wrong or is this even possible?

Thanks!
 



I created unit tests for triggers and classes.

To view test coverage:

Eclipse -> Project- > src -> unpackaged -> classes -> Force.com -> run tests.
Under Failures and warnings and under general warnings it was showing 64% completed but 75 % test coverage is required.
Then I added one more test in a class as I am trying to reach for at least 85% test coverage but now when I right click to run tests I am seeing few failures and warnings but not seeing the the general warnings tab as before.

What does it mean? How can I see what percentage I have covered?




thanks,
kathyani
Code:
partnerResults = [Select Id, Name, 
(Select Id, Name, Opportunity__c, Opportunity__r.StageName from Partners_Sent__r
where Opportunity__c != null AND Opportunity__r.CloseDate = THIS_YEAR)
from CVB_Partner__c where Id in :partnerList];

 
I'm having an issue writing this dynamically. I would like to do so and substitute THIS_YEAR with a date picklist. However, when I write it as a query String, I get an error from the colon (:) in front of partnerList.

How might I do an 'IN' statement within a dynamic apex query?

Thanks.

Colin
Hey everyone,

I'm trying to build a tree component and am able to go down two levels but I'm not sure how (or if) it would be possible to continue adding levels.


I'm already building the above tree with the following code:
Controller:
public ProjectTask__c [] getTasks()
 {
  return [Select Id, Name, (Select Id, Name from Tasks__r)  from ProjectTask__c where Project__c = :projectId];
 }

 
VF Page:
<ul id ="tree" class="treeview">
 <apex:repeat value="{!tasks}" var="t">
  <li><span class = "file"><a href = "/{!t.id}">{!t.name}</a></span>
   <ul>
    <apex:repeat value="{!t.Tasks__r}" var="st">
     <li><span class = "file"><a href = "/{!st.Id}" />{!st.name}</a></span></li>
    </apex:repeat>
   </ul>
  </li>
 </apex:repeat>
</ul>

 If I have any items below 1.1 or 2.1, such as 1.1.1, 1.1.1.1, etc. what would be the best way to build a list of this nature?

Thanks,
Colin


When creating products in Salesforce, I have the need to create products with prices of up to 4 decimal places. IE: $0.0085

When that value is entered, the record is saved as $0.00. Our organization is setup to handle up to 4 decimal places in values. It does not even attempt to round the value to $0.01, it just drops the last two decimals.

As a test, I created my own Product and Pricebook objects, entered the price of $0.0085 in a currency field and the value is maintained perfectly. I would prefer to keep everything in the standard Products object because of the existing functionality that exists for them.

Has anyone else encountered this or know a work around?
We have a managed package containing a custom object with three record types.  Pre-Winter '09 it worked fine; now it won't install in other orgs, and I'm hoping someone can help me understand what has changed.

Symptoms:

1.  In the dev org, doing a "Run all Tests" reports 0 failures.

2.  If I take the managed package install link to another org and install, I get a bunch of unit test failures like this:

ut_calculations_modelvalidator.SimplestTestCase()Apex Classes(01p800000008jBO)
System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, record type missing for: Support Program
(ENT_2)
;


Here's the source code for this test:

Code:
    static testMethod void SimplestTestCase() 
    {
        ENT_2__Support_Program__c sp = new ENT_2__Support_Program__c( 
             Name='TestSP',
             P1__c = 'xyz'
             );
        insert sp;
    }


3.  I thought maybe Winter '09 wanted me to specify a RecordTypeId explicitly, so I tried several variations on this:

Code:
    static testMethod void SimplestTestCase() 
    {
        ENT_2__Support_Program__c sp = new ENT_2__Support_Program__c( 
             Name='TestSP',
             P1__c = 'xyz'
             );
        sp.RecordTypeId = '012300000009x0G';
        insert sp;
    }

 
Again, the dev org's "Run all Tests" has no problem with this.  (That id is a valid record type for the dev org's ENT_2__Support_Program__c object.)  But rebuilding the package and attempting an install in any other org gives this error message:

System.DmlException: Insert failed. First exception on row 0; first error: INVALID_CROSS_REFERENCE_KEY, Record Type ID: id value not valid for the users profile: 012300000009x0GAAQ: [RecordTypeId]
(ENT_2)

Any idea what I am doing wrong?
Is there a way to read some values from a database and to generate a graphic diagram ?
I want to code a function, when a user goes over a link, the user gets information....like:
 
<- try a mouseover over the image 'smart people', you will see information and average (stars)...
 
 
Thank you very much!
 
Hi All,

I am creating a customize version of new lead page using Visualforce and I want to add Ajax which allows users to edit the field by directly double clicking on it. They do not need to click on "edit" button to re-load the entire page in edit mode..

Please suggest how I should start implementing Ajax with visualforce pages?

Any help in solving this problem would be highly appreciated.

Thank You,
Vishal

I'm having an issue with the data from a map being truncated.

I have a map consisting of:

Code:
Map<ID, CVB_Contact__c> m = new Map<Id, CVB_Contact__c>();

Everything works fine when I run some logic and add records to the map, I can see in my log that the data is being added to the map. However, if I try to output the map to the log file I get:
Code:
{Id:{record}, Id:{record}, Id:{record}, Id:{record}, 
Id:{record}, Id:{record}, Id:{record}, Id:{record}, Id:{record}, Id:{record}, ...}

Basically, it's truncating it after 10 map records.

I'm passing this map to a php script using an external callout and need to fix the truncation. Is there a limit to the size of a map? If so, what other options do I have?

I have tried sending the map in both GET and POST but neither affect the truncation as I can see that it is truncated in the log, before I even send it.
 
Thanks




Message Edited by Colin Loretz on 08-25-2008 09:38 AM
When using the time shortcuts, I'm having a hard time figuring out which day of the week a SalesForce week actually starts on. Is it Monday or Sunday?
 

I wrote the following code (replaced object/field names for simplicity) to handle rollup summary fields in Apex. It works pretty well but I frequently get errors when operating on bulk records or if no records exist (out of bounds, etc).

ParentObject__c :has_many Objects__c

Can anyone provide input as to whether or not I'm handling this type of task properly?

Code:
trigger rollupTrigger on Object__c (after insert, after update, after delete) {
    
    double totalSum = 0;
  
    Object__c myObjects = trigger.new;
    
    if(Trigger.isUpdate || Trigger.isInsert)
    {
            for(Object__c object : myObjects) //assume more than 1 record in trigger.new
            {
              for(ParentObject__c parent : [select Id, Name from ParentObject__c where Id = :object.Parent_Object__c]) //get the parent object
              {
                for(Object__c childObject : [select Id, Name, Number__c where Parent_Object__c = :parent.Id]) //get all the objects that belong to the parent object
                {
                  totalSum += childObject.Number__c;   //sum the field of choice
                }
                parent.Total__c = totalSum;   //set the total in the parent
                update parent                       // update the parent
              }
            }
    }
    else if(Trigger.isDelete)
    {
        Object__c [] oldObjects = Trigger.old;
        
      for(Object__c oldObject :oldObjects)    //assume deletion of more than 1 record
      {
        for (ParentObject__c parentObject : [select id, Name, Number__c, Total__c where Id = :oldObject.Parent_Object__c]) //get the parent object(s)
        {
          for (Object__c childObject : [select id, Name, Number__c from Object__c where Parent_Object__c = :parentObject.id])   //get the records that belong to the parent
          {
             totalSum += childObject.Number__c;  //sum the fields after a record has been deleted
          }
            parentObject.Total__c = totalSum;   //set new total in parent
            update parentObject;                      //update parent
        }   
      } //end oldObject for loop
    } //end else if
    
} //end trigger

Thanks!