I'm using a single email message to send an email. When we tried to sent an email with a wrong email address on newly created lead record. I'm getting message result success is true. But the same record I have tried to send an email in the second time, I'm getting message result success is false. Please advice on this
List<Messaging.SingleEmailMessage> lstMassEmails = new List<Messaging.SingleEmailMessage>();
Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
email.setToAddresses(toEmail);
email.setTargetObjectId(lstcountLead.id);
email.setTemplateId(templateId);
email.setSaveAsActivity(true);
lstMassEmails.add(email);
Map<Id,Messaging.SendEmailResult> maptargetToResult = new Map<Id,Messaging.SendEmailResult>();
List<Messaging.SendEmailResult> sendEmailResults = Messaging.sendEmail(lstMassEmails,false);
Integer i=0;
for(Messaging.SendEmailResult sendEmailResult: sendEmailResults){
maptargetToResult.put(lstMassEmails.get(i).getTargetObjectId(),sendEmailResult);
i++;
}
System.debug('!!!maptargetToResult'+maptargetToResult);(First Time)
!!!maptargetToResult{00Qp00000050eh9EAA=Messaging.SendEmailResult[getErrors=();isSuccess=true;]}
System.debug('!!!maptargetToResult'+maptargetToResult);(Second Time)
!!!maptargetToResult{00Qp00000050eh9EAA=Messaging.SendEmailResult[getErrors=(Messaging.SendEmailError
[getMessage=The target object email address is currently marked as bounced.;getStatusCode=EMAIL_ADDRESS_BOUNCED;getTargetObjectId=00Qp00000050eh9EAA;]);
isSuccess=false;]}
I am a user A with 'Force.com - App Subscription User' profile. I have created an Account 'Test Account' and made its Contact 'Test Contact' as a Partner User B. Now the account 'Partner Test' created by this Partner Account User B is visible to me. Though it is logical, my org security settings demand me not to see 'Partner Test' i.e., User A should not see Partner B's accounts. How can I make this restriction?
We are currently working with Products and Pricebooks in Partner Community. The security side of it is still an idea in Salesforce but is there anyway we could restrict the Products visibility for Partners who are not supposed to view them?
Their Pricebook visibility is limited but they could still view Products of other Partners through Global Search. How do we restrict them from viewing? Currently we are thinking of overriding the branding header of Partner portal to limit visibility of the search box. Would there be a better solution for this?
Scenario:
Say we have Products(Prod1, Prod2, Prod3, Prod4, Prod5, Prod6).
Consider we have 2 Partners PartnerA and PartnerB. In this PartnerA need to see only (Prod1, Prod2, Prod3, Prod4) for PartnerB need to see only (Prod1, Prod2, Prod5, Prod6).
PartnerA should not see (Prod5, Prod6)
PartnerB should not see (Prod3, Prod4)
We tried this by creating 2 Pricebook(Pricebook1 and Pricebook2) for each Partners.
PartnerA has only access to Pricebook1. PartnerB has only access to Pricebook2.
OWD setting:
Pricebook: No Access
After this, PartnerA can only see the product associated with Pricebook1 (Prod1, Prod2, Prod3, Prod4) in OpportunityLineItem. But the product (Prod5, Prod6) is still visible in Global search.
Is there any way to restrict these Product from Global Search or any workaround?
Hi All we have a requirement to perform one contact with multiple Accounts scenario. To perform this logic I have a custom object called "Data Feed".We upload the data in that Data feed object periodically then what we need to do is we need to run the batch apex instantly to pass the Primary Id to Account Lookup under Contact object and at the same time we have to create one entry in Contact Role object by passing the Account ID. I am able to create "Contact" records using Batch Apex class.Its working fine .How can create a entry in Contact role as well at the same time.Please advice me on the same.
global class ScheduleContact implements Database.Batchable<SObject> { global Database.queryLocator start(Database.BatchableContext ctx) {
String query = 'Select Name,Account_ID__c,Primary_Account_ID__c, Deleted__c, First_Name__c, Internal_User_ID__c,Language_Preference__c,Language_Preference_Code__c,Phone__c,Primary_Contact__c,Speaks_English__c from Data_Feeds__c';
Hi All, I am having two picklist field in VF Page.Based on the 2nd picklist value i need to make the 1st picklist field mandatory, which works fine.,but the issue is once i selected the value in 2nd picklist then the value in 1 st picklist changed, it is not displaying the value I already selected.How can solve this issues. Please let me know what am I doing wrong here
Piklist 1: <apex:pageBlockSectionItem > <apex:outputlabel value="{!$ObjectType.Case.fields.Is_booking_with_Primary_Freight__c.label}" for="Request"/> <apex:outputPanel id="panel1"> <apex:inputField value="{!cases.Is_booking_with_Primary_Freight__c}" required="{!if(reason == 'Rebook - Bring Booking Forward'||reason == 'Rebook - No Show'||reason == 'Rebook - Transport Company Issue'||reason == 'Rebook - Order was Rejected on initial delivery'||reason == 'Rebook - Vendor Issue'||reason == 'Rebook - BIG W Issue'||reason == 'Consolidate Orders',true,false) }"/> </apex:outputPanel> </apex:pageBlockSectionItem>
Hi All I have create a site for case creation,the case is created and show a success message when i hit backspace image button on browser its going back to orginal page.how can i prevent the user hit backspace button and browser in Sites. How can solve this issues.
Hi All I have create a site for case creation,the case is created and show a success message when i hit backspace image button on browser its going back to orginal page.how can i prevent the user hit backspace button and browser in Sites. How can solve this issues.
Hi All, I have two search criteria, one is for Account lookup it has to search in custom object based on the lookup selected value and other one is a text box which needs to enter the name. The user needs to search either using lookup value or text box value.I have one issue when i select the value form lookup and click the button it shows the values but the lookup field remains empty.I need to display the value after search in the lookup field.then only i will perform the validation part just like that.if(ship_partyNo=='' && AccountId=='' ){ run=false;ApexPages.addMessage(new ApexPages.Message(ApexPages.severity.ERROR, 'Please enter the value Name or PartyNo'));. }.guide me.
Public class sample_search { public List<sample_unit>Unt_sale{get;set;} public string partyNo{get;set;} public Boolean run{get;set;} public Id AccountId; public Account cont {get;set;} public sample_search() { Unt_sale=new List<sample_unit>(); run=false; } public PageReference runQuery() { run=true; try { cont=[select id, Name,ParentId from Account where id=:cont.ParentId limit 1]; } catch(QueryException qe){ // ApexPages.addMessage(ApexPages.Message(ApexPages.Severity.ERROR, qe.getMessage())); } string queryunit='select id,name,subject__c,detail__c,Account__r.Id from Units__c where name=:partyNo OR Account__r.ID =:AccountId'; process_unit(Database.query(queryunit)); } private void process_unit(List<Units__c> unitsale) { Unt_sale.clear(); for(Units__c cu:unitsale) { Unt_sale.add(new sample_unit(cu)); } } //wrapper class for sample_unit public with sharing class sample_unit { public Units__c unit{get;set;} public sample_unit(Units__c unt) { unit=unt; } } }
I have a VF Page which displays the values from different object as a table. I need to perform the row based calculation in that table. Please find below the example and help me out in solving this
I want to populate Account Number when the user click Account lookup field,but i got this error System.QueryException: List has no rows for assignment to SObject Error is in expression '{!AccountPopulated}' in page lookup_populate Class.Lookup_populate.AccountPopulated: line 8, column 1.
public class Lookup_populate{ public String AccNo{get;set;} public Id AccountId; public Account cont {get;set;} public void AccountPopulated() { cont = new Account(); cont=[select AccountNumber from Account where id=:AccountId limit 1]; AccNo= cont.AccountNumber; } }
I have a VF Page to display two list named list1 and list2. In list1 i am having a picklist called "Status" which has two values named open and complete. In list1 if we select the picklist value "complete" then that record should move to list2. Here is my code but its not working , please guide me
public with sharing class sample { public Integer numberOfRowToRemove1 { get; set; } public List<Account> list1 { get; set; } public List<Account> list2 { get; set; } public string temp{get;set;}
public sampe() { list1 = [select id,name,accountnumber from Account]; list2 = [select id,name,accountnumber from Account]; }
For the first time i am doing integration. Im having a consumer key and secret key of external system.Now I want to do initial connection between salesforce to external system using REST API, how to acheive this. Kindly give me any links and sample programs. I have seen the rest api documentation but i dont get any idea. Thanks in advance
Please guide me am i doing right or wrong.i write a apex class and vf page but i getting this error
System.HttpResponse response = new System.Http().send(request); System.assert(false, response); //remove this once you fix the 403 this.Response = response.getBody(); } }
For the first time i am doing integration. Im having a consumer key and secret key of external system.Now I want to do initial connection between salesforce to external system using REST API, how to acheive this. Kindly give me any links and sample programs. I have seen the rest api documentation but i dont get any idea. Thanks in advance
I trying to download program for contact object , the user click the "Download" custom button it should download all the records from the object. This download file should in text format(.txt).when i download a file it display like this
johnkumarjane but i want to display like this in text file
john
kumar
jane
how to add break line in controller please anyone advice me.
public class contactquery{
public List<Contact> cs{get; set;}
public string empId;
public contactquery()
{
cs = new List<Contact>();
for (Contact c : [Select id, Name from Contact ])
{
cs.add(c);
}
}
}
Vf Page:
<apex:page Controller="contactquery" contentType="text/plain/#emp.txt" cache="true">
<apex:repeat value="{!cs}" var="contact">
<apex:outputText value="{!contact.Name}" escape="false"/><br/>
</apex:repeat>
</apex:page>
I trying to download program for custom object , we the user click the "Download" custom button it should download all the records from the custom object. This download file should in text format(.txt) with fixed width. Kindly anyone tell ideas and links for this. Thanks in advance
I have Picklist value None,External,Internal,when i select none the Resource(percent) Fields remains zero or i select external and internal value ,the input value same what i entered in the Resource field.Based on the percentage value i need to calculate the total amount.How to solve this issues.
Hi All I have create a site for case creation,the case is created and show a success message when i hit backspace image button on browser its going back to orginal page.how can i prevent the user hit backspace button and browser in Sites. How can solve this issues.
Hi All I have create a site for case creation,the case is created and show a success message when i hit backspace image button on browser its going back to orginal page.how can i prevent the user hit backspace button and browser in Sites. How can solve this issues.
I have requirement to intregrate google map in visualforce page.i will fetch the address__c field which i need to show in google map from my custom object through controller. As I am new to salesforce, please help with code to implement it in my visualforce page.
Hi All we have a requirement to perform one contact with multiple Accounts scenario. To perform this logic I have a custom object called "Data Feed".We upload the data in that Data feed object periodically then what we need to do is we need to run the batch apex instantly to pass the Primary Id to Account Lookup under Contact object and at the same time we have to create one entry in Contact Role object by passing the Account ID. I am able to create "Contact" records using Batch Apex class.Its working fine .How can create a entry in Contact role as well at the same time.Please advice me on the same.
global class ScheduleContact implements Database.Batchable<SObject> { global Database.queryLocator start(Database.BatchableContext ctx) {
String query = 'Select Name,Account_ID__c,Primary_Account_ID__c, Deleted__c, First_Name__c, Internal_User_ID__c,Language_Preference__c,Language_Preference_Code__c,Phone__c,Primary_Contact__c,Speaks_English__c from Data_Feeds__c';
I want to populate Account Number when the user click Account lookup field,but i got this error System.QueryException: List has no rows for assignment to SObject Error is in expression '{!AccountPopulated}' in page lookup_populate Class.Lookup_populate.AccountPopulated: line 8, column 1.
public class Lookup_populate{ public String AccNo{get;set;} public Id AccountId; public Account cont {get;set;} public void AccountPopulated() { cont = new Account(); cont=[select AccountNumber from Account where id=:AccountId limit 1]; AccNo= cont.AccountNumber; } }
I have a VF Page to display two list named list1 and list2. In list1 i am having a picklist called "Status" which has two values named open and complete. In list1 if we select the picklist value "complete" then that record should move to list2. Here is my code but its not working , please guide me
public with sharing class sample { public Integer numberOfRowToRemove1 { get; set; } public List<Account> list1 { get; set; } public List<Account> list2 { get; set; } public string temp{get;set;}
public sampe() { list1 = [select id,name,accountnumber from Account]; list2 = [select id,name,accountnumber from Account]; }
For the first time i am doing integration. Im having a consumer key and secret key of external system.Now I want to do initial connection between salesforce to external system using REST API, how to acheive this. Kindly give me any links and sample programs. I have seen the rest api documentation but i dont get any idea. Thanks in advance
I need help with integrating Salesforce to Xero, an accounting software. I'm not sure where to start but if someone has tried integration with Quickbooks or other software, I will be open to suggestions. Thank you!
I trying to download program for contact object , the user click the "Download" custom button it should download all the records from the object. This download file should in text format(.txt).when i download a file it display like this
johnkumarjane but i want to display like this in text file
john
kumar
jane
how to add break line in controller please anyone advice me.
public class contactquery{
public List<Contact> cs{get; set;}
public string empId;
public contactquery()
{
cs = new List<Contact>();
for (Contact c : [Select id, Name from Contact ])
{
cs.add(c);
}
}
}
Vf Page:
<apex:page Controller="contactquery" contentType="text/plain/#emp.txt" cache="true">
<apex:repeat value="{!cs}" var="contact">
<apex:outputText value="{!contact.Name}" escape="false"/><br/>
</apex:repeat>
</apex:page>
I trying to download program for custom object , we the user click the "Download" custom button it should download all the records from the custom object. This download file should in text format(.txt) with fixed width. Kindly anyone tell ideas and links for this. Thanks in advance
I am trying to write a test class for this apex class and VF page but im getting this error
System.NullPointerException: Attempt to de-reference a null objectStack TraceClass.Custom_Account_Lookup_Search.saveAccount: line 42, column 1 Class.Test_Custom_Account_Lookup_Search.test1: line 24, column 1
how to solve this issue;
Test Class:
@isTest(Seealldata = true) public class Test_Custom_Account_Lookup_Search { Static testmethod void test1() { PageReference pg = page.Custom_Account_Lookup_Search_page; Test.setcurrentPage(pg); //account a = new Account( name='foo' ,BillingStreet ='west',BillingCity ='test') ; //insert a; Account acc = new Account(); acc.Name='voltum'; acc.BillingStreet='Santhom High Road'; acc.BillingCity='Chennai'; acc.BillingState='TamilNadu'; acc.BillingCountry='India'; //acc.BillingZipPostal='6000028'; acc.Email__c='perisoft@voltum.com'; acc.Fax='+49 9134 85 28732'; acc.Website='http://www.voltum.com.au/'; insert acc; Site__c site = new Site__c(); ApexPages.StandardController stdController1 = new ApexPages.StandardController(site); Custom_Account_Lookup_Search thecontroller1 = new Custom_Account_Lookup_Search(stdController1); thecontroller1.saveAccount(); } }
Aex class:
public with sharing class Custom_Account_Lookup_Search {
public Account account {get;set;} // new account to create public List<Account> results{get;set;} // search results public string searchString{get;set;} // search keyword
public Custom_Account_Lookup_Search() { account = new Account(); // get the current search string searchString = System.currentPageReference().getParameters().get('lksrch'); runSearch(); }
// performs the keyword search public PageReference search() { runSearch(); return null; } public Custom_Account_Lookup_Search(ApexPages.StandardController stdController) { } // prepare the query and issue the search command private void runSearch() { // TODO prepare query string for complex serarches & prevent injections results = performSearch(searchString); }
// run the search and return the records found. private List<Account> performSearch(string searchString) {
String soql = 'select id, name from account'; if(searchString != '' && searchString != null) soql = soql + ' where name LIKE \'%' + searchString +'%\''; soql = soql + ' limit 25'; System.debug(soql); return database.query(soql);
}
// save the new account record public PageReference saveAccount() { insert account; // reset the account account = new Account(); return null; }
// used by the visualforce page to send the link to the right dom element public string getFormTag() { return System.currentPageReference().getParameters().get('frm'); }
// used by the visualforce page to send the link to the right dom element for the text box public string getTextBox() { return System.currentPageReference().getParameters().get('txt'); }