• SalesforceJim
  • NEWBIE
  • 0 Points
  • Member since 2009

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

hi,

 

I am interested to know if anyone has been able to set up an SMTP appender in the log-conf file for the Data Loader.

 

I have managed to get the Data loader to run wihout error by downloading some additional jar files and adding these manually to the class path in the process.bat file, including the java mailapi, but although the data loader now does not error, the SMTP appender does not send any messages. I am running the data loader against a set of Accounts which I know will trigger errors in the system they are being uploaded to and I can see these in the standard sdl log file.

 

What I want to be able to do is alert specific users of errors in the log file without having to implement a separate monitoring process.

 

The machine on which the Data Loader is runnig has permissions on the SMTP Server it is trying to send from and I have run a test email to verify this.

 

Thanks

Hi,

 

I am trying to writh a dymanic class method, which would allow me to pass the sObject and field name as parameters in order to return the value from a single field. I have found the reverences to dynamic SOQL in the apex docs and am able to run a dynamic query to return an sObject which represents a single record of an Account type.

 

What I am having trouble with is then how to extract the field from that sObject (using the dynamic reference to the field name passed to the method) and return this out of the method as a string.

 

 

 

This is my current class method. At the moment, it is only dynamic for the field, and the sObject is hard-coded as being an Account. I have tried using the DescribeFieldResult method but believe this is not the correct approach.

 

private Object getObject(Id i, String s){

 

String r;

String sQuery = 'SELECT Id,' + s + 'FROM Account WHERE Id:= id';

Account a = Database.query(sQuery);

// Schema.DescribeFieldResult f = Schema.sObjectType.Account.fields.AS400_ID__c;

//Schema.DescribeFieldResult f = Account.AS400_ID__c.getDescribe();

//r = f.getDefaultValue();

return r;

}

 

Thanks

 

Jim

Hi, I am relatively new to Apex and have a query regaring accessing string values from and sObject.

 

I am trying to return all of the records in a custom object which essentially has two picklist fields Office and RLT and place the results into a map.

 

To do this I am using a for loop to iterate through the records in my custom sObject.

 

The problem I have is how to return the field Object for each iteration of the for loop and how to get that object as a string, so I can put it into the map.

 

Also my use of the DescribeFieldResult is invalid.

 

My code is as follows: 

 

for (Offices__c O : [SELECT Office__c, RLT__c FROM Offices__c]) {

 

Schema.DescribeFieldResult fOffice = Offices_c.Office_c.getDescribe();

String sOffice;

sOffice = fOffice.getDefaultValue();

 

Schema.DescribeFieldResult fRLT = Offices_c.RLT_c.getDescribe();

String sRLT;

sRLT = fRLT.getDefaultValue();

 

OfficeRLTMapping.put(sOffice,sRLT);

}

 

Thanks

 

Jim

Hi,

 

I am trying to writh a dymanic class method, which would allow me to pass the sObject and field name as parameters in order to return the value from a single field. I have found the reverences to dynamic SOQL in the apex docs and am able to run a dynamic query to return an sObject which represents a single record of an Account type.

 

What I am having trouble with is then how to extract the field from that sObject (using the dynamic reference to the field name passed to the method) and return this out of the method as a string.

 

 

 

This is my current class method. At the moment, it is only dynamic for the field, and the sObject is hard-coded as being an Account. I have tried using the DescribeFieldResult method but believe this is not the correct approach.

 

private Object getObject(Id i, String s){

 

String r;

String sQuery = 'SELECT Id,' + s + 'FROM Account WHERE Id:= id';

Account a = Database.query(sQuery);

// Schema.DescribeFieldResult f = Schema.sObjectType.Account.fields.AS400_ID__c;

//Schema.DescribeFieldResult f = Account.AS400_ID__c.getDescribe();

//r = f.getDefaultValue();

return r;

}

 

Thanks

 

Jim

Hi, I am relatively new to Apex and have a query regaring accessing string values from and sObject.

 

I am trying to return all of the records in a custom object which essentially has two picklist fields Office and RLT and place the results into a map.

 

To do this I am using a for loop to iterate through the records in my custom sObject.

 

The problem I have is how to return the field Object for each iteration of the for loop and how to get that object as a string, so I can put it into the map.

 

Also my use of the DescribeFieldResult is invalid.

 

My code is as follows: 

 

for (Offices__c O : [SELECT Office__c, RLT__c FROM Offices__c]) {

 

Schema.DescribeFieldResult fOffice = Offices_c.Office_c.getDescribe();

String sOffice;

sOffice = fOffice.getDefaultValue();

 

Schema.DescribeFieldResult fRLT = Offices_c.RLT_c.getDescribe();

String sRLT;

sRLT = fRLT.getDefaultValue();

 

OfficeRLTMapping.put(sOffice,sRLT);

}

 

Thanks

 

Jim

I want to create a CLI configuration of Data Loader. Everything works fine except that we want to handle errors in two different ways.

1- For operational errors such as login error, network errors, proxy errors, we want an email notification to be sent to the System Admin.
2- For Data Errors, such as Insert or Update errors, we want to send an email to the record owner. Also we have some acceptable error for which we don't need to send emails, so we want to exclude them from the notification.
So here are my questions,

1- I changed the log-conf.xml file to include SMTP Appender but the problem is that both types of errors above have the same log4j level "ERROR" so I cannot distinguish between the two to create different SMTP Appender for each. How can I achieve that using log4j configuration.
2- Is it possible in After Insert, After Update triggers to access the transaction results? I am thinking of creating a trigger that check these errors, process them and notify owner with them.
3- Is there any better way to do that? I will appreciate any suggestions.

Thanks in advance.
Aref