• marella1800
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 20
    Questions
  • 16
    Replies

hi
i want send email to contacts when the opportunity was closed own
for perticular time am write schedular class
my scenario is
when the opportunity satge is closed own i want send email
in opportunity when i create contactrole i have to select is checked is primary i want send email to that particular contact

am write the pice of code am not getting any error but email was not sending can any one help me where am missing


global class Sending_Email_To_Contacts implements Schedulable

{

public List<Opportunity> Opp;

public List<contact> con;
public List<OpportunityContactRole> ocr;
public set<id> ids;
public set<id> ocrids;
global void execute(SchedulableContext ctx)
{

opp=[select id,Name,StageName,Accountid from Opportunity where StageName='Contracted Performance'];
for(Opportunity op:opp)
{
ids.add(op.id);
}
ocr=[select ContactId,Id,OpportunityId,IsPrimary from OpportunityContactRole where IsPrimary=true and OpportunityId in :ids];

for(OpportunityContactRole oc:ocr)
{
ocrids.add(oc.id);
}

con=[select id,Name,Accountid,LeadSource,Email from contact where id in:ocrids];

List<String> toAddress = new List<String>();
for(Contact cn:con)
{
toAddress.add(cn.Email);
}

Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
mail.setUseSignature(false);
mail.setToAddresses(toAddress);

mail.setSubject('Good luck with the event today');
mail.setHtmlBody('Here is the email you requested! Check the attachment!');

 

Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });

}


}

hi
i want send email to contacts when the opportunity was closed own
for perticular time am write schedular class
my scenario is
when the opportunity satge is closed own i want send email
in opportunity when i create contactrole i have to select is checked is primary i want send email to that particular contact

am write the pice of code am not getting any error but email was not sending can any one help me where am missing


global class Sending_Email_To_Contacts implements Schedulable

{

public List<Opportunity> Opp;

public List<contact> con;
public List<OpportunityContactRole> ocr;
public set<id> ids;
public set<id> ocrids;
global void execute(SchedulableContext ctx)
{

opp=[select id,Name,StageName,Accountid from Opportunity where StageName='Contracted Performance'];
for(Opportunity op:opp)
{
ids.add(op.id);
}
ocr=[select ContactId,Id,OpportunityId,IsPrimary from OpportunityContactRole where IsPrimary=true and OpportunityId in :ids];

for(OpportunityContactRole oc:ocr)
{
ocrids.add(oc.id);
}

con=[select id,Name,Accountid,LeadSource,Email from contact where id in:ocrids];

List<String> toAddress = new List<String>();
for(Contact cn:con)
{
toAddress.add(cn.Email);
}

Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
mail.setUseSignature(false);
mail.setToAddresses(toAddress);

mail.setSubject('Good luck with the event today');
mail.setHtmlBody('Here is the email you requested! Check the attachment!');

 

Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });

}


}

when creating a quiz,How can we store the result ?how can we differentiate which is right and wrong?and how can we display result finally with marks??

Hi,I am having questions__c(parent) and answers__c(child) are 2 custom objects which are having MDR relation.
Requirement:-
Need to create ONLINE EXAM on if page have 1000 records in questions__c object I need to fetch records from questions__c. Randomly to if page and need to show different questions which should not repeat.
question =60. no question should reapeat for a single participant.
Can any one make me out from this???

Thanx in advance...!!!

Hi,i am having questions__c(parent) and answers__c(child) are 2 custom objects which are having MDR relation.
requirement:-
Need to create ONLINE EXAM on vf page.i have 1000 records in questions__c object .i need to fetch records from questions__c. randomly to vf page and need to show different questions which should not repeat.
question =60. no question should repeat for a single participant.
Can any one make me out from this???

Thanx in advance...!!!

Hi,i am having questions__c(parent) and answers__c(child) are 2 custom objects which are having MDR relation.
requirement:-
Need to create ONLINE EXAM on vf page.i have 1000 records in questions__c object .i need to fetch records from questions__c. randomly to vf page and need to show different questions which should not repeat.
question =60. no question should repeat for a single participant.
Can any one make me out from this???

Thanx in advance...!!!

I have created one vf page to display questions(records) from my custom object and provide result for the questions in same vf page. Now my senarios . I need to show a back timer on vf page which runs as it starts  60min59sec ,, 60min58sec    60min57sec ,,time left. like that i need to set time for vf page.  If end user could n't complete the test with in 60 mins , Thankyou page should appear...

 

could any one help??

how exactly paypal and salesforce integrates???

can any one give sample xml response which appears to designated listner through outbound message.i wanna see how the xml format looks ?

I need to show the lead update automatically in XML response to destinated....with workflow outbound message, in this i was struct in( Import the downloaded client certificate into our application server)  

i need to show the lead update automatically in xml response to destinated....with workflow outbound message, in this i was struct in( Import the downloaded client certificate into our application server)  

i need to show the lead update automatically in xml response to destinated  with workflow outbound message, in this i was struct in( Import the downloaded client certificate into our application server)  

how to schedule records to insert or update at a particular time using jitterbit data loader

How can we rename the salesforce SITES NAME for enterprise edition????

How can we rename the salesforce SITES NAME for enterprise edition????

Iam having 2 custom objects, 1)Digitalfactory 2)Stage.both are in lookup relation.stage name and stage creation date,are 2 fields in stage object. and SALESREADYDATE is the field in Devfactory (object).

requirement:- i need to write a trigger,when ever the stage name=closed ,then date of creation should come to salesready date (field)in devfactory(object)

Please let me know the simplest way(FREE) integrating SALESFORCE TO MAGENTO..

 

 

 

 

Thanks in advance,,!!!!

Hi,after integrating s2s.i need to send the field automatically  to other SF organization only when the field called country = U.S.,otherwise not..Can any one help me what criteria I need to use?


Thanks in advance..!!

Hi,after integrating s2s.i need to send the field automatically  to other sf organization only when the field called country = U.S.,otherwise not..Can any one help me what criteria I need to use?


Thanks in advance..!!

Hi,after integrating s2s.i need to send the field automatically  to other sf organisation only when the field called country = U.S.,otherwise not...can any one help me what criteria i need to use?


thanks in advance..!!

when creating a quiz,How can we store the result ?how can we differentiate which is right and wrong?and how can we display result finally with marks??

Hi,I am having questions__c(parent) and answers__c(child) are 2 custom objects which are having MDR relation.
Requirement:-
Need to create ONLINE EXAM on if page have 1000 records in questions__c object I need to fetch records from questions__c. Randomly to if page and need to show different questions which should not repeat.
question =60. no question should reapeat for a single participant.
Can any one make me out from this???

Thanx in advance...!!!

Hi,i am having questions__c(parent) and answers__c(child) are 2 custom objects which are having MDR relation.
requirement:-
Need to create ONLINE EXAM on vf page.i have 1000 records in questions__c object .i need to fetch records from questions__c. randomly to vf page and need to show different questions which should not repeat.
question =60. no question should repeat for a single participant.
Can any one make me out from this???

Thanx in advance...!!!

Hi,i am having questions__c(parent) and answers__c(child) are 2 custom objects which are having MDR relation.
requirement:-
Need to create ONLINE EXAM on vf page.i have 1000 records in questions__c object .i need to fetch records from questions__c. randomly to vf page and need to show different questions which should not repeat.
question =60. no question should repeat for a single participant.
Can any one make me out from this???

Thanx in advance...!!!

how exactly paypal and salesforce integrates???

Good afternoon,

 

I am trying to send an outboud message on a Contact workflow and am getting a 503 

 

My end point is something like

 

http://localhost:63245/Web/asp/...

 

I am not seeing the actual request in Fiddler which leads me to believe it is never actually being sent. However in Outbound messages delivery status page I see that it is being sent and retried.

 

What am I doing wrong?

 

Thanks in advance.

 

Whatty

 

hi i write trigger  on my custom object when it will update first time i have to create event ,if i update next time its only update

i write trigger it will not updating its only creating can any one tel me where am doing mistak.

 

my trigger scenario is i have a filed called sales ready date in my custom object if i change tht date my event details will be updated .

below is my trigger

 

trigger TGR_EventDateOppName on Factory__c (after insert,before update) {

try{
Factory__c dgital=[select id,Sales_Ready_Date__c from Factory__c where id=:trigger.new ];
list<Event> newevent=new list<Event>();
Opportunity opp=[select id,name from Opportunity where id in (select Opportunity__c from factory__c where id=:trigger.new)];
system.debug('&&&'+opp);
for(factory__c df:trigger.new)
{


if(df.Sales_Ready_Date__c !=null)
{
Event e = new Event();
    e.StartDateTime =df.Sales_Ready_Date__c;
    e.EndDateTime =df.Sales_Ready_Date__c.addDays(1);
    e.Subject =opp.name;
    e.WhatId=df.id;
    newevent.add(e);
}

}
insert newevent;
Event e=[select id,StartDateTime,EndDateTime  from event where WhatId in(select Opportunity__c from factory__c where id=:trigger.new)];
system.debug('&&&'+e);
for(factory__c dfc:trigger.new)
{
    e.StartDateTime =dfc.Sales_Ready_Date__c;
    e.EndDateTime =dfc.Sales_Ready_Date__c.addDays(1);
 
}

update newevent;
system.debug('^^^^^^^^^^^^'+newevent);
}catch(Exception e){system.debug('&*&*'+e);}
}

How can we rename the salesforce SITES NAME for enterprise edition????

Iam having 2 custom objects, 1)Digitalfactory 2)Stage.both are in lookup relation.stage name and stage creation date,are 2 fields in stage object. and SALESREADYDATE is the field in Devfactory (object).

requirement:- i need to write a trigger,when ever the stage name=closed ,then date of creation should come to salesready date (field)in devfactory(object)

HI All,

 

       I have created  one vf page  to dispaly questions(records) from my custom object  and  provide result  for the questions  in same vf page.  Now  my senarios . I need to set time  for vf page. like supoose in  my vf page there are 20 questions. for 20 questions ineed to set 20 min time  . If end user could n't complete the test  with in 20 mins , that question should not appear automatically,   i am placing my vf page and controller, plz suggest me to set time    and how to implement this  senario.

 

vf page:

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

<apex:page controller="Records20" sidebar="false" >
<apex:form >
<apex:outputpanel rendered="{!displayRecords}" >

<apex:pageblock Title="Answers the Questions">

<b><apex:outputText value="Your Time Starts Now: {!Timer}:00 Min" id="counter"/></b>
<apex:actionPoller action="{!incrementCounter}" rerender="counter ,button" interval="15"/>
<br/>
<br/>

<apex:pageBlockButtons location="bottom">

<apex:commandButton value="Submit" action="{!saveAnswer}" id="button"/><br/>
</apex:pageBlockButtons>
<apex:repeat value="{!items1}" var="it">
<apex:outputText value="{!it.intSerial}"> </apex:outputText>).&nbsp;<apex:outputText value="{!it.strQuestion}"></apex:outputText>
<apex:SelectRadio value="{!it.answer12}">
<apex:selectoptions value="{!it.itemsWrap}"/>
</apex:SelectRadio><br/>
</apex:repeat>
</apex:pageblock>
</apex:outputpanel>
YOUR RESULT IS:&nbsp;&nbsp;<apex:outputText value="{!intCount}"></apex:outputText>
</apex:form>
</apex:page>

__________

controlle---

 

 

public class Records20{

public Integer Timer;
public boolean displayRecords{set;get;}
public string answer1{set;get;}
public List<selectOption> selItems {get;set;}
public integer intCount{get;set;}
list<wrapperQuestions> objwraplst = new list<wrapperQuestions>();
list<Questiuons__c> ques=new list<Questiuons__c>();


public Records20()
{
Timer=0;
displayRecords=true;
list <Questiuons__c> ret=[SELECT id,Question__c,Answers__c,Correctanswer__c FROM Questiuons__c LIMIT 20 ];
ret = ObjectRandomizer.randomizeList (ret);
integer serial=0;
for(Questiuons__c a :ret )
{
System.debug('aaa'+a);
String s = a.Answers__c;
list<string> st =s.split(',');
wrapperQuestions objWrap = new wrapperQuestions();
objWrap.strQuestion = a.Question__c;
objWrap.correctAnswer=a.Correctanswer__c;
serial=serial+1;
objWrap.intSerial=serial;
selItems = new List<selectOption>();
for(String str:st)
{
selItems.add(new SelectOption(str,str));

objWrap.itemsWrap=selItems;

}

objwraplst.add(objWrap);

}
}

public void saveAnswer()
{
intCount=0;
for(wrapperQuestions objwrap:objwraplst)
{
system.debug('::::::::::::'+objwrap.answer12);
if(objwrap.answer12==objwrap.correctAnswer)
{
//intCount = intCount+1;
intCount++;
displayRecords=false;

}else 
displayRecords=false;
}

}

public PageReference incrementCounter() {
if(Timer<=5)
Timer++;
system.debug('@@@@@@@@@@@'+timer);
return null;
}

public Integer getTimer() {
system.debug('!!!!!!!!!!!!!!'+timer);
return Timer;
}
public list<wrapperQuestions> getitems1()
{
return objwraplst;
}


public class wrapperQuestions
{
public string strQuestion{get;set;}
public integer intSerial{get;set;}
public List<selectOption> itemsWrap {get;set;}
public string answer12{set;get;}
public string correctAnswer{set;get;}

}

}

  Any one can help me

  • September 03, 2012
  • Like
  • 0

HI All,

 

       I have created  on vf page  to dispaly questions(records) from my custom object  and  provide result  for the questions  in same vf page.  Now  my senarios . I need to set time  for vf page. like supoose in  my vf page there are 20 questions. for 20 questions ineed to set 20 min time  . If end user could n't complete the test  with in 20 mins , that question should not appear automatically,   i am placing my vf page and controller, plz suggest me how to implement this  senario.

 

vf page:

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

<apex:page controller="Records20" sidebar="false" >
<apex:form >
<apex:outputpanel rendered="{!displayRecords}" >

<apex:pageblock Title="Answers the Questions">

<b><apex:outputText value="Your Time Starts Now: {!Timer}:00 Min" id="counter"/></b>
<apex:actionPoller action="{!incrementCounter}" rerender="counter ,button" interval="15"/>
<br/>
<br/>

<apex:pageBlockButtons location="bottom">

<apex:commandButton value="Submit" action="{!saveAnswer}" id="button"/><br/>
</apex:pageBlockButtons>
<apex:repeat value="{!items1}" var="it">
<apex:outputText value="{!it.intSerial}"> </apex:outputText>).&nbsp;<apex:outputText value="{!it.strQuestion}"></apex:outputText>
<apex:SelectRadio value="{!it.answer12}">
<apex:selectoptions value="{!it.itemsWrap}"/>
</apex:SelectRadio><br/>
</apex:repeat>
</apex:pageblock>
</apex:outputpanel>
YOUR RESULT IS:&nbsp;&nbsp;<apex:outputText value="{!intCount}"></apex:outputText>
</apex:form>
</apex:page>

__________

controlle---

 

 

public class Records20{

public Integer Timer;
public boolean displayRecords{set;get;}
public string answer1{set;get;}
public List<selectOption> selItems {get;set;}
public integer intCount{get;set;}
list<wrapperQuestions> objwraplst = new list<wrapperQuestions>();
list<Questiuons__c> ques=new list<Questiuons__c>();


public Records20()
{
Timer=0;
displayRecords=true;
list <Questiuons__c> ret=[SELECT id,Question__c,Answers__c,Correctanswer__c FROM Questiuons__c LIMIT 20 ];
ret = ObjectRandomizer.randomizeList (ret);
integer serial=0;
for(Questiuons__c a :ret )
{
System.debug('aaa'+a);
String s = a.Answers__c;
list<string> st =s.split(',');
wrapperQuestions objWrap = new wrapperQuestions();
objWrap.strQuestion = a.Question__c;
objWrap.correctAnswer=a.Correctanswer__c;
serial=serial+1;
objWrap.intSerial=serial;
selItems = new List<selectOption>();
for(String str:st)
{
selItems.add(new SelectOption(str,str));

objWrap.itemsWrap=selItems;

}

objwraplst.add(objWrap);

}
}

public void saveAnswer()
{
intCount=0;
for(wrapperQuestions objwrap:objwraplst)
{
system.debug('::::::::::::'+objwrap.answer12);
if(objwrap.answer12==objwrap.correctAnswer)
{
//intCount = intCount+1;
intCount++;
displayRecords=false;

}else
displayRecords=false;
}

}

public PageReference incrementCounter() {
if(Timer<=5)
Timer++;
system.debug('@@@@@@@@@@@'+timer);
return null;
}

public Integer getTimer() {
system.debug('!!!!!!!!!!!!!!'+timer);
return Timer;
}
public list<wrapperQuestions> getitems1()
{
return objwraplst;
}


public class wrapperQuestions
{
public string strQuestion{get;set;}
public integer intSerial{get;set;}
public List<selectOption> itemsWrap {get;set;}
public string answer12{set;get;}
public string correctAnswer{set;get;}

}

}

  Any one can help me

 

  • September 03, 2012
  • Like
  • 0

HI All, 

 

 I have 20 records in My  custom object , I need to diplay  records random , no t sam e in order if  I refresh the page How can i solve  this solution

 

I've run into an issue that is baffling and frustrating. I've got a pageblocktable that simply shows a few elements of a wrapper class that includes some selectoptions, display strings, and most importantly a boolean that is tied to a checkbox. I just discovered that the checkbox values are not binding to the booleans in the wrapper (they were last week), which totally breaks the page and sucks. Please help me...

 

here's the visualforce code: 

<apex:pageBlockTable title="Select School(s)" var="s" value="{!schoolListChoices}">
     <apex:column title="Select">     
          <apex:facet name="header">Select</apex:facet>     
          <apex:inputCheckBox value="{!s.Selected}" /> <!--not binding...-->
     </apex:column>
     <apex:column title="Name">
          <apex:facet name="header">Name</apex:facet>
          <apex:outputText value="{!s.DisplayName}" />
     </apex:column>
</apex:pageBlockTable>

 

Here's the relevant APEX:

//Wrapper

public class reportCardWrapper{
public String displayName {get;set;}
public ID recordID {get;set;}
public ID selectedReportingPeriod {get;set;}
public boolean selected {get;set;}
public list<selectOption> reportingPeriods {get;set;}

public reportCardWrapper(string dn, ID rid){
this.selected = false; //this stopped binding for some reason
this.recordID = rid;
this.displayName = dn;
this.reportingPeriods = new List<selectOption>();
selectedReportingPeriod = null;
}

}

//Loop that checks for "selected"

boolean bSchoolOrGradeSelected = false;
for(reportCardWrapper rw : schoolListChoices){
     if(rw.selected){ //should be true because of the checkbox tied to it on the page.
          schoolToSelectedReportingPeriod.put(rw.recordID,rw.selectedReportingPeriod);
          if(bSchoolOrGradeSelected){//add to the or statement     
               query += ' OR Student__r.School__c = \'' + rw.recordID + '\'';
          }
          else{
               query += ' Student__r.School__c = \'' + rw.recordID + '\'';
               bSchoolOrGradeSelected = true;//this never goes true because the selected value wont bind
           }
     }
}

There is no salesforce error, the only error I get is the one I wrote that checks to make sure at least one box is selected (by looping thru the wrappers and checking the "selected" field. I have another section of the page that has similar logic, but uses datatables instead of pageblocktable, which also has the same issue suddenly.

 

What is going on SF?!

 

Thanks,

Jimmy