• nishanth0208
  • NEWBIE
  • 105 Points
  • Member since 2010

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

Hello All,

I 'd an issue regarding sending emails using singleemailmessage class. Heard that we can send 10 * 1000 = 10000 emails per execution (10 arrays, each array to accomodate 1000 emails). Is this true?

But i am unable to send more than 10 emails. Could anyone plz clarify me how to do. PFB my code snippet:

 

            }

for(Permit__c p:permitList){
                 Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage(); 
                                    String subject = p.Name+' | '+p.Region__c+' | '+p.Full_State__c+' | '+p.Channel__c+' | Status=Expired';
                                    email.setSubject(subject);
                                    String emailadd = 'abc@xyz.com';
                                    String[] toAddresses = emailadd.split(',');
                                    email.setToAddresses(toAddresses);
                                    email.setHTMLBody( 'email body.' );
                 Messaging.SendEmailResult[] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email}); 

 

 

An error is being thrown when 10 mails are sent and is about to send 11th email.

Plz help!

Dear All,

I 'd written apex code to send an email using singleemailmessage class. 

While sending this email i want to change the FROM ADDRESS. ByDefault, it is using the user's email id. but i want to set it to 'alerts@companyname.com'. 

Can i change the from address to achieve this?

 

Please share info!

 

thanx.

Hello All,

I 've a requirement in current assignment that, a user with profile other than sys admin should be able to schedule apex. I logged into Salesforce using that user's credentials. I can see 'SCHEDULE APEX' button, but not working. It is reproting 'INSUFFICIENT PREVILAGES' error. 

Could anyone please help?

 

Thanks In advance!

Hello All,

Is there a way in SFDC to store variables data in sessions or in browser cookies?

please help.

Thanks.

Hi All,

Is there a way to detect a particular record whether it was uploaded from Data loader or inserted through standard SF layout?

Hi All,

I had this req in my current project. I 've an array which is built in Apex controller.

Say, Integer[] a;

i have values like a[0]=11; a[1]=90; a[2]=45; .........so on.

Now, i want to iterate this array from javascript function.

I tried something like this:

 

<script type="text/javascript">

try{

  for(var i=0;i<20;i++){

       var v="{!pwL.a[i]}";        // PROBLEM OCCURS HERE. IT IS CONSIDERING " i " as "i" only. but not like an integer, i=0,1,2....so on

       alert(v);

}

}catch(e){

alert('eeee:'+e);

}

</script> 
Now, in the above snippet, i had an object pwL which consists of array "a".

Now, if i want to iterate through the array, it is throwing me an error as UNKNOWN PROPERTY i.

Seems, it is not able to interpret that   var v="{!pwL.a[i]}";   means  var v="{!pwL.a[0]}";   when i=0.

I want to pass the "i" value and get the value in that array with this index.

 

Hope, i made you clear!

Please help me out!

 

Thx.


Hi,

In the page i am currently working for, i need Account Teams to be placed as related list. I dont need any other related list.

In order to achieve this, i tried 

<apex:relatedlist list="Accountteams"/>

But its throwing me an error:

'Accountteams' is not a valid child relationship name for entity Account.

 

Please suggest me, how to acheive this?

 

Thanks In Advance,

Nishanth.

Hi All,

In the code pasted below, i need to avoid the query in the for loop. My Intention is to pick up one record per id(per each UniqueId). To achieve this i have to place the query in a for loop which will hit the governer limits(max SOQL query 100) if number of accounts are more. So, is there a way of getting one record (already mentioned in query as LIMIT 1) per account id without looping through each account id(eachUniqueId).

Please help me out.

 

Thanks in advance,

Nishanth.

 

Here goes my code:

------------------

List<Account> updatableAccountList = new List<Account>();

for(Id eachUniqueId:uniqueIdList){

List<Task> tasksPerId = [Select WhatId,Status,ActivityDate from Task where ActivityDate>today and WhatId =: eachUniqueId and Status != 'Completed' ORDER BY ActivityDate ASC NULLS last LIMIT 1];

Account acc = new Account(Id=tasksPerId[0].WhatId);

           acc.whs_task_Status__c = tasksPerId[0].Status;

acc.whs_upcomingTask__c = tasksPerId[0].ActivityDate;

updatableAccountList.add(acc);

}

update updatableAccountList;

------------------


Hi All,

In the object i am currently working for, there is a text area. For that text area, i want to take the control over the 4th line(to use that text in another field). Can anyone suggest me how to do this?

Any method to pass the line number and get the text in the line?

 

Example:

BELOW IS MY TEXT IN TEXT FIELD.

----

text in line1

text in line2

text in line3

----

In the above context, i want to take control of text in line 2(text in line 2) and need to manipulate it and use for some purpose.

Please Suggest.

 

 

Thanks,

Krishna.

 

 

Hi All,

I am using CreateTextNode on my page in the process of displaying some content on my page like below.

 

 

var btag=document.createElement("h2");

 

var btag=document.createElement("h2");

var btag_content = document.createTextNode("Subject");

btag.appendChild(btag_content);
var sp2 = document.getElementById("output");
var parentDiv = sp2.parentNode;
parentDiv.insertBefore(btag, sp2);
In this context, i am getting an error in Internet Explorer as  "ERROR:unExpected call to method or property access"

While debugging i came to knw that this is happening because of CreateTextNode method call. How can i overcome this error in IE. My code works well in Chrome.
Please suggest me the remedy.
Thanks,
nishanth.

 

Hi Guys,

    I need help regarding read more functionality . I need the same functionality as provided in sales force home page.

 I need to display only some part of text till user clicks on "read more " link . For reference, please follow the

URL http://www.salesforce.com/in/?ir=1

 

Can anyone please guide me how to do this?

Hi All,

 

        I have one long text field in my visualforce page. In that i need to display few text(say 200 chars) only and i need to provide READMORE link/button which would show me the complete content in that text field. I need to achieve this shortly! 

Please provide me the idea/code how to achieve this. Any code/links will be added advantage to me! Help me Out!

 

Tons of Thanks,

Nishanth.

Hi All,

 

         I had a requirement of making a field Read-Only in an object's page. I am able to make it read-only using the code like below:

 

// var noofpackage1 = document.getElementById("{!$Component.formid.pageblockid.noofpackage1}");

noofpackage1.disabled=true;

 

But in this context, i kept some value in that read-only field while page load itself.  The problem here i got is 

           IF I GIVE THE VALUE AS "1", AT THE TIME OF PAGE LOAD I CAN SEE THE VALUE, BUT I AM NOT ABLE TO SAVE THE RECORD WITH THAT VALUE. THE VALUE IS DISAPPEARING WHILE I AM TRYING TO SAVE. AND THE POST SAVE PAGE(VIEW PAGE) IS NOT SHOWING THE VALUE WHICH I TRIED TO ASSIGN AT THE TIME OF PAGE LOAD.

            i am using Professional Edition. I cant make the field read-only in page layout since i am using VF page and i cant make the field read-only in Profile page since PE does nt contains profiles.

Help me out in achieving this guys.

      Tons of thanks,.

-

krishna

Hi all,

   I had a requirement to pull the documents from work space and i need to download them.

so i have developed code to retrieve the data from workspace but its not showing all the documents.

it is showing the record when i give the id in the url.Like this way iam getting only one particular data.

How can i pull all the data from work space....here is my code.

 

<apex:page standardController="ContentWorkspacedoc"> 

    <apex:form >

        <apex:pageBlock >

            <apex:pageBlockSection title="Content Doc" > 

                <apex:pageBlockSectionItem >

                    <apex:pageBlockTable value="{!ContentWorkspacedoc}" var="cwsd">

 

                        <apex:column value="{!cwsd.ContentDocument.Title}"/> 

                        <apex:column value="{!cwsd.ContentDocument.LATESTPUBLISHEDVERSIONID}"/>

                        <apex:column value="{!cwsd.ContentWorkspace.NAME}"/>

 

                    </apex:pageBlockTable>

                </apex:pageBlockSectionItem>        

            </apex:pageBlockSection>

        </apex:pageBlock>

    </apex:form> 

</apex:page>

Hi All, I am in need of help from u guys, regarding Downloading work space content from Sales force into the user's machine. I need this with the help of a DOWNLOAD button(custom button) click. I should get a pdf downloaded into my machine if i click on that download button. Please guide me through this, providing work around. Thanks in advance. - Krishna.

hi,

 

   i need to capture the comments that approver gives while approving/rejecting a record. I need to use this field value in a  template and send it to some other user. 

 

                  Can any one gimme merger field syntax to use it in mail template???

 

 

     Thanks in Advance,

nishanth.

Hi All,

 

   I am developing code using Ajax in VisualForce. In the current working context, i am suppose to retrieve date from existing record(using java script query) and need to put it into another visualforce Date field. What i am doing is :I am taking day,month,year using getDay()...methods and appending the value to the new field like the code given below:

 


var date = new Date(endresult.CloseDate);

var day=date.getDate();

var month=date.getMonth()+1;

var year=date.getYear()+1900; document.getElementById("{!$Component.formid.pageblockid.pageblocksectionid1.opportunityclosedateid}").value=month+'/'+day+'/'+year;

 

In this context,. i am getting an NaN error. It is reporting that THE TEXT IN DATE FIELD IS NOT A NUMBER. How can i avoid this?

           And one more issue here is, this error is browser specific. In Chrome, i am not getting any error.. While, i am unable to execute the same code in  IE or Safari or Mozilla. 

 

 Can anyone tell me why this is happening and How to overcome this.?!?!?

 

  Tons of Thanks, 

  Nishanth.

 

 

Hi Guys,

 

          I need help for a functionality in VF page to hide one of two fields based on picklist value in the same page.

 

             Here we have :     1)Opportunity type (PICKLIST) with options NEW, EXISTING.

                                            2)Opportunity LookUp

  3) Opportunity Name Text Field

 

Here, i need to disable the Opportunity Lookup if the picklist value is NEW. Sameway, i need to disable Opportunity Name text field, if the piklist value in EXISTING

 

                                 Please let me know whether i can do this or not,  suggest me the code to disable appropriate fields in my custom object's new record page.

 

 

   Tons of Thanks,

Nishanth.

Hi All,

          I am trying to retrieve a picklist value from page to control. In the control, I am getting the field value id and not the field value text. And i am retrieving using property fields like public String selecteduser{set;get;}.I need to use that retrieved value in a where clause of an query. Please tell me how can i get the picklist text value?

 

 Tons of Thanks,

  Nishanth.

 

Hi guys,

 

   do anyone knw any book name for "javascript usage in visualforce".?  Since i am working on Professional Edition, i need to use javascript for some functionalities. 

 

                                        Please suggest me.

 

 Tons of Thanks,

Krishna Nishanth T.

Hello All,

I 'd an issue regarding sending emails using singleemailmessage class. Heard that we can send 10 * 1000 = 10000 emails per execution (10 arrays, each array to accomodate 1000 emails). Is this true?

But i am unable to send more than 10 emails. Could anyone plz clarify me how to do. PFB my code snippet:

 

            }

for(Permit__c p:permitList){
                 Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage(); 
                                    String subject = p.Name+' | '+p.Region__c+' | '+p.Full_State__c+' | '+p.Channel__c+' | Status=Expired';
                                    email.setSubject(subject);
                                    String emailadd = 'abc@xyz.com';
                                    String[] toAddresses = emailadd.split(',');
                                    email.setToAddresses(toAddresses);
                                    email.setHTMLBody( 'email body.' );
                 Messaging.SendEmailResult[] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email}); 

 

 

An error is being thrown when 10 mails are sent and is about to send 11th email.

Plz help!

Hello All,

I 've a requirement in current assignment that, a user with profile other than sys admin should be able to schedule apex. I logged into Salesforce using that user's credentials. I can see 'SCHEDULE APEX' button, but not working. It is reproting 'INSUFFICIENT PREVILAGES' error. 

Could anyone please help?

 

Thanks In advance!

Hello All,

Is there a way in SFDC to store variables data in sessions or in browser cookies?

please help.

Thanks.

Hi All,

I had this req in my current project. I 've an array which is built in Apex controller.

Say, Integer[] a;

i have values like a[0]=11; a[1]=90; a[2]=45; .........so on.

Now, i want to iterate this array from javascript function.

I tried something like this:

 

<script type="text/javascript">

try{

  for(var i=0;i<20;i++){

       var v="{!pwL.a[i]}";        // PROBLEM OCCURS HERE. IT IS CONSIDERING " i " as "i" only. but not like an integer, i=0,1,2....so on

       alert(v);

}

}catch(e){

alert('eeee:'+e);

}

</script> 
Now, in the above snippet, i had an object pwL which consists of array "a".

Now, if i want to iterate through the array, it is throwing me an error as UNKNOWN PROPERTY i.

Seems, it is not able to interpret that   var v="{!pwL.a[i]}";   means  var v="{!pwL.a[0]}";   when i=0.

I want to pass the "i" value and get the value in that array with this index.

 

Hope, i made you clear!

Please help me out!

 

Thx.


Hi,

In the page i am currently working for, i need Account Teams to be placed as related list. I dont need any other related list.

In order to achieve this, i tried 

<apex:relatedlist list="Accountteams"/>

But its throwing me an error:

'Accountteams' is not a valid child relationship name for entity Account.

 

Please suggest me, how to acheive this?

 

Thanks In Advance,

Nishanth.

Hi All,

In the code pasted below, i need to avoid the query in the for loop. My Intention is to pick up one record per id(per each UniqueId). To achieve this i have to place the query in a for loop which will hit the governer limits(max SOQL query 100) if number of accounts are more. So, is there a way of getting one record (already mentioned in query as LIMIT 1) per account id without looping through each account id(eachUniqueId).

Please help me out.

 

Thanks in advance,

Nishanth.

 

Here goes my code:

------------------

List<Account> updatableAccountList = new List<Account>();

for(Id eachUniqueId:uniqueIdList){

List<Task> tasksPerId = [Select WhatId,Status,ActivityDate from Task where ActivityDate>today and WhatId =: eachUniqueId and Status != 'Completed' ORDER BY ActivityDate ASC NULLS last LIMIT 1];

Account acc = new Account(Id=tasksPerId[0].WhatId);

           acc.whs_task_Status__c = tasksPerId[0].Status;

acc.whs_upcomingTask__c = tasksPerId[0].ActivityDate;

updatableAccountList.add(acc);

}

update updatableAccountList;

------------------


Hi All,

I am using CreateTextNode on my page in the process of displaying some content on my page like below.

 

 

var btag=document.createElement("h2");

 

var btag=document.createElement("h2");

var btag_content = document.createTextNode("Subject");

btag.appendChild(btag_content);
var sp2 = document.getElementById("output");
var parentDiv = sp2.parentNode;
parentDiv.insertBefore(btag, sp2);
In this context, i am getting an error in Internet Explorer as  "ERROR:unExpected call to method or property access"

While debugging i came to knw that this is happening because of CreateTextNode method call. How can i overcome this error in IE. My code works well in Chrome.
Please suggest me the remedy.
Thanks,
nishanth.

 

Hi Guys,

    I need help regarding read more functionality . I need the same functionality as provided in sales force home page.

 I need to display only some part of text till user clicks on "read more " link . For reference, please follow the

URL http://www.salesforce.com/in/?ir=1

 

Can anyone please guide me how to do this?

Hi All,

 

        I have one long text field in my visualforce page. In that i need to display few text(say 200 chars) only and i need to provide READMORE link/button which would show me the complete content in that text field. I need to achieve this shortly! 

Please provide me the idea/code how to achieve this. Any code/links will be added advantage to me! Help me Out!

 

Tons of Thanks,

Nishanth.

i was tring to do the force.com for google app tutorial (http://wiki.developerforce.com/index.php/Force.com_for_Google_App_Engine_User_Guide_Java). With the hello world app i don't have problem but when i try to generate a new record i have this error:

 

 

HTTP ERROR 404
Problem accessing /provaent. Reason:
    Servlet class provaent.ProvaentServlet is not a javax.servlet.Servlet
Caused by:
javax.servlet.UnavailableException: Servlet class provaent.ProvaentServlet is not a javax.servlet.Servlet
at org.mortbay.jetty.servlet.ServletHolder.checkServletType(ServletHolder.java:362)
at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:243)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.jetty.Server.doStart(Server.java:224)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at com.google.appengine.tools.development.JettyContainerService.startContainer(JettyContainerService.java:185)
at com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:147)
at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:219)
at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:164)
at com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:48)
at com.google.appengine.tools.development.DevAppServerMain.<init>(DevAppServerMain.java:113)
at com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:89)

 

i have try also with partner library but the error is the same

  • July 14, 2010
  • Like
  • 0

Hi All, I am in need of help from u guys, regarding Downloading work space content from Sales force into the user's machine. I need this with the help of a DOWNLOAD button(custom button) click. I should get a pdf downloaded into my machine if i click on that download button. Please guide me through this, providing work around. Thanks in advance. - Krishna.

Hi Guys,

 

          I need help for a functionality in VF page to hide one of two fields based on picklist value in the same page.

 

             Here we have :     1)Opportunity type (PICKLIST) with options NEW, EXISTING.

                                            2)Opportunity LookUp

  3) Opportunity Name Text Field

 

Here, i need to disable the Opportunity Lookup if the picklist value is NEW. Sameway, i need to disable Opportunity Name text field, if the piklist value in EXISTING

 

                                 Please let me know whether i can do this or not,  suggest me the code to disable appropriate fields in my custom object's new record page.

 

 

   Tons of Thanks,

Nishanth.

Hi All,

          I am trying to retrieve a picklist value from page to control. In the control, I am getting the field value id and not the field value text. And i am retrieving using property fields like public String selecteduser{set;get;}.I need to use that retrieved value in a where clause of an query. Please tell me how can i get the picklist text value?

 

 Tons of Thanks,

  Nishanth.

 

Hi guys,

 

   do anyone knw any book name for "javascript usage in visualforce".?  Since i am working on Professional Edition, i need to use javascript for some functionalities. 

 

                                        Please suggest me.

 

 Tons of Thanks,

Krishna Nishanth T.

Hi all,


Can anybody share the document or how to integrate with the salesforce.com public calender with the MS-Out Look. Has anybody come across this requirement. Please can all share on integration part.

 

Regard,

Ratan

I need to enable inline Editing in Visual force Page , i cant enable this in my visual force page ,

Can anyone tell me how can we enable or any oher way to edit the page without standard edit action ?

  • August 18, 2009
  • Like
  • 0
hi friends,
1)I am writing Apex classes for parsing the content of the csv file . But at the time of execution I am getting this error
System Exception : Too many Script Statements
As csv contains more than 254 fields and around 200 rows . I think I am getting this Exception . So can u pls help on this .
 
2)Even this exception is not caught by try ang catch block . Is there any way to catch this exception if it generates while execution . pls suggest any solutions if you have.