• Schuetzler
  • NEWBIE
  • 0 Points
  • Member since 2010

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

I am looking for a way to run Apex code, or possibly a trigger, whenever an Account is viewed. The Apex code will be used to update a field at the account level, but I don't want to wait for the Account to be updated.

 

Is this possible?

I am trying to test an aggregate query in the Schema Explorer. Unfortunately I can't seem to get it to work. When I run the following query, I got 7 results back:

 

SELECT Current_Annual_Maintenance_Value__c FROM Asset

 

However, when I run the following query I get nothing:

 

SELECT sum(Current_Annual_Maintenance_Value__c) FROM Asset

 

Can anyone explain how to correctly do an aggregate function in a query to work? I can't get anything to work when I try Count() either. I just get an empty column of data with expr0 as the column name.

Hey all,

 

So I have done minimal work with SOQL/SOSL, so I thought the community might be able to help me out with this beginner question. I am trying to query a custom object I have for the name. I am running a custom visualforce page that looks up various attributes of the object. So in my case the instance of my Model Definition object is called "Model 1" (stored as Model Definition Name). I would like to print the name of the instance at the top of the page since that is a lot more user friendly. I am thinking I would construct a query along the lines of...

 

SELECT 'Model Definition Name' FROM Model_Definition__c WHERE Model_Definition__c = :modelDefId

 

I got the modelDefId from the current page using ApexPages.currentPage().

 

It doesn't like the format of that Model Definition Name though. If I try to use Model_Definition_Name__c, it says that field does not exist on the object. Any suggestions on how to reference it or if I am even setting up this query correctly?

 

Thanks!

I am trying to test an aggregate query in the Schema Explorer. Unfortunately I can't seem to get it to work. When I run the following query, I got 7 results back:

 

SELECT Current_Annual_Maintenance_Value__c FROM Asset

 

However, when I run the following query I get nothing:

 

SELECT sum(Current_Annual_Maintenance_Value__c) FROM Asset

 

Can anyone explain how to correctly do an aggregate function in a query to work? I can't get anything to work when I try Count() either. I just get an empty column of data with expr0 as the column name.