• Pal2011
  • NEWBIE
  • 35 Points
  • Member since 2011

  • Chatter
    Feed
  • 1
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 19
    Questions
  • 25
    Replies

Hi,

 

How do I create batch apeax with visualforce page as an email template?

 

Thanks,

Hi,

 

How can I create a batch apex to send an email with email template created in Visualfore page?

 

Thanks,

Has anyone noticed difference on "Apex Test Execution" after Spring '13 release?

 

Some of my Unit Test classes execute successfully on the eclipse. But, the same classes are failing, when I tried to run them from  "Run AllTest".

 

 

HI,

 

I'm trying to import Account data using command-line with Data Loader. I've also setup proxy information on my process.config file.

sfdc.proxyHost=host
sfdc.proxyPort=8080
sfdc.proxyUser=username
sfdc.proxyPassword=encrypted proxy password
sfdc.proxyntlmdomain=na

 

However, I'm getting following error, when I try to execute an import:

 

2012-12-10 12:30:52,175 INFO  [main] controller.Controller initLog (Controller.java:388) - The log has been initialized
2012-12-10 12:30:52,191 INFO  [main] controller.Controller initConfig (Controller.java:326) - config dir created at C:\ApexDataLoadConf\SAPNAFTAAccountImport
2012-12-10 12:30:52,738 INFO  [main] controller.Controller initConfig (Controller.java:354) - The controller config has been initialized
2012-12-10 12:30:52,738 INFO  [main] process.ProcessRunner run (ProcessRunner.java:116) - Initializing process engine
2012-12-10 12:30:52,738 INFO  [main] process.ProcessRunner run (ProcessRunner.java:119) - Loading parameters
2012-12-10 12:30:52,738 INFO  [main] config.LastRun load (LastRun.java:96) - Last run info will be saved in file: C:\ApexDataLoadConf\SAPNAFTAAccountImport\null_lastRun.properties
2012-12-10 12:30:52,753 INFO  [main] process.ProcessRunner run (ProcessRunner.java:127) - Logging in to: https://login.salesforce.com
2012-12-10 12:30:52,769 INFO  [main] client.PartnerClient login (PartnerClient.java:478) - Beginning Partner Salesforce login ....
2012-12-10 12:30:52,769 INFO  [main] client.ClientBase getConnectorConfig (ClientBase.java:123) - Salesforce login will use proxy host: 10.180.100.99 port: 8080
2012-12-10 12:30:52,784 INFO  [main] client.PartnerClient loginInternal (PartnerClient.java:519) - Salesforce login to https://login.salesforce.com/services/Soap/u/26.0 as user qtcasupport@11trialforce.com
2012-12-10 12:30:54,488 WARN  [main] protocol.RequestAuthenticationBase process (RequestAuthenticationBase.java:88) - NTLM authentication error: Credentials cannot be used for NTLM authentication: org.apache.http.auth.UsernamePasswordCredentials
2012-12-10 12:30:56,206 ERROR [main] client.PartnerClient runOperation (PartnerClient.java:332) - Error while calling web service operation: login, error was: Unexpected element. Parser was expecting element 'http://schemas.xmlsoap.org/soap/envelope/:Envelope' but found ':HTML'
com.sforce.ws.ConnectionException: Unexpected element. Parser was expecting element 'http://schemas.xmlsoap.org/soap/envelope/:Envelope' but found ':HTML'
 at com.sforce.ws.bind.TypeMapper.verifyTag(TypeMapper.java:386)
 at com.sforce.ws.transport.SoapConnection.readSoapEnvelopeStart(SoapConnection.java:250)
 at com.sforce.ws.transport.SoapConnection.createException(SoapConnection.java:179)
 at com.sforce.ws.transport.SoapConnection.receive(SoapConnection.java:149)
 at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:98)
 at com.sforce.soap.partner.PartnerConnection.login(PartnerConnection.java:1009)
 at com.salesforce.dataloader.client.PartnerClient$8.run(PartnerClient.java:161)
 at com.salesforce.dataloader.client.PartnerClient$8.run(PartnerClient.java:152)
 at com.salesforce.dataloader.client.PartnerClient.runOperation(PartnerClient.java:328)
 at com.salesforce.dataloader.client.PartnerClient.loginInternal(PartnerClient.java:520)
 at com.salesforce.dataloader.client.PartnerClient.login(PartnerClient.java:488)
 at com.salesforce.dataloader.client.PartnerClient.connect(PartnerClient.java:213)
 at com.salesforce.dataloader.controller.Controller.login(Controller.java:172)
 at com.salesforce.dataloader.controller.Controller.login(Controller.java:167)
 at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:128)
 at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:100)
 at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.java:253)
2012-12-10 12:30:56,206 ERROR [main] client.PartnerClient loginInternal (PartnerClient.java:534) - Error while logging in to web service at: https://login.salesforce.com/services/Soap/u/26.0, error was: Unexpected element. Parser was expecting element 'http://schemas.xmlsoap.org/soap/envelope/:Envelope' but found ':HTML'
com.sforce.ws.ConnectionException: Unexpected element. Parser was expecting element 'http://schemas.xmlsoap.org/soap/envelope/:Envelope' but found ':HTML'
 at com.sforce.ws.bind.TypeMapper.verifyTag(TypeMapper.java:386)
 at com.sforce.ws.transport.SoapConnection.readSoapEnvelopeStart(SoapConnection.java:250)
 at com.sforce.ws.transport.SoapConnection.createException(SoapConnection.java:179)
 at com.sforce.ws.transport.SoapConnection.receive(SoapConnection.java:149)
 at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:98)
 at com.sforce.soap.partner.PartnerConnection.login(PartnerConnection.java:1009)
 at com.salesforce.dataloader.client.PartnerClient$8.run(PartnerClient.java:161)
 at com.salesforce.dataloader.client.PartnerClient$8.run(PartnerClient.java:152)
 at com.salesforce.dataloader.client.PartnerClient.runOperation(PartnerClient.java:328)
 at com.salesforce.dataloader.client.PartnerClient.loginInternal(PartnerClient.java:520)
 at com.salesforce.dataloader.client.PartnerClient.login(PartnerClient.java:488)
 at com.salesforce.dataloader.client.PartnerClient.connect(PartnerClient.java:213)
 at com.salesforce.dataloader.controller.Controller.login(Controller.java:172)
 at com.salesforce.dataloader.controller.Controller.login(Controller.java:167)
 at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:128)
 at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:100)
 at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.java:253)
2012-12-10 12:30:56,206 FATAL [main] process.ProcessRunner topLevelError (ProcessRunner.java:238) - Unable to run process null
java.lang.RuntimeException: com.sforce.ws.ConnectionException: Unexpected element. Parser was expecting element 'http://schemas.xmlsoap.org/soap/envelope/:Envelope' but found ':HTML'
 at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:162)
 at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:100)
 at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.java:253)
Caused by: com.sforce.ws.ConnectionException: Unexpected element. Parser was expecting element 'http://schemas.xmlsoap.org/soap/envelope/:Envelope' but found ':HTML'
 at com.sforce.ws.bind.TypeMapper.verifyTag(TypeMapper.java:386)
 at com.sforce.ws.transport.SoapConnection.readSoapEnvelopeStart(SoapConnection.java:250)
 at com.sforce.ws.transport.SoapConnection.createException(SoapConnection.java:179)
 at com.sforce.ws.transport.SoapConnection.receive(SoapConnection.java:149)
 at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:98)
 at com.sforce.soap.partner.PartnerConnection.login(PartnerConnection.java:1009)
 at com.salesforce.dataloader.client.PartnerClient$8.run(PartnerClient.java:161)
 at com.salesforce.dataloader.client.PartnerClient$8.run(PartnerClient.java:152)
 at com.salesforce.dataloader.client.PartnerClient.runOperation(PartnerClient.java:328)
 at com.salesforce.dataloader.client.PartnerClient.loginInternal(PartnerClient.java:520)
 at com.salesforce.dataloader.client.PartnerClient.login(PartnerClient.java:488)
 at com.salesforce.dataloader.client.PartnerClient.connect(PartnerClient.java:213)
 at com.salesforce.dataloader.controller.Controller.login(Controller.java:172)
 at com.salesforce.dataloader.controller.Controller.login(Controller.java:167)
 at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:128)
 ... 2 more

 

Can you please help me with this issue?

 

Thanks,

 

Hi,


Where can I find Salesforce.com coding standards document?

 

Thanks,

Hi,

 

Is it possible to retrieve State information from Account Site field usign SOQL?

 

Thanks,

  • September 25, 2012
  • Like
  • 0

Hi,

 

Is it possible to view a Visualforce page added as a section under the account on Salesforce Mobile App?

 

Thanks

  • September 25, 2012
  • Like
  • 0

HI,

 

I've installed "Account Hiererachy" app from the AppExchange. Is it possible to see account hierarchy visualforce page on Salesforce mobile App?

 

Thanks

  • September 25, 2012
  • Like
  • 0

Hi,

 

How can I render pageblocksection "title" dynamically?

 

Example:

<apex:pageBlockSection id="RD"title="Registration Details"columns="1">

 

Is it possible to change "Registration Details" to "Registration Details 1", based on the parameters getting on the URL?

 

Thanks,

 

Hi,

 

I would like to create Web-to-Case in my Salesforce.com instance, from the web page hosted under my company's website. Is it possible to add an attachment too?

 

Any help would be greatly appreciated.

 

Thanks.

Hi,

 

I would like to create Web-to-Case in my Salesforce.com instance, from the web page hosted under my company's website. Is it possible to add an attachment too?

 

Any help would be greatly appreciated.

 

Thanks.

I need to create a weservice in apex which will be called by external system. External system can call web service created in salesforce and send an XML file with accounts/contacts data to insert.

 

Can anybody help me how to achieve this using API?

 

Thanks

Hi,

 

I'm very new to Apex development. I need to import records using Salesforce.com API. I'm having an XML file coming out from SAP which has accounts record with different field information as an attribute. I need to create a webservice on salesforce.com side which will retrieve an XML file coming out from SAP, parse an XML, and insert an account record if record doesn't exist in the database.

 

I looked in to an Apex developer's guide in order to create a webservice and making call outs, but I'm still not clear how to do this.

 

Can anyone help me with some example code?

 

Thanks.

Hi,

 

I'm trying to login into the sandbox via Excel connector.  I'm also appending security token at the end of the password. But, I'm getting INVALID_LOGIN: Invalid username, password, security token; or user locked out. ExceptionCode: 5078

 

Can anybody tell me what am I doing wrong here?

Hi,

 

I'm very new to the Cloud Development.

 

Mentioned below are the user information:

Profile: Standard user (custom profile) - with 'Read All' and 'Modify All' privileges

Role falls under System Administrator->Manager->Standard User

OWD for Case (Standard object) - Private,

Case sharing rule : Owner in Role and Subordinates: System Administrator is shared with Role and Subordinates: System Administrator - Read/Write on Case, Owner in All internal User is shared with All internal User - Read/Write

 

Now, my question is case created by manager will be seen by Standard user or not as they have 'Read All' and 'Modify All' privileges on their profile?

 

Thanks,

 

 

Hi,

 

I've created one child object called Rebate which has Master-Detail relationship with Account object. In my Batch Apex I'm trying to access related list of Rebate object on an Account object.

 

Here is my SOQL query:

Select (Select Id, Owner__c, Year__c From Account_Rebates__r) From Account a

 

When I'm running this query on salesforce.schema browser, I'm not getting any record but what I'm getting is red square.  I'm not sure what is going wrong on my end.

 

Can you please help me with this?

 

Thanks.

Hi,

 

I'm new to the Apex programming.

 

How can I send an Email alerts on particular date of every month using Batch Apex?

 

Thanks!

Why am I not able to see Currency sign(CurrencyIsoCode) on Opportunity Amount field to my mobile while I can see that inside salesforce.com?

 

Thanks

Why am I not able to see Currency sign(CurrencyIsoCode) on Opportunity Amount field to my mobile while I can see that inside salesforce.com?

Hi,

 

I'm new to the Apex programming.

 

How can I send an Email alerts on particular date of every month using Batch Apex?

 

Thanks!

Hi,


Where can I find Salesforce.com coding standards document?

 

Thanks,

Hi,

 

How can I render pageblocksection "title" dynamically?

 

Example:

<apex:pageBlockSection id="RD"title="Registration Details"columns="1">

 

Is it possible to change "Registration Details" to "Registration Details 1", based on the parameters getting on the URL?

 

Thanks,

 

Hi,

 

I would like to create Web-to-Case in my Salesforce.com instance, from the web page hosted under my company's website. Is it possible to add an attachment too?

 

Any help would be greatly appreciated.

 

Thanks.

Hi,

 

I would like to create Web-to-Case in my Salesforce.com instance, from the web page hosted under my company's website. Is it possible to add an attachment too?

 

Any help would be greatly appreciated.

 

Thanks.

We are trying to create a Custom HTML email template. We have followed the instructions from  "Creating HTML Email Templates". The problem is trying to add images to our new custom email template. We have loaded all of the images into a "Document" folder, however we don't know how to reference where these images are stored.

 

The example given is confusing.

<img src="https://na2.salesforce.com/servlet/servlet.ImageServer? id=015D0000000Dpwc&oid=00DD0000000FHaG&lastMod=1270576568000" alt="Company Logo" height="64" width="64"/>

 

What should we do to reference our specific images?

What folder should we upload the images to. We have a custom html template and all we need is to be able to upload the images (changing the "img src" will be easy once we know where that folder with images is) 

 

Thank you

I'm not very well versed with webservices and I had a question about integrating (pulling data from an external system and pushing into Salesforce).

 

There is an external .NET application that retrieves data from an Accounting system real time.  My question is if it is possible to create a Salesforce webservice that the external .NET application can call whenever it gets new data from the accounting system and then push that data into Salesforce.

 

I know there are tools like Informatica, DBAmp that can do this type of thing as well.  The requirements are looking for a different route to handle this process.

 

Is there a way to accomplish this?  What are the options?  Any Salesforce articles discussing how to do this?

 

Thanks for any help!

Hi Folks,

                    I have created a batch apex and i would like run it for every hour of every day

 

 my btach apex class is as follows:

 

global class ReassignAccountOwner implements Database.Batchable<SObject>{

String query;
String email;
id fromUser;
id toUser;
       global ReassignAccountOwner(String q,string e,Id fu,Id tu){
           query=q;email=e;fromUser=fu;toUser=tu;
       }

       global Database.querylocator start(Database.BatchableContext bc){
        //return Database.querylocator(query);
           return Database.getQueryLocator(query);
       }
       global void execute(Database.BatchableContext bc,List<Sobject> scope){
        list<Account> accList = new list<Account>();
           for(Sobject s:scope){
               Account acc=(Account)s;
               if(acc.ownerId==fromUser){
                acc.ownerId=touser;
                accList.add(acc);
               }
           }
           update accList;
         
       }
       global void finish(Database.BatchableContext bc){
           Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
           mail.setToAddresses(new String[] {email});
           mail.setReplyTO('anyemail@anyemaill.com');
           mail.setSubject('Batch completed successfully');
           mail.setsenderdisplayName('SFDC Admin');
           mail.setPlainTextBody('Batch Process Completed!!');
           Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
        }    
      
}

 

My SChedular class:

 

global class RunBatch_ReassignAccountOwner implements Schedulable{

User toUser=[select id,name,email from user where username='abc@abcexample.com'];
User fromUser=[select id,name,email from user where username='def@defexample.com'];
String q='select id,ownerid from Account where ownerId=\''+fromUser.id+'\'';
String email='admin@adminexample.com';

global void execute(schedulablecontext sc){
ReassignAccountOwner reAssign = new ReassignAccountOwner (q,email,fromUser.id,touser.id);
ID batchprocessid = Database.executeBatch(reAssign);
}


}

 

Here i have added the batch class to the class 'RunBatch_ReassignAccountOwner '  that implements  schedulable interface  and here how to mention the time interval so batch class should run for every hour.

 

Thanks.

 

 

Hello everyone,

 

I'm having an issue migrating data into a Force.com org. I'm trying to import [user.csv] data that I exported from and old Force.com org trial edition into a new Force.com org via .csv files & 'Apex Data Loader' my problem is that when I attempt to 'insert' the CSV into my new Force.com org and map the fields I get the 'Invalid Cross Reference ID' error for every user that I was attempting to import into the org. I've done some research and I believe that this error is referring to the 'Profile ID' of the users I'm trying to import. It seems that you cannot import data that you exported from one org to another without first_____? That's where I need assistance. Any advice is appreciated.

  • August 19, 2011
  • Like
  • 0

Hi

 

i have a scenario about trigger to run the batch apex,

 

can anyone suggest me how to do that..

 

here is the scenario...

 

 

we have a batch apex in our sandbox, currently we running that batch manually.

 

we have an object called Integration Updates, in that object we have a picklist field called Status. when the Informatica daily load are completed they will insert one record into integration updates object and put the status value to "INFA Load Completed" and save the record.

 

based on the that status field value trigger(after insert or after update) will fire and run the batch apex. once batch apex completed based on that  we have to update the status field to "Batch Apex Completed".

 

i have completed the trigger till batch apex to run. i could not able to find any solution that how to update the status field value to "Batch Apex Compelted". 

 

here is the code that i wrote..

 

trigger RunBatchApexProcess on Integration_Update__c (after insert, after update) {
  
  for(Integration_Update__c intgupdate : Trigger.new){
     
     if(intgupdate.Status__c=='INFA Load Completed'){
              
        UnitIntegrationUpdates obj = new UnitIntegrationUpdates();
        ID batchId = Database.executebatch(obj,100);
    
     }
   }     
}

 

can anyone suggest me the extension code for this..

 

 

thanks in advance...

Hello.  I'm fairly new to the web services aspects of force.com.  I have a client with a PHP/MySQL e-commerce system.  He wants to push new customer info and new transactions in an XML file to Salesforce on a regular basis.

I thought the solution would be to create a web service that exposes a Dom.Document variable for the XML data.  However, I get an IDE error "can not have a WebService scope because its type is not valid."

I presume then the only way to do this is to define an object in the webservice and send my client the WSDL.  Instead of submitting an XML file, he'll have to  submit the data as the webservice object.

Am I on the right track with that?

Thanks

David

Have a visual force email template below:

 

<messaging:emailTemplate subject="{!$Label.Action_Alert_Subject}" recipientType="User" language="{!recipient.LanguageLocaleKey}" relatedToType="User">
<messaging:plainTextEmailBody >
<apex:repeat value="{!relatedTo.Action_Alerts__r}" var="alert">
<apex:outputText value="{!alert.Count__c}"/>
<c:NewLine />
</apex:repeat>
</messaging:plainTextEmailBody>
</messaging:emailTemplate>

 I have three records owned by a User and when I use the "Send and verify" on the email template, i see the 3 records merged in the final email However when I send the email via apex email from an apex batch the 3 records don't get merged. 

 

 

Tried changing the owner of hte related records to the user executing the batch but it still did'nt work. Any ideas would be much appreciated.

I have a client that wants to send automated emails (that have to be done through Apex) based on specific dates. For example:

 

  • Send an eMail 2 days before the 'Close Date'
  • Send an eMail once per week between the Start Date and Close Date

 

Unfortunately I can't use standard time-dependent workflows because the eMails they want to send cannot be sent through the normal email process (apex needed to build the email).

 

My original thought was to use a Time-Dependent Workflow rule to initiate the eMail, however that has two problems:

 

  1. Can't send an Outbound Message to an Apex class
  2. Can't find a way to repeat a message every week between two dates

 

I thought about using a Trigger to schedule an Apex job, but you cannot schedule more than 10 classes at the same time, which I think means I could not have more then 10 records scheduled for an eMail (there could potentially be hundreds). Or, does this really mean that a single class can be scheduled multiple times, but no more than 10 different classes can be scheduled?

 

Anyway, not sure the best way to make this happen without writing a great deal of custom code. I really wanted to give the client as much control  as possible using Workflow Rules, but that option is looking doubtful. 

 

I'm curious how others would handle this need.

 

Thanks,

 

Mike

I have a situation where I'm using a time-based workflow to update the owner field in a record.  After the owner field is updated an update trigger fires and that's working ok.

 

The problem is, I want a new time-based workflow to fire off from the field changes in the record that the trigger makes and that doesn't happen.

 

When I edit the owner manually, instead of having the original workflow doing the owner update, the trigger does fire the new time-based workflow.  It just doesn't occur when a previous workflow does the update.

 

I've tried both before and after update events and they have the same behavior.

 

Looking at the order of execution, it appears workflow rules should be evaluated after the trigger fires.  Is there a reason workflows don't fire when another time-based workflow action caused the trigger to fire?

Hi All,

 

In the Case object I have a field called Case Assignee. This is a field lookup to User. 

 

Following is my requirement:

 

I want to create a view with the criteria as Case Owner is the Current logged in user  and Case Assignee is not the current logged in user.

 

I am not able to identify how do I give this condition in the criteria.

 

Any suggestion on this will be helpful.

 

Thanks

Arvind

Hi all,

 

I am trying to build a formula in opportunities that will be used in a report to report on opportunities with a close date in the last three months (from last month).

 

So for example if I look at the report today I will see oppties from June, May & April and when I look at the same report on the 2nd August, I will see July, June & May.

 

I've been looking at constructing it based on the last day of the previous month -90 but need to consider the number of days in each month etc.  

 

Then I thought maybe it would be done with month numbers - 3 each time.  

 

Any examples you may have used would be much appreciated.

 

Many thanks,

James 

  • July 27, 2009
  • Like
  • 0
Hello friends,
 
We have a requirement where we need to create a workflow rule where we need to send an Email to some receipent in Cc though an Email Alert workflow action.
 
Is it possible to send such mails through a workflow action?
 
Kindly suggest if there is any way of sending a mail to aperson in Cc....
 
Thanks and Regards
Cool_D
My scenario is slightly different - and I'm wondering if you can help. I am trying to calculate the age of an "Open" lead. I found some in the sample formulas - If(ISPICKVAL(Status, "Open"), Round(NOW()-CreatedDate,0),Null) but - an "open date" could be after the create date. I thought perhaps using last modified would help- but that wouldn't do it. Is there a date field associated with Lead History? Thoughts?
  • March 22, 2007
  • Like
  • 0

I would like to import some data into custom objects I have created. Is this possible through the salesforce.com interface, or do I need to use the API and create my own import program?

Thanks,

Tym.

  • January 28, 2004
  • Like
  • 0