• moverdorf
  • NEWBIE
  • 20 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 31
    Questions
  • 26
    Replies
GOAL:
In a CSV I want to define a custom relationship between two custom objects (A and B), and on Upsert of B, I want to store the
value of a NON External Id field.

Example:
I have two custom objects that are related with CustomObjAB__r

CustomObjA
     1. CA_External_Id__c (External ID)
     2. CA_Another_Id__c (The value I want to save on Upsert of CustomObjB) - Text field

CustomObjB
     1. CB_Id__c (External Id)
     2. CB_Another_Id__c (I want to populate this value with CA_Another_Id__c not the External Id value)

So I know you need to use an External Id field to relate the two objects in a CSV column header, but what if I don't want to save the External Id field, but ANOTHER field from CustomObjA.

From what I have read it looks like the ONLY values you can save from a custom relationship is the External Id value? Is that correct?

I would have hoped, you could define the External Id as a lookup and then get any field you want to store from the row found.

Thanks to all.
Guys,
I have a ClientConfig__c object and a Rich Text Field called ComanyLogo__c.

I want the user to be able to point to their local machine, select a logo image (.gif, .bmp, .png) and save it to this ClientConfig__c object.

I don't want it as an attachment, I just want a simple form to upload it to the ClientConfig__c object.

I then need apex code to retrieve the image and display it on a VFP page.

Can anyone help me out with both the save code and the redisplay in VFP form?

Thnaks to all in advance!

 
What is the code to use to check for the existence of a Custom Settting?
Some of my clients ORGs may not have setup the custom setting and I want my code to set a default if no custom setting exits.

Psuedo Code:
If (mycustomsetting == null) this is the piece of code I want to know how to check
{
 days = 100;
}
else
{
 days = mycustomsetting....
}

My Custom Setting is
I have an Apex Batch job that I use to load a huge transaction file... And the code is running fine.

But what I want to know is, from within the Batch Apex class, if I have objects I need to query that may result in > 50,000 rows coming
back what is the best practice for handling this.

I was hoping I could use the Database.QueryLocator because I know they don't have the 50,000 limit
and was thinking I could do something like this mapping:

       Database.QueryLocator qlSSN      = Database.getQueryLocator([SELECT Id,payout__SSN__c FROM Account]);
       for(Database.QueryLocator a : qlSSN)
       {
          mSSNKey.put(a.id,a.payout__SSN__c);
       }    

But this is not a valid approach. So how in Apex Batch, can you bring back a query that may be > 50,000.

Again, I am not talking about the DRIVER Apex Batch query being > 50,000 I am talking abount querying another Object from within the pocessing of the batch that may return over 50,000.

Thanks everyone.
 
I created the following custom field payout__ AH_DAY_RANGES__c with TWO custom setting values:
1. To_Days (Number)
2.From_Days (Number)

Now in my apex class, I simply want to set my date input fields to the current date +/- the custome values...

If(payout__ AH_DAY_RANGES__c.From_Days__c.getDescribe().getDefaultValue() != null)
{
            DateInput1.ActivityDate = System.Today() - payout__ AH_DAY_RANGES__c.From_Days__c.getDescribe().getDefaultValue();
}
 
 
If(payout__ AH_DAY_RANGES__c.To_Days__c.getDescribe().getDefaultValue() != null)
{
            DateInput2.ActivityDate = System.Today() + payout__ AH_DAY_RANGES__c.To_Days__c.getDescribe().getDefaultValue();
}

But I am getting an error because the data type of payout__ AH_DAY_RANGES__c.To_Days__c.getDescribe().getDefaultValue() is OBJECT and not what I expected it to be (Number). How can I make the datatype of payout__ AH_DAY_RANGES__c.To_Days__c.getDescribe().getDefaultValue() a NUMBER so I can use it in the System.Today() formula?
I have the following custom setting: Payout__AH_FromToDate__c
 
I created two values in the Custom Settings panel:
payout__AH_From_Date__c
payout__AH_To_Date__c
 
 
In my APEX Class code:
 
237        Date frmdte;
 238       Date todte;
 
   239     frmdte = payout__AH_FromToDate__c.getValues('payout__AH_From_Date__c');
    240    todte  = payout__AH_FromToDate__c.getValues('payout__AH_To_Date__c');
 
    241    DateInput1.ActivityDate  = frmdte;
     242   DateInput2.ActivityDate  = todte;
 
Error: Compile Error: Illegal assignment from SOBJECT:payout__AH_FromToDate__c to Date at line 239 column 9
 
Can someone help me out as to what I need to do so that I can assign frmdte and todte to my custom setting date values?
 
Thanks.
 
 
Ok, I am using the following two queries to obtain all Tasks/Events for a contact:

Select Accountid,Location ,Subject,Description,ActivityDate,ActivityDateTime from Event where Who.id ='003A000000KQcc1IAD'
Select Accountid,Status ,Subject,Description,ActivityDate,Priority,owner.name,isclosed from Task where Who.id ='003A000000KQcc1IAD'

How can I get the CATEGORY value that is displayed on the Open Activities Panel?... This field is not on either the Task or Event Object.
Does anyone know what the SOQL query would look like to create the results shown in the Open Activities section of the Salesforce inteface?

I have tried to replicate it, but don't know how to get a list of Open Acivities for a contact, if the Open Activity doesn't belong directly to the Contact's Account.

For example, for my case, in the Open Activities section I see:

Subject        Name           Related To
AAA            John Smith    John Smith
BBB            John Smith     John Smith
CCC            John Smith     CM-137 (Client Meeting)

In my SOQL I can't get the CCC John Smith CM-137 row to be returned in my query, because the Task is NOT related to my Contact John Smith.

I have no idea how SF is doing this, can anyone help with a SOQL query or some code that would accomplish this? Thanks



For example, if a task's what.id is NOT for the contact but for something else, like a Client Meeting, I still want this task to be inlcuded in my query for the
Hi,
Simply put, I want to retieve any OpenActivites and ActivityHistory rows for a passed Contact.id

My page is passed in the Contact's ID, I then:

I know I can't Select directly on the OpenAcivites/ActivityHistories objects... So I have something like this

SELECT id,(SELECT Who.name,What.name, payout__Category__c,ActivityDate FROM ActivityHistories Order by ActivityDate desc),(SELECT ActivityDate,who.name,what.name FROM OpenActivities Order by ActivityDate desc)
FROM Account Where Id in (SELECT Accountid from Contact where id = '003A000000MI9SJ')    

But this is NOT the correct query, because I am bringing back ALL OpenActivities/ActivityHistories for the ACCOUNT and not for JUST the Contact of that account. So how do I change my query so I just get the OpenActivities/ActivityHistories for the one Contact.id.

Thanks.

                    

 
Hi all,
The WhoId is always showing null for my query shown below, and I need to get the related CONTACT name for each Open Activity.
Can anyone tell me why the WhoId would not be getting populated and how I could get CONTACT names ?

select id, Name, 
       (SELECT Id,whoid,whatid,ownerid,payout__Category__c,ActivityDate,Description,Subject,IsClosed,CallType,CallDisposition,Status,ActivityType,IsTask    
FROM OpenActivities ) from Account where Name like '%Akers%'
 
[{"Id":"00TA000000lF8uQMAS","WhoId":null,"WhatId":"001A000000SMWrUIAX","OwnerId":"005A0000000JrNJIA0","payout__Category__c":null,"ActivityDate":"2012-08-16","Description":"The Investment Tiered Payout Rate for the Advisor has just changed.","Subject":"New Inv Tiered Payout Rate","IsClosed":false,"CallType":null,"CallDisposition":null,"Status":"Not Started","ActivityType":"1_","IsTask":true},{"Id":"00TA000000lF9IUMA0","WhoId":null,"WhatId":"001A000000SMWrUIAX","OwnerId":"005A0000000JrNJIA0","payout__Category__c":null,"ActivityDate":"2012-08-16","Description":"The Investment Tiered Payout Rate for the Advisor has just changed.","Subject":"New Inv Tiered Payout Rate","IsClosed":false,"CallType":null,"CallDisposition":null,"Status":"Not Started","ActivityType":"1_","IsTask":true}]
 
I have a scheduled Apex Batch Job that runs every hour. Is there any way to check using Apex code to see if the job is running?

Thanks.

I do the following query, to get BOTH closed activites and open ones:

 

SELECT name, id, (SELECT id,ActivityDate,Description,Subject,IsClosed,CallType,CallDisposition,Status,ActivityType

FROM ActivityHistories where isTask = true

 Order by ActivityDate desc

) ,

(SELECT id,ActivityDate,Description,Subject,IsClosed,CallType,CallDisposition,Status,ActivityType

FROM OpenActivities where isTask = true

 Order by ActivityDate desc

)

FROM Account where name like '%Abseck%'

 

The query results are saved in lstactivity

 

I am trying to loop thru and get at the ActivityHistories info

for(Account a : lstactivity)

{

 

   for(ActivityHistory t : a.ActivityHistories)

   {

       System.debug(t.ActivityDate);

   }

}

 

I am getting an error that t.ActivityDate doesn't exist.

am I referencing ActivityHistories correctly in the loop?..I wasn't sure what to use for the names

 

 

When I do it for OpenActivities it works...

for(Account a : lstactivity)

{

 

   for(OpenActivity t : a.OpenActivities)

   {

       System.debug(t.ActivityDate);

   }

}

 

Please hlep!... Thanks in advance.

 

I am trying to create a scheduled Apex batch job, I created the class below:

 

global class BatchLoadDaily3 implements Schedulable{
    
    global void execute(SchedulableContext sc) {
        //  Instantiate batch class
    BatchLoadDaily3 bat = new BatchLoadDaily3('','CASCADE');
    Database.executeBatch(bat, 20);
    }
}

 

But I am getting an error when I try to save the code:

Error: Compile Error: Constructor not defined: [BatchLoadDaily3].<Constructor>(String, String) at line 5 column 27

 

Can anyone help me out with the Constructor for this?

 

Thanks so much in advance!

 

 

 

I have the following class:

 

    Public Class Ahrec
    {
        Date ActivityDate{get; set;}
        String Client{get; set;}
        String Subject {get; set;}
        String Descrip  {get; set;}
        String Status {get; set;}
        Boolean isClosed {get; set;}
        Integer Ctr {get; set;}
        Id AccountId {get; set;}
        Id TaskId {get; set;}
    }

    I then create a list called lstAhrecs of this classs

   

    List<Ahrec> lstAhrecs = new List<Ahrec>()

 

   My class list then gets populated from a SOQL query.

 

   What I want to do now is SORT the class list by ActivityDate DESCENDING.

 

   Can anyone show me code on how to do this?

   Thanks so much in advance!

 

 

 

and load the list from a SOQL query...

 

   What I would now like to do is SORT the list by ActivityDate in a descending order.

 

   List<Ahrec> mylist

 

 

I have the following code that simply gets Open Activities for a passed in Client Id list:

 

SELECT name,(SELECT id,ActivityDate,Description,Subject,IsClosed,CallType,CallDisposition,Status,ActivityType

FROM OpenActivities Where (ActivityDate > :myDate and ActivityDate <= :myDate2 ) Order by ActivityDate desc)

FROM Account Where Id = :myClientIdList';

 

I have a requirement to create a hyperlink that when the Subject info is clicked in my VF page, it will send the user to the Task panel so they can see the detail.

 

What I need is for each row returned from my SOQL, I need to get the Task Id to use in a hyperlink that when clicked will send the user back to

my Task panel for the Task Id selected. I am not seeing anywhere how to get the Task Id value. I can get the Account Id, and it's related OpenActivities Id, but am at a loss for how to link these to a task id.

 

Thanks in advance for any help!

Hi, I want to return the record count of a dynamic SOQL query, (checkVal is passed in so don't worry about that):

 

Public List<sObject> lstObj;

Public Integer totRecsToProcess;


mystr  = '[select count() from payout__ImportStaging__c where payout__BD_Id__c = \'' + String.escapeSingleQuotes(checkVal) ;

 lstObj = Database.query(mystr);

 

I want to set totRecsToProcess equal to the count() value returned, can someone please tell me the correct syntax for that?

 

Thanks.

 

 

 

 

I have the following query, but I need to order the results by ActivityDate in descending order.

 

SELECT (SELECT
         ActivityDate,
         Description,
         Subject,
         IsClosed,
         CallType,
         CallDisposition,
         Status,
         ActivityType
        FROM OpenActivities
        )
FROM Account

 

if I put order by ActivityDate desc like so:

 

SELECT (SELECT
         ActivityDate,
         Description,
         Subject,
         IsClosed,
         CallType,
         CallDisposition,
         Status,
         ActivityType
        FROM OpenActivities

        order by AcivityDate desc
        )
FROM Account

 

It comes out the same order as if I don't have any order by. Can anyone tell me how to get the order in the way I need it?

 

Thanks so much.

 

 

I have the following query, but I need to order the results by ActivityDate in descending order.

 

SELECT (SELECT
         ActivityDate,
         Description,
         Subject,
         IsClosed,
         CallType,
         CallDisposition,
         Status,
         ActivityType
        FROM OpenActivities
        )
FROM Account

 

if I put order by ActivityDate desc like so:

 

SELECT (SELECT
         ActivityDate,
         Description,
         Subject,
         IsClosed,
         CallType,
         CallDisposition,
         Status,
         ActivityType
        FROM OpenActivities

        order by AcivityDate desc
        )
FROM Account

 

It comes out the same order as if I don't have any order by. Can anyone tell me how to get the order in the way I need it?

 

Thanks so much.

 

 

I run the following:

 

List<Account> lstactivity = new List<Account> ([

SELECT (SELECT

         ActivityDate,

         Description,

         Subject,

         IsClosed,

         CallType,

         CallDisposition,

         Status,

         ActivityType

        FROM OpenActivities

        

        )

FROM Account

]

);

 

 

I get back the following when I System.Debug(a.OpenActivities):

 

21:36:28.082 (82119000)|USER_DEBUG|[107]|DEBUG|(OpenActivity:{IsClosed=false, Status=Not Started, Description=The Advisory Tiered Payout Rate for this Advisor has just changed., AccountId=001A000000nSc9XIAS, Subject=Adv Payout Tier Rate Change, ActivityType=1_, Id=00TA000000og6cJMAQ, ActivityDate=2012-11-15 00:00:00}, OpenActivity:{IsClosed=false, Status=Not Started, Description=The Advisory Tiered Payout Rate for this Advisor has just changed., AccountId=001A000000nSc9XIAS, Subject=Adv Payout Tier Rate Change, ActivityType=1_, Id=00TA000000og6c9MAA, ActivityDate=2012-11-15 00:00:00})

 

I want to loop through the OpenActivity Sobject and get the values of the fields.

Can anyone please tell me the SYNTAX for how I can retrieve the fields within the OpenActivity SObject?

 

Thanks soooo much for any help I am at a loss!

I run the following:

 

List<Account> lstactivity = new List<Account> ([

SELECT (SELECT

         ActivityDate,

         Description,

         Subject,

         IsClosed,

         CallType,

         CallDisposition,

         Status,

         ActivityType

        FROM OpenActivities

        

        )

FROM Account

]

);

 

 

I get back the following when I System.Debug(a.OpenActivities):

 

21:36:28.082 (82119000)|USER_DEBUG|[107]|DEBUG|(OpenActivity:{IsClosed=false, Status=Not Started, Description=The Advisory Tiered Payout Rate for this Advisor has just changed., AccountId=001A000000nSc9XIAS, Subject=Adv Payout Tier Rate Change, ActivityType=1_, Id=00TA000000og6cJMAQ, ActivityDate=2012-11-15 00:00:00}, OpenActivity:{IsClosed=false, Status=Not Started, Description=The Advisory Tiered Payout Rate for this Advisor has just changed., AccountId=001A000000nSc9XIAS, Subject=Adv Payout Tier Rate Change, ActivityType=1_, Id=00TA000000og6c9MAA, ActivityDate=2012-11-15 00:00:00})

 

I want to loop through the OpenActivity Sobject and get the values of the fields.

Can anyone please tell me the SYNTAX for how I can retrieve the fields within the OpenActivity SObject?

 

Thanks soooo much for any help I am at a loss!

I have an Apex Batch job that I use to load a huge transaction file... And the code is running fine.

But what I want to know is, from within the Batch Apex class, if I have objects I need to query that may result in > 50,000 rows coming
back what is the best practice for handling this.

I was hoping I could use the Database.QueryLocator because I know they don't have the 50,000 limit
and was thinking I could do something like this mapping:

       Database.QueryLocator qlSSN      = Database.getQueryLocator([SELECT Id,payout__SSN__c FROM Account]);
       for(Database.QueryLocator a : qlSSN)
       {
          mSSNKey.put(a.id,a.payout__SSN__c);
       }    

But this is not a valid approach. So how in Apex Batch, can you bring back a query that may be > 50,000.

Again, I am not talking about the DRIVER Apex Batch query being > 50,000 I am talking abount querying another Object from within the pocessing of the batch that may return over 50,000.

Thanks everyone.
 
I created the following custom field payout__ AH_DAY_RANGES__c with TWO custom setting values:
1. To_Days (Number)
2.From_Days (Number)

Now in my apex class, I simply want to set my date input fields to the current date +/- the custome values...

If(payout__ AH_DAY_RANGES__c.From_Days__c.getDescribe().getDefaultValue() != null)
{
            DateInput1.ActivityDate = System.Today() - payout__ AH_DAY_RANGES__c.From_Days__c.getDescribe().getDefaultValue();
}
 
 
If(payout__ AH_DAY_RANGES__c.To_Days__c.getDescribe().getDefaultValue() != null)
{
            DateInput2.ActivityDate = System.Today() + payout__ AH_DAY_RANGES__c.To_Days__c.getDescribe().getDefaultValue();
}

But I am getting an error because the data type of payout__ AH_DAY_RANGES__c.To_Days__c.getDescribe().getDefaultValue() is OBJECT and not what I expected it to be (Number). How can I make the datatype of payout__ AH_DAY_RANGES__c.To_Days__c.getDescribe().getDefaultValue() a NUMBER so I can use it in the System.Today() formula?
I have the following custom setting: Payout__AH_FromToDate__c
 
I created two values in the Custom Settings panel:
payout__AH_From_Date__c
payout__AH_To_Date__c
 
 
In my APEX Class code:
 
237        Date frmdte;
 238       Date todte;
 
   239     frmdte = payout__AH_FromToDate__c.getValues('payout__AH_From_Date__c');
    240    todte  = payout__AH_FromToDate__c.getValues('payout__AH_To_Date__c');
 
    241    DateInput1.ActivityDate  = frmdte;
     242   DateInput2.ActivityDate  = todte;
 
Error: Compile Error: Illegal assignment from SOBJECT:payout__AH_FromToDate__c to Date at line 239 column 9
 
Can someone help me out as to what I need to do so that I can assign frmdte and todte to my custom setting date values?
 
Thanks.
 
 
Ok, I am using the following two queries to obtain all Tasks/Events for a contact:

Select Accountid,Location ,Subject,Description,ActivityDate,ActivityDateTime from Event where Who.id ='003A000000KQcc1IAD'
Select Accountid,Status ,Subject,Description,ActivityDate,Priority,owner.name,isclosed from Task where Who.id ='003A000000KQcc1IAD'

How can I get the CATEGORY value that is displayed on the Open Activities Panel?... This field is not on either the Task or Event Object.
Does anyone know what the SOQL query would look like to create the results shown in the Open Activities section of the Salesforce inteface?

I have tried to replicate it, but don't know how to get a list of Open Acivities for a contact, if the Open Activity doesn't belong directly to the Contact's Account.

For example, for my case, in the Open Activities section I see:

Subject        Name           Related To
AAA            John Smith    John Smith
BBB            John Smith     John Smith
CCC            John Smith     CM-137 (Client Meeting)

In my SOQL I can't get the CCC John Smith CM-137 row to be returned in my query, because the Task is NOT related to my Contact John Smith.

I have no idea how SF is doing this, can anyone help with a SOQL query or some code that would accomplish this? Thanks



For example, if a task's what.id is NOT for the contact but for something else, like a Client Meeting, I still want this task to be inlcuded in my query for the
Hi,
Simply put, I want to retieve any OpenActivites and ActivityHistory rows for a passed Contact.id

My page is passed in the Contact's ID, I then:

I know I can't Select directly on the OpenAcivites/ActivityHistories objects... So I have something like this

SELECT id,(SELECT Who.name,What.name, payout__Category__c,ActivityDate FROM ActivityHistories Order by ActivityDate desc),(SELECT ActivityDate,who.name,what.name FROM OpenActivities Order by ActivityDate desc)
FROM Account Where Id in (SELECT Accountid from Contact where id = '003A000000MI9SJ')    

But this is NOT the correct query, because I am bringing back ALL OpenActivities/ActivityHistories for the ACCOUNT and not for JUST the Contact of that account. So how do I change my query so I just get the OpenActivities/ActivityHistories for the one Contact.id.

Thanks.

                    

 
Hi all,
The WhoId is always showing null for my query shown below, and I need to get the related CONTACT name for each Open Activity.
Can anyone tell me why the WhoId would not be getting populated and how I could get CONTACT names ?

select id, Name, 
       (SELECT Id,whoid,whatid,ownerid,payout__Category__c,ActivityDate,Description,Subject,IsClosed,CallType,CallDisposition,Status,ActivityType,IsTask    
FROM OpenActivities ) from Account where Name like '%Akers%'
 
[{"Id":"00TA000000lF8uQMAS","WhoId":null,"WhatId":"001A000000SMWrUIAX","OwnerId":"005A0000000JrNJIA0","payout__Category__c":null,"ActivityDate":"2012-08-16","Description":"The Investment Tiered Payout Rate for the Advisor has just changed.","Subject":"New Inv Tiered Payout Rate","IsClosed":false,"CallType":null,"CallDisposition":null,"Status":"Not Started","ActivityType":"1_","IsTask":true},{"Id":"00TA000000lF9IUMA0","WhoId":null,"WhatId":"001A000000SMWrUIAX","OwnerId":"005A0000000JrNJIA0","payout__Category__c":null,"ActivityDate":"2012-08-16","Description":"The Investment Tiered Payout Rate for the Advisor has just changed.","Subject":"New Inv Tiered Payout Rate","IsClosed":false,"CallType":null,"CallDisposition":null,"Status":"Not Started","ActivityType":"1_","IsTask":true}]
 
I have a scheduled Apex Batch Job that runs every hour. Is there any way to check using Apex code to see if the job is running?

Thanks.

I do the following query, to get BOTH closed activites and open ones:

 

SELECT name, id, (SELECT id,ActivityDate,Description,Subject,IsClosed,CallType,CallDisposition,Status,ActivityType

FROM ActivityHistories where isTask = true

 Order by ActivityDate desc

) ,

(SELECT id,ActivityDate,Description,Subject,IsClosed,CallType,CallDisposition,Status,ActivityType

FROM OpenActivities where isTask = true

 Order by ActivityDate desc

)

FROM Account where name like '%Abseck%'

 

The query results are saved in lstactivity

 

I am trying to loop thru and get at the ActivityHistories info

for(Account a : lstactivity)

{

 

   for(ActivityHistory t : a.ActivityHistories)

   {

       System.debug(t.ActivityDate);

   }

}

 

I am getting an error that t.ActivityDate doesn't exist.

am I referencing ActivityHistories correctly in the loop?..I wasn't sure what to use for the names

 

 

When I do it for OpenActivities it works...

for(Account a : lstactivity)

{

 

   for(OpenActivity t : a.OpenActivities)

   {

       System.debug(t.ActivityDate);

   }

}

 

Please hlep!... Thanks in advance.

 

I have the following code that simply gets Open Activities for a passed in Client Id list:

 

SELECT name,(SELECT id,ActivityDate,Description,Subject,IsClosed,CallType,CallDisposition,Status,ActivityType

FROM OpenActivities Where (ActivityDate > :myDate and ActivityDate <= :myDate2 ) Order by ActivityDate desc)

FROM Account Where Id = :myClientIdList';

 

I have a requirement to create a hyperlink that when the Subject info is clicked in my VF page, it will send the user to the Task panel so they can see the detail.

 

What I need is for each row returned from my SOQL, I need to get the Task Id to use in a hyperlink that when clicked will send the user back to

my Task panel for the Task Id selected. I am not seeing anywhere how to get the Task Id value. I can get the Account Id, and it's related OpenActivities Id, but am at a loss for how to link these to a task id.

 

Thanks in advance for any help!

Hi, I want to return the record count of a dynamic SOQL query, (checkVal is passed in so don't worry about that):

 

Public List<sObject> lstObj;

Public Integer totRecsToProcess;


mystr  = '[select count() from payout__ImportStaging__c where payout__BD_Id__c = \'' + String.escapeSingleQuotes(checkVal) ;

 lstObj = Database.query(mystr);

 

I want to set totRecsToProcess equal to the count() value returned, can someone please tell me the correct syntax for that?

 

Thanks.

 

 

 

 

I run the following:

 

List<Account> lstactivity = new List<Account> ([

SELECT (SELECT

         ActivityDate,

         Description,

         Subject,

         IsClosed,

         CallType,

         CallDisposition,

         Status,

         ActivityType

        FROM OpenActivities

        

        )

FROM Account

]

);

 

 

I get back the following when I System.Debug(a.OpenActivities):

 

21:36:28.082 (82119000)|USER_DEBUG|[107]|DEBUG|(OpenActivity:{IsClosed=false, Status=Not Started, Description=The Advisory Tiered Payout Rate for this Advisor has just changed., AccountId=001A000000nSc9XIAS, Subject=Adv Payout Tier Rate Change, ActivityType=1_, Id=00TA000000og6cJMAQ, ActivityDate=2012-11-15 00:00:00}, OpenActivity:{IsClosed=false, Status=Not Started, Description=The Advisory Tiered Payout Rate for this Advisor has just changed., AccountId=001A000000nSc9XIAS, Subject=Adv Payout Tier Rate Change, ActivityType=1_, Id=00TA000000og6c9MAA, ActivityDate=2012-11-15 00:00:00})

 

I want to loop through the OpenActivity Sobject and get the values of the fields.

Can anyone please tell me the SYNTAX for how I can retrieve the fields within the OpenActivity SObject?

 

Thanks soooo much for any help I am at a loss!

Hi guys, running the SOQL query below, and when I look at the Debug message that comes back I can see the OpenActivities object and

all the fileds in my SELECT statement. Now I would like to know the SYNTAX of how to get at the individual columns of the OpenActivities

result.

 

I tried something like this:

system.debug(a.OpenActivities.ActivityDate); - causes an error

 

So what is the correct syntax for getting at the ActivityDate value?

 

 

List<Account> lstactivity = new List<Account> ([
SELECT (SELECT
         ActivityDate,
         Description,
         Subject,
         IsClosed,
         CallType,
         CallDisposition,
         Status,
         ActivityType
        FROM OpenActivities
         
        )
FROM Account
]
);


for (Account a: lstactivity) {
     //msg = a.OpenActivities.status;
    system.debug(a.OpenActivities);
}

I cloned a class and ran my test class against BOTH the original and the cloned version.

 

The original says I have 48% coverage, the clone says 80%. The reason for the difference is that the original (managed code) says that the number of lines to test coverage for is 1036 and the cloned version (unmanaged code) says I have 612 lines to test.

 

My question now is, what is the difference when performing Test coverage on MANAGED vs UNMANAGED code?

 

Thanks!

I have no idea what is causing this, but...

 

I used to be able to go to Apex Classes, and then  click the link that showed what percent of the code has been tested. Once clicked I could see in red what hasn’t been tested. Now when I do it, a blank page comes up and I have no idea what needs to be tested.

 

Any ideas?.... I have logged out/ logged in multiple times same issue. Tried in IE and Firefox.