• ShaT
  • NEWBIE
  • 420 Points
  • Member since 2011

  • Chatter
    Feed
  • 13
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 73
    Questions
  • 150
    Replies
controller:

public with sharing class textInputsCon {
     public String inputText1{get;set;} // input text1 value  from vf
     public String inputText2{get;set;} // input text2 value  from vf  
     public showlist(){
    list<Quote__c>  quo= [select Quote_Number_New__c from quote__c where Quote_Number_New__c=:inputtext1 ];
      return list<Quote__C> quo.getrecords();
     }
     }

vfpage:

<apex:page showHeader="false" sidebar="False" controller="textInputsCon">
    <apex:form >
       Input Text1 <apex:inputText value="{!inputText1}"/>
       Input Text2 <apex:inputText value="{!inputText2}"/>
        <apex:commandButton value="list" action="{!showlist}"/>
         <apex:pageBlock >
            <apex:pageBlockTable value="{!Quote__c}" var="q">
                <apex:column value="{!q.Quote_new_number__c}"/>
            </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
    </apex:page>


Error: textInputsCon Compile Error: unexpected token: 'list' at line 6 column 13


i want to query the user input and get results in the same page.how can i do that can any one correct this error
My Class:

public class Cls_FutureMethods{

    @future
    public static void processLargeAccounts(Id AllTierID,Decimal TUDMin){

        TUDTiers__c AllTierMin = [select Id,MinimumRange__c from TUDTiers__c where Id =: AllTierID];
      
        AllTierMin.MinimumRange__c=TUDMin+0.01;
        TUDTierUtility.isFutureUpdate = true;
        update AllTierMin;
    }
}

Test
@isTest
private class Test_FutureMethods
{
static testMethod void testTrigger()
{
Cls_FutureMethods fut= new Cls_FutureMethods();

TUDTiers__c tud = new TUDTiers__c();
tud.MinimumRange__c=45.67;
tud.Tier__c=25.36;
insert tud;


Decimal TUDMin=45.56;
TUDTierUtility.isFutureUpdate = true;

Test.StartTest();
Test.StopTest();
}
}

My Code coverage is 0. How can i increase the code coverage for this..Need help.
  • January 31, 2014
  • Like
  • 0
Hi guys and girls,

So I have posted this a few times and am yet to come up with a solution. The trigger's aim is to update the Account name dependent on the contacts associated with the account. The goal is to have the trigger update the account name in the way that should an account have two contacts, Ben Peters and Jane Peters, then the account name would equal = Peters, Ben and Peters, jane

At the moment, the trigger works except that it updates the name to be in the form, account name = and Peters, Ben and peters, Jane. 

I understand why it is doing this, but I am not sure how to phrase the code to avoid it. Originally I had a workflow rule which would automatically set the company Name in a lead record to be in the Lastname, FirstName format which would make the account name right upon lead conversion, however this method loses its effectiveness after you add another contact to the account.

This is my trigger:

trigger ContactTrigger on Contact (after insert,after update, after delete, after undelete) {
    Set<ID> setAccountIDs = new Set<ID>();
    for(Contact c : Trigger.new){
        setAccountIDs.add(c.AccountId);
    }
 
    List<Account> accounts = [Select ID, Name,(Select FirstName, LastName From Contacts)  From Account WHERE ID IN :setAccountIDs];
    for(Account a : accounts){
        String accName = '';
        for(Contact c : a.Contacts){
        accName +=' and '+c.LastName+', '+c.FirstName;                     
        }
        a.Name=accName;
    }
    update accounts;
 
}

The goal is to change the code so that should the account have one contact, the name will be just in the format 'Lastname, Firstname' then should another contact be added to the account the account name will be 1Lastname, 1Firstname and 2Lastname, 2Firstname

Thank you for your help in advance
I have a trigger, the trigger is designed to update the account name field as contacts are added. 

I would like it to be in the form:

Account with one contact called James peterson = Peterson, James Account

Account with contacts james peterson and ellie peterson = Peterson, james and Ellie, Peterson account.

I think I have my syntax off slightly. Please help! I just tried to add a contact to my account and I received this error message:

Error: Invalid Data.
Review all error messages below to correct your data.
Apex trigger ContactTrigger caused an unexpected exception, contact your administrator: ContactTrigger: execution of AfterInsert caused by: System.SObjectException: SObject row was retrieved via SOQL without querying the requested field: Contact.LastName: Trigger.ContactTrigger: line 11, column 1



This is my trigger, your help is very much appreciated

Trigger:

trigger ContactTrigger on Contact (after insert,after update, after delete, after undelete) {
    Set<ID> setAccountIDs = new Set<ID>();
    for(Contact c : Trigger.new){
        setAccountIDs.add(c.AccountId);
    }
 
    List<Account> accounts = [Select ID, Name,(Select Name From Contacts)  From Account WHERE ID IN :setAccountIDs];
    for(Account a : accounts){
        String accName = '';
        for(Contact c : a.Contacts){
        accName +=' and'+c.LastName+', '+c.FirstName;                     
        }
        a.Name=accName;
    }
    update accounts;
 
}


king regards,

Mikie
Hello community!

I always try to solve issues by myself, but this time i have tried several things and i can't fix it. Here we go:

I have created several VF pages and controllers that interact between each other by PageReference methods.

Lets say We have 2 pages and 2 controllers:

ContactsListPage => ContactsListPageController
ContactDetailPage => ContactDetailPageController

ContactsListPage shows a table with records with a commandButton each, this way user can edit the desired record. The edit action invokes EditRecord() method from ContactsListPageController, which creates a page reference and adds some query strings to it to know which contact was selected.
Then ContactDetailPage is invoked and shows the edit form and a Save command button. This button invokes SaveRecord from ContactDetailPageController. This method does a setRedirect(true) to the pageReference in order to force the ContactsListPage to show the changes made by the user in the list of contacts.

Something like this:

ContactsListPageController
{
    ...
    PageReference EditRecord()
    {
        ...
        PageReference page = new PageReference('apex/ContactDetailPage?recordId=' + someId);
        page.setRedirect(true);
        return page;
    }
}


ContactDetailPageController
{
    ...
    PageReference SaveRecord()
    {
        update record;
        ...
        PageReference page = new PageReference('apex/ContactsListPage');
        page.setRedirect(true); //To preserve viewstate vars and force ContactsListPage to show the changes
        return page;
    }
}



This works perfect from inside salesforce, I mean, invoking VF pages by adding /apex/ContactsListPage to the URL to show the first page.

Well, the problem is that those app are needed to be shown using a force.com Site, and there the setRedirect seems not to work. The changes made by the user in the contact detail page are not reflected to the contacts list page when it is saved unless user manually refreshes the page with the browser button of hitting F5.
All the changes are well saved to Salesforce, the problem is only in the UI, it is not refreshing.

The weird thing is that it works as it should if i don't use Sites.

Any idea what is causing this and how to dolve it?

Any comment is welcome.

Regards!

Hi,

I have a VF page for custom object, which is parent object to many other children objects.

These children objects have lookup field to parent object.

So, there when child record is created, name of parent record appears on the page layout.

When you click on that link, it takes you to standard layout of the parent object. Instead of that, I want to take user to custom VF page that we have developed for parent object.

 

Can anybody tell me how to do that?

 

Thanks,

Bakul

I am trying to create a "Time" field for users to enter the amount of time they spent on a case.  If I make it a Date/Time field, I get all the calendar stuff.  If I use a number field, then it is decimal.

 

How des one create a field that deals with hours and minutes?

 

Thanks . . .

Hi,

 

I am having a search results in a apex:PageblockTable. I aslo need a way to have checkbox on the header to allow a select all and delete the records. Is there a way i can do that using PageblockTable?

 

I want to have the UI as much as possible like the standard UI . With the normal table its quite difficult to achieve this

 

Thanks

Hi Salesforce,

 

Im using production.  To develop classes i created classes via eclipse.  At initial times, when i save classes they were taking less time only. 

 

Now-a-days, even a single change taking 40 minutes to save.

I have lot of work to complete.  But stuck at this problem.  Can anyone resolve my problem.

 

How can i save classes in production via eclipse so fastly?

 

Hi,

 

I have a question about IP whitelist.

I have use OAuthe 2.0 Username-Password Flow to access salesforce, and with this flow I need to use the security_token in my request like "password=mypassword+security_token".

So I want to know if I add my IP or my organization in the whitelist (Newwork Access), whether I can avoid to use the security_token.

 

Thanks!

hi,

 

I have displayed all the object names in a select list and while an object is selected, i am retrieving the object name and i have to select the field names for it. For this i found that the syntax as given below,

 

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

 

The Account object is hardcoded here, but, in my scenario, object name is dynamically changing, how to modify this syntax into dynamically changing one. any ideas or any other syntax's available to get field names?? 

Or is there any soql query to retrieve the field for the requested object? please provide any ideas or suggestions to retrieve the field names...

 

thanks,

abivenkat,

SFDC Learner

Hi All,

I trying to create a folder from Salesforce to S3 Bucket but I am getting Below error - 
System.HttpResponse[Status=Forbidden, StatusCode=403]
<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.

Below is the endPoint which is i am sending
10:25:32:125 CALLOUT_REQUEST [45]|System.HttpRequest[Endpoint=https://test-sandbox.s3.us-east-1.amazonaws.com/SandboxAccounts/00P0o00001qiBHQEA2-Unsubscribeoptout.pdf, Method=PUT]

When I just remove the folder name, the file is directly created in the bucket. 

Can anyone help me?

Thanks
ShaT
 
  • January 18, 2019
  • Like
  • 0
Hi All,

I am creating opportunity from force.com site and submitting the opportunity for Approval, I am getting Below error.
Process failed. First exception on row 0; first error: NO_APPLICABLE_PROCESS, No applicable approval process was found.

When i create opp from the normal user, its working fine. 

Thanks
ShaT
  • April 17, 2018
  • Like
  • 0
Hi Guys,

I am facing issue displaying static image map on the PDF.  I have a visualforce page where i am displaying a static map image its showing fine. But when i render the page as pdf its not showing. 

Could you any one provide soultion?

Thanks
User-added image
  • July 11, 2017
  • Like
  • 0
I have a javaScript method in my visualforce page, which is adding a css when page loads.
Code adds the css to radio buttons to look similar to Lightning radio buttons. Its giving XSS erorr when submitted for CheckMarx security.
var Row = document.getElementsByClassName("convertToLSD"); 
for (var k = 0; k < Row.length; k++) { 
var colTds = Row[k].getElementsByTagName("td"); 
for (var i = 0; i < colTds.length; i++) { 
var inrHtml = colTds[i].innerHTML; var chkId = inrHtml.substring(inrHtml.indexOf("id=") + 4, inrHtml.indexOf("\"", inrHtml.indexOf("id=") + 4)); 
var chkBx = inrHtml.substring(inrHtml.indexOf("<input"), inrHtml.indexOf(">") + 1); var chkLable = colTds[i].getElementsByTagName("label")[0].textContent; var typeOfInput = colTds[i].getElementsByTagName("input")[0].getAttribute("type"); var newChkBox = '<label class="slds-' + typeOfInput + '" for="' + chkId + '">' + chkBx + '<span class="slds-' + typeOfInput + '--faux"></span>' + '<span class="slds-form-element__label">' + chkLable + '</span>' + '</label>'; 
colTds[i].innerHTML = newChkBox; } }

I tried in my apex code with select options
options.add(new selectOption(u.Id,u.Name.escapehtml4()));

How can i remove the vulnerability from my javascript so code is passed by CheckMarx.
  • April 12, 2017
  • Like
  • 0
Hi,

I have a phone no- +1 2132007307  which i need to convert into (213) 200-7307 this format. 
How can i do this with formula field.

Thanks
ShaT
  • July 14, 2015
  • Like
  • 0
Hi All,
I have requirement to create campaign from salesfore to mail chimp, If any one have done in past please share your thoughts.

Thanks
ShaT
  • January 30, 2015
  • Like
  • 0
Hi,

How can i insert time format in 24 hour in Datetime field.

Eg-User-added image

I want datetime to displayed as 10/03/2014 23:19



Thanks
ShaT
  • October 04, 2014
  • Like
  • 0
HI,

How can i get week diffrence, suppose if startdate is today's date and end date is after two weeks, so we will calculate the week diffrence from two dates.
How will we calculate week is changed in end date.


Thanks
ShaT
  • September 30, 2014
  • Like
  • 0
Hi

How can we add a side panel in standerd community and display header values in side panel and remove header.

secondly how can we customize the look and feel of community as per our CSS.


Thanks
ShaT
  • September 21, 2014
  • Like
  • 0
Hi,

I have created a custom email template and i have added a backgound image in body tag and have some merged fileds.

When i save the template i can see the background image and merge field but when i mail the template i am not able to see the Background image i see only only text. 

Wolud any one share there expericance how they resloved this error or any one have any idea how i can reslove this.

Thanks
ShaT


  • September 17, 2014
  • Like
  • 0
Hi,

How to create custom login page for community.

I have tried copule of links - but they are not working. Below are the linkes i have used-

http://www.forcetree.com/2014/05/salesforce-login-page-custom-login-page.html
http://blogforce9.blogspot.in/2014/05/salesforce-login-access-salesforce.html

Can any one share there experiance creating cutom login page.

Thanks
ShaT
  • September 12, 2014
  • Like
  • 0
Hi,

I am trying to open a hyperlink on my account record. I have field website on Account. I have created a button which will open the website.
i treid with URL but its adds the salesforce url and than addes the website

Could any one provide me the sloution.

Thanks
ShaT
  • September 05, 2014
  • Like
  • 0
Hi,

How to interate X2Engine CRM with salesforce. Have any one done the integration?
Please help..!!!


Thanks
SHAT
  • August 25, 2014
  • Like
  • 0
Hi All,
I spend one day and could not fix this problem. when I run these code below in it throw the error: Status=Length Required, StatusCode=411, Please help me to take a look at it.
Http h = new Http();
       
        HttpRequest req = new HttpRequest();
        req.setEndpoint('https://www.google.com/user/?email=abc@gmail.com');
        req.setMethod('POST');
        req.setCompressed(true);
        req.setHeader('key', '1212113232');
        req.setHeader('Content-Type','text/xml');
       // req.setHeader('Content-Length', '1');// tired it out with diffrent values but still getting error
       
     
System.debug('----------------req-'+req);
        HttpResponse res = h.send(req);
        System.debug(res.getBody());

Result -
HTML><HEAD><TITLE>Length Required</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Length Required</h2>
<hr><p>HTTP Error 411. The request must be chunked or have a content length.</p>
</BODY></HTML>

Thanks
Shail
  • June 12, 2014
  • Like
  • 0
Hi All,

I have a requirement to display user a warning message on-click of std ‘Save’ button on Custom object.
Do anybody have any ideas how can i do this...?


Thanks
SHaT
  • April 23, 2014
  • Like
  • 0
Hi All,

I have an issue with an auto-response rule.The lead auto-response rule doesn't fire when a lead is created from webtolead. 
Upon disabling the trigger, the auto-response rule works Fine but  When enabled, the trigger works as expected but the auto-response doesn't get excuted.

I have used below code but still auto-response is not getting excuted. 
Database.DMLOptions dlo = new Database.DMLOptions();
dlo.EmailHeader.triggerAutoResponseEmail = true;

Please anybody can help on this.

Thanks
ShaT
  • February 27, 2014
  • Like
  • 0
Hi All,

I want to integrate SOQL database with salesforce.
I would like to create a visual force page just to display data get from my database (SOQL) and upon clicking on a button will update back the data into my database (SOQL). I do not want to store any data in Salesforce.

Will it be possible?

Thanks
Shailu

  • January 31, 2014
  • Like
  • 0
Hi All,

I m getting below error while trying to intiate Zuora object  in SFDC test class.

Eg- Zuora.zObject a = new Zuora.zObject('Account');

Please upload Zuora WSDL at first.

Kindly let me know if anybody have any solution.

Thanks
Shailu
  • December 23, 2013
  • Like
  • 0

HI All,

 

I currently have an Email Alert setup as the output from a Workflow when a new record is created. This is all working fine.

 

However, I would like to be able to change the 'from' email address.

 

It shows my email address, but i dont want to display my email address .

 

Ideally I would like this to be 'no-reply@my_company_domain'.

 

How can i acheive this?

 

Thanks

Shailu

  • December 01, 2013
  • Like
  • 0

Hi All,

 

I m getting below error while updating Opportunity.

 

System.QueryException: null: 

 

When i query in debug log its works fine, but when i run the Query in class is gives me above exception.

 

Select SplitPercentage, SplitOwnerId, SplitNote, SplitAmount, OpportunityId, Id From OpportunitySplit where OpportunityId!=null and OpportunityId IN('006Z0000007XSSDSSD') limit 50000

 

So any one has any idea where i am going wrong.

 

Thanks

Shailu

 

  • October 01, 2013
  • Like
  • 0
Hi Guys,

I am facing issue displaying static image map on the PDF.  I have a visualforce page where i am displaying a static map image its showing fine. But when i render the page as pdf its not showing. 

Could you any one provide soultion?

Thanks
User-added image
  • July 11, 2017
  • Like
  • 0
I have enabled "Agent File Transfer Enabled" in Live Agent Configurations
User-added image

I have added <liveAgent:clientChatFileTransfer> in my custom chat VF page 
 
<apex:page showHeader="false">
<style>
body { overflow: hidden; width: 100%; height: 100%; padding: 0; margin: 0 }
#waitingMessage { height: 100%; width: 100%; vertical-align: middle; text-align: center; display: none; }
#liveAgentClientChat.liveAgentStateWaiting #waitingMessage { display: table; }
#liveAgentSaveButton, #liveAgentEndButton, #liveAgentFileTransfer { z-index: 2; }
.liveAgentChatInput {
    height: 25px;
    border-width: 1px;
    border-style: solid;
    border-color: #000;
    padding: 2px 0 2px 4px;
    background: #fff;
    display: block;
    width: 99%;
}
.liveAgentSendButton {
    display: block;
    width: 60px;
    height: 31px;
    padding: 0 0 3px;
    position: absolute;
    top: 0;
    right: -67px;
}
#liveAgentChatLog {
    width: auto;
    height: auto;
    top: 0px;
    position: absolute;
    overflow-y: auto;
    left: 0;
    right: 0;
    bottom: 0;
}


</style>
<div style="top: 0; left: 0; right: 0; bottom: 0; position: absolute;">
<liveAgent:clientchat >
    <liveAgent:clientChatSaveButton label="Save Chat" />
    <liveAgent:clientChatEndButton label="End Chat" />
    <liveAgent:clientChatFileTransfer />
    <div style="top: 25px; left: 5px; right: 5px; bottom: 5px; position: absolute; z-index: 0;">
    <liveAgent:clientChatAlertMessage />
    <liveAgent:clientChatStatusMessage />
    <table id="waitingMessage" cellpadding="0" cellspacing="0">
    <tr>
    <td>
        <div><h1>Please wait while you are connected to an <b><u>RCI Support Agent</u></b></h1></div>
        <div><img src="https://test-rci-support-agent-developer-edition.ap2.force.com/phase2/resource/1450782443000/waitingBar"></img></div>
    </td>
    </tr>
    </table>
    <div style="top: 0; right: 0; bottom: 41px; left: 0; padding: 0; position: absolute; word-wrap: break-word; z-index: 0;">
    <liveAgent:clientChatLog />
    </div>
    <div style="position: absolute; height: auto; right: 0; bottom: 0; left: 0; margin-right: 67px;">
        <liveagent:clientChatInput /><liveAgent:clientChatSendButton label="Send"/>
    </div>
    </div>
</liveAgent:clientchat>
</div>
</apex:page>




But not able to find the file transfer option in agent view or in client chat window.

Please help 

 
Hi all,

I have created a test class for a VF page but not sure if it is working. The Apex class we are trying to test is shown below: Thanks

Class
public class EvertonUsersLeavers {

  public List<Everton_Users__c> getEvertonUsersLeavers() {
        return [SELECT Name, Leaver_Date__c, Email_Address__c FROM Everton_Users__c
                WHERE Leaver_Date__c >=  TODAY];
    }
}

Test Class
@isTest
public class EvertonUsersLeaversTest{
    public static testMethod void EvertonUsersLeavers(){
         

        Everton_Users__c USER = new Everton_Users__c(
            Name = 'Test Name',
            Leaver_Date__c = Date.newInstance(2015 , 07 ,15),
            Email_Address__c = 'test@evertonfc.com'
        
        );
        insert USER;

      
    }
}



 
Hi All, 

getting this error "record id cannot be empty key", while inserting a Case using VF.

I Have a created a VF page with StandardSetController means RecordSetVar="true". Standard Controller ="Case"
I have used in StandardSetController in Extensions Controller.
  cas=(Case)controller.getRecord();
 cas.RecordTypeID=rtID;
        cas.OwnerID=UserInfo.getUserID();    
      
and i have overrieded Save Method and below 

public PageReference Save()
    {
   
        try{
      // Case c=new Case();
       c1=cas;
            insert c1;
            return New PageReference('/'+cas.id);
        }
        catch(Exception e){
            ApexPages.addMessages(e);
        }
        return null;
    }

while inserting a Case i am getting "record id cannot be empty key",  error
In the ViewState, i found Case id is having 00000000000 

Can anyone know about this, help me out.

Thanks 


 
Hi All,
I have requirement to create campaign from salesfore to mail chimp, If any one have done in past please share your thoughts.

Thanks
ShaT
  • January 30, 2015
  • Like
  • 0
Hi,

How can i insert time format in 24 hour in Datetime field.

Eg-User-added image

I want datetime to displayed as 10/03/2014 23:19



Thanks
ShaT
  • October 04, 2014
  • Like
  • 0
Hi,

I have created a custom email template and i have added a backgound image in body tag and have some merged fileds.

When i save the template i can see the background image and merge field but when i mail the template i am not able to see the Background image i see only only text. 

Wolud any one share there expericance how they resloved this error or any one have any idea how i can reslove this.

Thanks
ShaT


  • September 17, 2014
  • Like
  • 0
Hi,

How to create custom login page for community.

I have tried copule of links - but they are not working. Below are the linkes i have used-

http://www.forcetree.com/2014/05/salesforce-login-page-custom-login-page.html
http://blogforce9.blogspot.in/2014/05/salesforce-login-access-salesforce.html

Can any one share there experiance creating cutom login page.

Thanks
ShaT
  • September 12, 2014
  • Like
  • 0
Hi All,
I spend one day and could not fix this problem. when I run these code below in it throw the error: Status=Length Required, StatusCode=411, Please help me to take a look at it.
Http h = new Http();
       
        HttpRequest req = new HttpRequest();
        req.setEndpoint('https://www.google.com/user/?email=abc@gmail.com');
        req.setMethod('POST');
        req.setCompressed(true);
        req.setHeader('key', '1212113232');
        req.setHeader('Content-Type','text/xml');
       // req.setHeader('Content-Length', '1');// tired it out with diffrent values but still getting error
       
     
System.debug('----------------req-'+req);
        HttpResponse res = h.send(req);
        System.debug(res.getBody());

Result -
HTML><HEAD><TITLE>Length Required</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Length Required</h2>
<hr><p>HTTP Error 411. The request must be chunked or have a content length.</p>
</BODY></HTML>

Thanks
Shail
  • June 12, 2014
  • Like
  • 0
HI,

          In my service it showing that an error for  products Upsert

    
     Map<string,Product2> existpccMap = new Map<string,Product2>();
   set<string> pCodeSet = new set<string>();
 

for(integer k = 0;k<req.accounts.size(); k++){ // ONCE CHECK IT
        for(integer j=0;j<req.accounts[k].prods.size();j++)
        {
            pCodeSet.add(req.accounts[k].prods[j].pCode);
        }
  
(Product2 p2 : [select id,productCode from Product2 where ProductCode IN : pCodeSet]) {
    existpccMap.put(p2.productCode,p2);
}
for(integer j=0; j< req.accounts[k].prods.size(); j++) {

   if (existpccMap.containsKey(req.accounts[k].prods[j].pCode)) {
     p = existpccMap.get(req.accounts[k].prods[j].pCode);
   } else {
     p = new Product2();
   }
   p.productCode = req.accounts[k].prods[j].pCode;
   p.name =req.accounts[k].prods[j].pName;
   pList.add(p);
}
}
Database.upsert(pList); // Error Occur Point     May  i know what i have to do.
Hi Guys,

Can any one help me to track the emails that where bounce while sending from apex class. 

Some quick background of what Im trying to do..

The following is my Apex Trigger. It is a validation Trigger on Sampling_c which will validate that Country_c is a Valid country using Validation_country_c. When it validates Country_c it will look into State_province_c and will then validate that it is actually a state So .. If Country_c = US and State_province_c = CA then we are okay. But IF Country_c = US and State_province_c = ZZ221(whatever) it should fail. Now these condition checks only triggers when Override_c = 'Yes'.

I've also written a test class that is ignoring some lines, but  I will work one issue at a time.

validCountries.get( obj.Transportation_Zone__c,obj ); This line is breaking, but I believe its happening because of 

--

Map<String, Validation_Country__c> validCountries = new Map<String, Validation_Country__c>();

The Error that I'm getting is --
Method does not exist or incorrect signature: [MAP<String,Validation_Country__c>].get(String, SOBJECT:Validation_Country__c)

Can anyone give me some guidance?

trigger OverrideTrigger on Sampling__c (before insert,before update) {

// Top level map is keyed by Country. Inner Map is keyed by Region
    Map<String, Validation_Country__c> validCountries = new Map<String, Validation_Country__c>();
    Map<String, Map<String, Validation_Region__c>> validRegions = new Map<String, Map<String, Validation_Region__c>>();
// ...

   For(Validation_Country__c obj : [Select Id,Country_Name__c,Transportation_Zone__c FROM Validation_Country__c]){
        validCountries.get( obj.Transportation_Zone__c,obj );
        System.debug(validCountries);
              
    }
   
For(Validation_Region__c objR : [Select Id,Country_Key__c,Description__c,Name FROM Validation_Region__c]){

    String countryKey = objR.Country_Key__c;

    Map<String, Validation_Region__c> regionMap = validRegions.get(countryKey);
    // Maybe rework to use Map.containsKey rather than null check. Would be cleaner.
   
    if(regionMap == null) {
        regionMap = new Map<String, Validation_Region__c>();
        validRegions.put(countryKey, regionMap);
    }
    string regionKey = objR.Description__c;
    regionMap.put( regionKey,objR);
    }


For( Sampling__c s : Trigger.new){
    If((s.Country__c != null) && (S.Override__c == 'Yes')){
        String countryKey = s.Country__c;
        String regionKey = s.State_Province__c;
 
       // If(validCountries.containsKey(countryKey) && validRegions.containsKey(countryKey)) {
            // The country appears to be valid and there are possible Region matches
          //  Validation_Country__c vc = validCountries.get(countryKey);
              
            If(validRegions.get(countryKey).containsKey(regionKey)) {
                // The Region belongs to the country
                Validation_Region__c vr = validRegions.get(countryKey).get(regionKey);
             }
   
         }
     }
}

Hi,

 

I am trying to create the mailchimp campaign through saelsforce. When i am creating the campian i am getting error as 'You must specify a options value for the campaignCreate method'. I have specified everything. But still i am facing the same issue. Any body help me please. I have used the endpoint url as

 

req.setEndpoint('http://us5.api.mailchimp.com/1.3/?output=xml&method=campaignCreate&apikey=myapikey&type=regular&list_id=mylistid&subject=test through code&from_email=xxx@xx.com&from_name=lakshmi&to_name=sample&html=hi&text=sample test&url=www.advaanz.com');

 

This is the api document http://apidocs.mailchimp.com/api/1.3/campaigncreate.func.php. Any body please helpme.

 

Thanks,

Lakshmi