• nickname142857
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 5
    Replies

Conversion rates are dated (i.e., rates are different on different dates), how does salesforce know which rate to use when it is doing the conversion on currency fields of a custom object? Does it always use createdDate?

There used to be profiling information on the most expensive queries and method calls in the logs which are extremely useful. But I do not see them now no matter what the log levels I use. Anyone know what happened?

I used to see logs that show the most expensive queries and methods in logs. But I do not see them now. Anyone knows how to get that info now?

I need something like javacc but in Apex that can parse 'rules' based on some grammar that I define. The grammar is kind similar to the calculated field where you can use functions like IF, AND, OR etc. and operators like +,-,*,/ etc. Anyone has any suggestions?

 

Anyone knows where (which object) are they stored? Or are there system methods I can use to get a list of them? I need to delete ones that are obsolete in Apex code.

I have a parent object which has a period field, and a child object that also has a period field. And I want to get all rows that either parent.period = 'Jan' or child.period = 'Jan' (with just one query).

 

I cannot do something like

select ..., (select ..., from child where period = 'Jan') from parent where period = 'Jan'

because it will only return records for which parent.period = 'Jan'.

 

Anyone has any thoughts, suggestions?

We are building an app and we have set auditing on for a few custom objects/fields. But after people install our app in their org, the audit setting on the fields are all lost (unchecked), but the audit setting on the object is on correctly. Anyone knows why?

Conversion rates are dated (i.e., rates are different on different dates), how does salesforce know which rate to use when it is doing the conversion on currency fields of a custom object? Does it always use createdDate?

Greetings,

 

I'm pulling my hair out trying to find out why my test method is failing.

 

I've "borrowed liberally" from Colin Loretz's page on creating rollup fields between any object, (x-ref http://colinloretz.com/tag/salesforce-apex-code/).

 

The trigger I've created aggregates values from "child" records, placing the total value on the parent.  Works great.

 

The test method however, fails on the assertequals clause :

 

...

    // Test ParentObj__c "p" created, which automatically spawns the

    // creation of a default first ChildObj__c with a Percent__c equal to 100.

...

    List<ChildObj__c> ChildObjList = new List<ChildObj__c>();
    ChildObj__c c1 = new ChildObj__c(ParentObj__c=p.id,Percent__c=10);
    ChildObj__c c2 = new ChildObj__c(ParentObj__c=p.id,Percent__c=25);
    ChildObj__c c3 = new ChildObj__c(ParentObj__c=p.id,Percent__c=50);

    ChildObjList.add(c1);
    ChildObjList.add(c2);
    ChildObjList.add(c3);

    //Insertion test 100 + 10 + 25 + 50 = 185
    {
        insert ChildObjList;
        p = [select id, Total_Percent__c from ParentObj__c where id=:p.Id];
        System.assertEquals(185,Parent.Total_Percent__c);

        // "System.AssertException: Assertion Failed: Expected: 185, Actual: 555" ?!?!?!

    }

...

 

If I set my "expected" value to 555, then continue with update and deletion tests, things seem to normalize.  I noticed that the "Actual Result" is always three times the expected, (because I'm inserting three records).  If I only do two inserts, then the delta is off by two times the expected, (and I can avoid the issue entirely if I do a single record test, but I'd really like to understand why this is happening).

 

Thanks for any insight,

Pete

 

Hey all,

 

I have a question,

 

When before I tried to change the before insert/before update to after insert and after update, it would give me a readonly error. Am I doing something wrong to get it working? As a work around (kind of) I changed it to "before insert, before update" and it appears to work; however, whenever the account's custom field is set to something, it still changes the field to the name regardless of whether or not it is set.

 

Any hints or tips or suggestions to know what exactly is wrong here?

 

Thanks

 

Kuen

 

 

trigger zendeskAutoFill on Account (before insert, before update) {
for (Account a: trigger.new) {
             if (a.Zendesk__Zendesk_Organization__c != '') {
                    a.Zendesk__Zendesk_Organization__c = a.Name;
              }
         }

 

  • September 02, 2010
  • Like
  • 0

Anyone knows where (which object) are they stored? Or are there system methods I can use to get a list of them? I need to delete ones that are obsolete in Apex code.

I have some custom objects for which I set the Name field to be auto number and I want to be able to get the rows in the same order that I wrote them.

 

But to my surprise when I do 'select ... from ... order by Name', it is not working as I expected. For example, row 99 will come after row 100 -- the reason I think is it is ordering as strings not numbers.

 

Note that order by CreatedDate does not work because some rows may have the same value.

 

Of course I do not want to create a number field and maintain a counter myself.

 

Anyone knows how to get around this issue?