• clouddev@surashri
  • NEWBIE
  • 95 Points
  • Member since 2013

  • Chatter
    Feed
  • 2
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 21
    Questions
  • 32
    Replies

I am looking for an example to create a Trigger that will copy the first n character (255 characters) from the TASK standard field called - Description to the custom field under TASKS called - "Extract Task Heading".

 

Any examples on how to copy values within same object and different fields would also help?

 

thanks.

Hi All,

I am not able to get values from pageblockdata table into actionsupport action function after clicking checkbox associated with it.
I have a table. After loading page, I am follwing listed steps. Also attaching screenshots and code too.

1 - Screen looks like below once loaded.
User-added image

2 - Using new email id I am popoulating 2nd row, other details like firstname, lastname from contact object are populated. The function searchContact() works fine
User-added image
3 - Then clicking substitute check box on the left of first row. This invokes chngeShowFlag() function. I am just using system.debug() statement in this function.
User-added image
I am not able to trace 2nd row value in function chngeShowFlag() No values for 2nd row are show in 
system.debug('trueBookingRecords- ' + trueBookingRecords);
        system.debug('EventBookingRecords first- ' + EventBookingRecords);
Visualforce Page
 
<apex:page standardController="Special_Event__c" extensions="BSCDelegateCaptureController" id="page">
    <apex:sectionHeader title="Delegate Capture Form" subtitle="{!BSCEvent.Product__r.Name}" />
    <apex:form id="form">
        <apex:pageBlock >
        <apex:pageMessages />

        <apex:pageBlockSection id="pbs">
            <apex:pageblocktable value="{!trueBookingRecords}" var="ebrecs" id="pbt">

                <apex:Column headerValue="Substitue">
        <!--apex:actionRegion id="ar1"-->
                    <apex:inputCheckbox value="{!ebrecs.isSubstitute}" rendered="{!ebrecs.isCheckBoxShow}">

                        <apex:actionsupport event="onclick" action="{!chngeShowFlag}" rerender="pbs" immediate="true">
                            <apex:param assignto="{!index}" name="param1" value="{!ebrecs.index}"/>
                            <apex:param assignto="{!serial}" name="param2" value="{!ebrecs.serial}"/>
                            <apex:param assignto="{!isSubstitute}" name="param3" value="{!ebrecs.isSubstitute}"/>
                        </apex:actionsupport>
                    </apex:inputCheckbox>
        <!--/apex:actionRegion-->
                </apex:Column>
                
                <apex:Column >
                    <apex:facet name="header">Booking Name</apex:facet>
                    <apex:outputText value="{!ebrecs.EventBooking.Name}" rendered="{!ebrecs.isShow}"/>
                </apex:Column>

                <apex:Column >
                    <apex:facet name="header">Booking Account</apex:facet>
                    <apex:outputText value="{!ebrecs.bookingAccount.Name}" rendered="{!ebrecs.isShow}"/>
                </apex:Column>

                <apex:Column id="em" >
                    <apex:facet name="header">Email</apex:facet>
                    <apex:actionRegion >
                    <apex:outputPanel rendered="{!(ebrecs.isEmail)}">
                        <apex:inputField value="{!ebrecs.bookingContact.email}" rendered="{!ebrecs.isShow}">
                            <apex:actionsupport event="onchange" action="{!searchContact}" reRender="em,fm,lm,ph,bd">
                                <apex:param assignto="{!index}" name="param1" value="{!ebrecs.index}"/>
                                <apex:param assignto="{!serial}" name="param2" value="{!ebrecs.serial}"/>
                            </apex:actionsupport>
                        </apex:inputField>    
                    </apex:outputPanel>
                    <apex:outputPanel rendered="{!NOT(ebrecs.isEmail)}">
                        <apex:outputField value="{!ebrecs.bookingContact.email}" rendered="{!ebrecs.isShow}"/>
                    </apex:outputPanel>
                    </apex:actionRegion>
                </apex:Column>

                <apex:Column id="fm">
                    <apex:facet name="header">First Name</apex:facet>
                    <apex:outputPanel rendered="{!NOT(ebrecs.isSubstitute)}">
                        <apex:inputField value="{!ebrecs.bookingContact.firstname}" rendered="{!ebrecs.isShow}"/>
                    </apex:outputPanel>
                    <apex:outputPanel rendered="{!ebrecs.isSubstitute}">
                        <apex:outputField value="{!ebrecs.bookingContact.firstname}" rendered="{!ebrecs.isShow}"/>
                    </apex:outputPanel>
                </apex:Column>

                <apex:Column id="lm">
                    <apex:facet name="header">Last Name</apex:facet>
                    <apex:actionRegion >
                    <apex:outputPanel rendered="{!NOT(ebrecs.isSubstitute)}">
                        <apex:inputField value="{!ebrecs.bookingContact.lastname}" rendered="{!ebrecs.isShow}"/>
                    </apex:outputPanel>
                    <apex:outputPanel rendered="{!ebrecs.isSubstitute}">
                        <apex:outputField value="{!ebrecs.bookingContact.lastname}" rendered="{!ebrecs.isShow}"/>
                    </apex:outputPanel>
                    </apex:actionRegion>
                </apex:Column>

                <apex:Column id="ph">
                    <apex:facet name="header">Phone Number</apex:facet>
                    <apex:outputPanel rendered="{!NOT(ebrecs.isSubstitute)}">
                        <apex:inputField value="{!ebrecs.bookingContact.phone}" rendered="{!ebrecs.isShow}"/>
                    </apex:outputPanel>
                    <apex:outputPanel rendered="{!ebrecs.isSubstitute}">
                        <apex:outputField value="{!ebrecs.bookingContact.phone}" rendered="{!ebrecs.isShow}"/>
                    </apex:outputPanel>
                </apex:Column>

                <apex:Column id="bd">
                    <apex:facet name="header">Date of Birth</apex:facet>
                    <apex:outputPanel rendered="{!NOT(ebrecs.isSubstitute)}">
                        <apex:inputField value="{!ebrecs.bookingContact.birthdate}" rendered="{!ebrecs.isShow}"/>
                    </apex:outputPanel>
                    <apex:outputPanel rendered="{!ebrecs.isSubstitute}">
                        <apex:outputField value="{!ebrecs.bookingContact.birthdate}" rendered="{!ebrecs.isShow}"/>
                    </apex:outputPanel>
                </apex:Column>

                <apex:Column >
                    <apex:facet name="header">Booking Status</apex:facet>
                    <apex:selectList id="status" value="{!ebrecs.bookingStatus}" size="1" rendered="{!ebrecs.isShow}" disabled="{!ebrecs.isSubstitute}">
                        <apex:selectOption itemValue="novalue" itemLabel=""/>
                        <apex:selectOption itemValue="attended" itemLabel="Attended"/>
                        <apex:selectOption itemValue="noshow" itemLabel="No Show"/>
                    </apex:selectList>
                </apex:Column>
                
            </apex:pageblocktable>
        </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>
Controller
 
public class BSCDelegateCaptureController
{
    public Special_Event__c BSCEvent {get; set;}
    public List<Special_Event_Booking__c> BSCEventBookings {get; set;}

    public List<EventBookingRecs> EventBookingRecords {get; set;}
    public List<EventBookingRecs> trueBookingRecords {get; set;}
    public integer index {get; set;}
    public integer serial {get; set;}
    public Boolean isSubstitute {get; set;}

    public Set<Id> accIds {get;set;}

    public Map<String, Contact> allContactMap {get;set;}
    
    public class EventBookingRecs
    {
        public integer index {get; set;}
        public integer serial {get; set;}
        public Boolean isSubstitute {get; set;}
        public Boolean isShow {get;set;}
        public Boolean isCheckBoxShow {get;set;}
        public Boolean isEmail {get;set;}
        public String bookingStatus {get; set;}

        public Special_Event_Booking__c EventBooking {get; set;}
        public Account bookingAccount {get;set;}
        public Contact bookingContact {get;set;}
    }

    public List<EventBookingRecs> gettrueBookingRecords()
    {
        system.debug('Hello');
        return null;
    }

    public BSCDelegateCaptureController(ApexPages.StandardController controller) 
    {
        BSCEvent = (Special_Event__c)controller.getRecord();
        system.debug('BSCEvent - ' + BSCEvent);
        BSCEvent = [SELECT Name, Product__r.name FROM Special_Event__c where id = :BSCEvent.id];
        BSCEventBookings = [SELECT Name, Company__c, Company__r.name, Company__r.isPersonAccount, Contact__r.firstname, Contact__r.lastname, Contact__r.email, Contact__r.phone, Contact__r.birthdate FROM Special_Event_Booking__c where special_event__c = :BSCEvent.id];

        system.debug('BSCEventBookings - ' + BSCEventBookings);

        EventBookingRecords = new List<EventBookingRecs> ();
        trueBookingRecords = new List<EventBookingRecs> ();
        accIds = new Set<Id> ();
        allContactMap = new Map<String, Contact> ();

        integer counter = 0;
        integer serialCounter = 0;
        for(Special_Event_Booking__c seb : BSCEventBookings)
        {
            system.debug('Special_Event_Booking__c seb - ' + seb);

            EventBookingRecs ebrEven = new EventBookingRecs();
            ebrEven.EventBooking = seb;
            ebrEven.bookingAccount = new Account(Name=seb.Company__r.name);
            ebrEven.bookingContact = new Contact(Email=seb.Contact__r.email, FirstName=seb.Contact__r.firstname, LastName=seb.Contact__r.lastname, phone=seb.Contact__r.phone, birthdate=seb.Contact__r.birthdate);
            if(ebrEven.bookingContact.email != null)
            {
                ebrEven.isCheckBoxShow = true;
                ebrEven.isEmail = false;
            }
            else
            {
                ebrEven.isCheckBoxShow = false;
                ebrEven.isEmail = true;
            }

            ebrEven.isShow = true;
            ebrEven.isSubstitute = false;
            ebrEven.serial = serialCounter++;
            ebrEven.index = counter++;
            system.debug('ebrEven - ' + ebrEven);
            EventBookingRecords.add(ebrEven);
            

            EventBookingRecs ebrOdd = new EventBookingRecs();
            ebrOdd.EventBooking = seb;
            ebrOdd.bookingAccount = new Account(Name=seb.Company__r.name);
            ebrOdd.bookingContact = new Contact();
            ebrOdd.isCheckBoxShow = false;
            ebrOdd.isEmail = true;
            ebrOdd.isShow = false;
            ebrOdd.isSubstitute = false;
            ebrOdd.serial = serialCounter++;
            ebrOdd.index = counter++;
            system.debug('ebrOdd - ' + ebrOdd);
            EventBookingRecords.add(ebrOdd);
            counter++;

            accIds.add(seb.Company__c);
        }

       
        List<Contact> allAccountContacts = [Select Id, FirstName, LastName, Email, Phone, Birthdate From Contact where account.id in :accIds]; 

        system.debug('List<Contact> allAccountContacts - ' + allAccountContacts);
        
        for(Contact c : allAccountContacts)
        {
            allContactMap.put(c.email, c);
        }

        system.debug('allContactMap - ' + allContactMap);

        system.debug('EventBookingRecords - ' + EventBookingRecords);
        system.debug('EventBookingRecords.size() - ' + EventBookingRecords.size());
        counter = 0;
        for(EventBookingRecs er : EventBookingRecords)
        {
            if(er.isShow == true)
            {
                er.index = counter++;
                trueBookingRecords.add(er);
            }
        }
    }

    public void searchContact()
    {
        system.debug('index - ' + index);
        system.debug('serial - ' + serial);
        system.debug('trueBookingRecords[index].bookingContact.email - ' + trueBookingRecords[index].bookingContact.email);
        trueBookingRecords[index].bookingContact = allContactMap.get(trueBookingRecords[index].bookingContact.email);
        EventBookingRecords[serial].bookingContact = allContactMap.get(trueBookingRecords[index].bookingContact.email);
        system.debug('trueBookingRecords[index] - ' + trueBookingRecords[index]);
        system.debug('EventBookingRecords[serial] - ' + EventBookingRecords[serial]);
    }

    public void chngeShowFlag()
    {
        system.debug('index - ' + index);
        system.debug('serial - ' + serial);

        system.debug('trueBookingRecords- ' + trueBookingRecords);
        system.debug('EventBookingRecords first- ' + EventBookingRecords);
    }
}

Could you please help me to find exact issue? It will help a lot. Please also find VF and Apex code for your ref.

Best Regards,

Rahul
Hi,

I am running below code from sandbox execute anonymous window. I am not getting any mail after execution.
Account a = new Account(name='Acme Plumbing');

insert a;

Contact c = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber', accountid=a.id);

insert c;

Database.DMLOptions dlo = new Database.DMLOptions();

dlo.EmailHeader.triggerAutoResponseEmail = true;

Case ca = new Case(subject='Plumbing Problems', contactid=c.id);

database.insert(ca, dlo);
This is exmaple from Salesforce documentation. Do I have to any setting? Could I request a help?

Thanks,


Hi,

I am creating a visualforce page on opportunity. I am refering 4 lookup fields in this page. I am inserting this page in opportunity page layout. The page looks as

User-added image

The visualforce code section for Teleasales Partner is

<apex:pageBlockSectionItem id="section1" >
<apex:outputLabel value="Telesales Partner" for="tp_id" />
<apex:panelGroup >
  <apex:outputField value="{!opportunity.Telesales_Partner__c}" id="tp_id">
   <apex:inlineEditSupport showOnEdit="saveButton, cancelButton" event="ondblclick" changedStyleClass="myBoldClass" resetFunction="resetInlineEdit"/>
  </apex:outputField>
  <apex:outputLabel value="Commission Applicable? " for="tp_id2" style="font-weight:bold;font-family:Arial,Helvetica,sans-serif;" />
  <apex:inputField value="{!opportunity.Telesales_Partner_Commission_Flag__c}" id="tp_id2" onchange="selectFlag()">
  </apex:inputField>
</apex:panelGroup>
</apex:pageBlockSectionItem>

How can I disable link to lookup field but need to keep look up functionality. I want to disable link becase link opens record in page layout section as
User-added image

which I don't need ?

Could you please help ? Let me know if you need more details

Thanks,

clouddev@surashri
Hi All,

I have list of email domain example gmail.com, hotmail.com etc which are stored in a List variable. I want to use it in a SOQL LIKE so that I should be able to find all contacts having email ids with these domains. As there are more than 100+ domains I cannot use single query for each domain as it will go over SOQL 100 limit and throw an error

This is my code -

List<String> leadsEmail = new List<String> ();

for(lead l : uniq_leads)
{
            leadsEmail.add('\'%'+l.email.substring(l.email.indexof('@')+1)+'\'');
}

system.debug('Contacts - ' + [Select Id, Email, FirstName, LastName, OwnerId from Contact WHERE Email LIKE :leadsEmail]);


But is not returning any records. Could you please let me know exact syntax to use ? Please reply.

Thanks,

clouddev@Surashri
Hi,

I have created a community page where I have enabled Case tab with Read, Create and Edit access. I want to assign cases to community user.

- From my Salesforce account when I tried to assign case to community user, I don't get list of these users
- If community user wants to assign case to self , getting an error -
Can't Perform this Operation
You can't perform this operation with the selected user type.

'Getting Started with Communities' PDF says this
'When you enable cases for external users in your community, you can assign cases to those members. Additionally, external
members can edit cases, create new cases, add case comments, reassign cases, find case solutions, and create case teams. External
users can’t edit case comments, associate assets with cases, or delete cases.'

Could you please help me on this ? Am I missing any setting ?

Please reply.

Thanks,

Cloud Dev
Hi,

We want to allow document upload using <apex:inputFile> tag from Communities website we have developed. We are using Customer Community User licenses.
On Customer Community User profile Document has Read access and other access are disabled. It seems Community user can only read already uploaded document. Is that correct ?

But from Chatter tab Community User can upload file.

How can we allow our users to upload document from out community website ? Can anyone suggest alternative?

Please reply,

Thanks,

Clouddev
Hi,

I am desigining a visualforce page for internal users to create a record in custom object and case object. Users can access this Visualforce page only after using their username and password.It will be accessed by max 25 users as of now.
These users will not have access to any other standard objects. Could you please suggest a cost effective user licenses?

We are also in process of buying new licenses.

I am confused with different types of licenses in Salesforce

I have checked licenses like

High Volume Customer Portal
Customer Portal Manager Custom

But want to make sure.

All expert opinion will help.

Thanks,

Clouddev
Hi,

I am desigining a web page for internal users to create a record in custom object and case object. It will be accessed by max 25 users as of now.
These users will not have access to any other standard objects. Could you please suggest a cost effective user licenses?

We are also in process of buying new licenses.

I am confused with different types of licenses in Salesforce

I have checked licenses like

High Volume Customer Portal
Customer Portal Manager Custom

But want to make sure.

All expert opinion will help.

Thanks,

Clouddev

Hi,

 

How can I execute linux bash script from Salesforce. I want to execute once a check box is checked and workflow gets triggered.

 

Could you please reply?

 

Thanks,

 

Rahul

Hi,

 

I am running below query

 

SELECT account.name, account.partner_sales_person__c, account.crm_product__r.name, name, (select whoid, whatid from tasks where subject = 'DEMO') FROM contact WHERE account.partner_sales_person__c in ('clouddev')  AND account.crm_product__c != null and name like '%gore'

  and getting 2 records as shown.

 

Tasks	Name	Account

Tasks	Stephen Gore	Account
-----                   --------
	Steve Gore	Account
                        --------

 

Current relation is

 

Account 'XXX' has 2 contacts (Stephen Gore, Steve Gore) and only 'Stephen Gore' has Task DEMO created so I don't need 'Steve Gore' record as it has no task attached to it.

 

Please reply,

 

Thanks,

 

Clouddev

 

 

 

 

Hi,

 

In email template, I am using outputtext tag as below.

 

Following your conversation with {!recipient.account.Partner_Sales_Person__c}, we confirm that you are booked in for a demonstration  <apex:outputText value="{0,date, 'at' HH:mm z 'on' dd MMM yyyy}"> <apex:param value="{!DATETIMEVALUE(recipient.Web_Demo_Booking_Date_Time__c)}"/> </apex:outputText>

 

The time and date value are shown as per GMT but I want to show it as BST. What should be the value. of "value attribute".

 

Currently outputtext is

<apex:outputText value="{0,date, 'at' HH:mm z 'on' dd MMM yyyy}">

<apex:param value="{!DATETIMEVALUE(recipient.Web_Demo_Booking_Date_Time__c)}"/>

</apex:outputText>

 

Thanks,

 

Rahul

 

Hi,

 

I have a query where its checking multiple email domain like @gmail.com , @hotmail.com etc.

 

The query is like

 

SELECT company FROM lead WHERE email LIKE '%@gmail.com' OR email LIKE '%@hotmail.com'.

 

If I have to check more that 100 email domains in one go then it is exceeding 100 SOQL limit and giving "Too many SOQL queries: 101".

 

Is there any alternative syntax to achieve this task ?

 

Please reply,

 

Thanks,

 

clouddev@surashri

Hi,

 

I have a visual force page

 

<apex:page controller="callOutUsingHTTP">
    <apex:form >
        <apex:pageBlock title="My Content" mode="edit">
            <apex:pageBlockButtons >
                <apex:commandButton action="{!callOutMethod}" value="GET"/>
            </apex:pageBlockButtons>
        </apex:pageBlock>
    </apex:form>  
</apex:page>

 I am calling a callout  method which is a requesting some data from our internal web server.

 

The class and function is as

 

public class callOutUsingHTTP
{
    public void callOutMethod()
    {
        HttpRequest req = new HttpRequest();
        req.setEndpoint('https://testing.xxxxxx.com/xxxxxx/xxxxxx/GetAPIInfo?method=CCCCCCCC');
        req.setMethod('GET');
        req.setHeader('username', 'UUUUUUU');
        req.setHeader('password', 'PPPPPPP');
        req.setHeader('LicenseKey', 'some-value-here');
        req.setClientCertificateName('testCallOutCert');

        system.debug('HttpRequest - ' + req);

        Http http = new Http();
        HTTPResponse res = http.send(req);
        System.debug(res.getBody());
    }
}


I have also registered this server at setup->security controls -> remote site settings.

 

I am getting error as mentioed in subject line. 

 

Can someone please let me know the missing link here?

 

It will help a lot.

 

Thanks,

 

clouddev@surashri.

 

 

Hi,

 

I am trying to extract a data from our org based web service and updating that inform on salesforce account object.

 

I am using shell script to do this task

1 - Using curl command its connecting to org based web service and fetching data using standard apis.

2 - doing some data formating and generating JSON format file

3 - using this JSON file to update salesforce fields, again using curl command to update those fields.

 

For step 3, i have written a @RestReource class and @HTTPPost based function. All is working fine.

 

But I want to know, can I convert step 1 "which is currently using curl command to access web services api" to some classes in salesforce ? How can I achieve that? It will help if you give some example links, pdf etc. I saw topics about HTTP callouts but didn't get it and how am I going to achieve this?

 

Thanks,

 

clouddev@surashri.

Hi,

 

Is there any way to convert normal text fields like phone, fax number to link on account, contact pages. I mean it should display as link where it is just normal text phone number. If we install softwares like skype, you can get the same result but I want to do it using apex or anyother Salesforce way.

 

Please reply,

 

Thanks,

 

Surashri

Hi,

 

Recently for last 4-5 days I am not able to see posts on http://boards.developerforce.com/sforce/board?board.id=Visualforce

and getting error as below.

 

An Unexpected Error has occurred. Sorry, your request failed. A notification has been sent to the development team for investigation. Exception ID: 5F60D76C

Please click the Back button on your browser. .

Return to my original page

 

Can anyone tell me what could be the reason. I am able to see posts on other pages only problem with VF page.

 

Thanks,

 

Hi,

 

If I have to use destructivechanges.xml for removing couple of classes from org, do I need to specify those classes in package.xml in same directory. It is not clear from migration guide. Please clarify.

 

Thanks

Hi,

 

Is it possible to get the consolidated list of governor limits for interview preparation as its difficult to remember complete list?

 

Please reply

 

thanks,

Hi All,

 

In VF Developer's guide (pg 274) I found below code.

 

<apex:outputPanel onclick="methodOneInJavascript('Yes!')" styleClass="btn" >
    Click Me
</apex:outputPanel>

 

styleClass attribute is used in many VF components. The btn value here is for button.

 

What ref was used to refer 'btn' value in styleClass here?

Where can I find detail documentation about which styleClass is used for which component?

 

The VF dev guide don't have these details and its confusing to understand sometimes.

 

Thanks in Advance,

 

clouddev

Hi,

 

I am currently reading on "Apex Methods as SOAP Web Services". After reading apex documents and material on net. I could manage to gather logical steps given below to use apex method as SOAP web service.

 

  1. Write a public class and a static webservice(keyword) method. This will be exposed as web service method because of webservice keyword.
  2. Generate a WSDL file for above class.
  3. Also generate Enterprise WSDL file(??) I am not sure the exact use of this file.
  4. Consume both files in any of the languages like C#, .NET, PHP etc.
  5. This will generate appropriate code in one of these languages.
  6. Write a code with username,password authentication to call webservice method written in step 1.(??) Are there a standard steps available to call this method (Similar to SQL cursor)?
  7. Run Test to check correct results.

Can someone please correct me if I am wrong in putting above steps? Also explain why we need this enterprise WSDL and query asked in Step 6?

 

If some one can send a working example to try, It will help a lot.

 

Thanks,

 

clouddev

 

Hi,

We want to allow document upload using <apex:inputFile> tag from Communities website we have developed. We are using Customer Community User licenses.
On Customer Community User profile Document has Read access and other access are disabled. It seems Community user can only read already uploaded document. Is that correct ?

But from Chatter tab Community User can upload file.

How can we allow our users to upload document from out community website ? Can anyone suggest alternative?

Please reply,

Thanks,

Clouddev
Hi All,

I am not able to get values from pageblockdata table into actionsupport action function after clicking checkbox associated with it.
I have a table. After loading page, I am follwing listed steps. Also attaching screenshots and code too.

1 - Screen looks like below once loaded.
User-added image

2 - Using new email id I am popoulating 2nd row, other details like firstname, lastname from contact object are populated. The function searchContact() works fine
User-added image
3 - Then clicking substitute check box on the left of first row. This invokes chngeShowFlag() function. I am just using system.debug() statement in this function.
User-added image
I am not able to trace 2nd row value in function chngeShowFlag() No values for 2nd row are show in 
system.debug('trueBookingRecords- ' + trueBookingRecords);
        system.debug('EventBookingRecords first- ' + EventBookingRecords);
Visualforce Page
 
<apex:page standardController="Special_Event__c" extensions="BSCDelegateCaptureController" id="page">
    <apex:sectionHeader title="Delegate Capture Form" subtitle="{!BSCEvent.Product__r.Name}" />
    <apex:form id="form">
        <apex:pageBlock >
        <apex:pageMessages />

        <apex:pageBlockSection id="pbs">
            <apex:pageblocktable value="{!trueBookingRecords}" var="ebrecs" id="pbt">

                <apex:Column headerValue="Substitue">
        <!--apex:actionRegion id="ar1"-->
                    <apex:inputCheckbox value="{!ebrecs.isSubstitute}" rendered="{!ebrecs.isCheckBoxShow}">

                        <apex:actionsupport event="onclick" action="{!chngeShowFlag}" rerender="pbs" immediate="true">
                            <apex:param assignto="{!index}" name="param1" value="{!ebrecs.index}"/>
                            <apex:param assignto="{!serial}" name="param2" value="{!ebrecs.serial}"/>
                            <apex:param assignto="{!isSubstitute}" name="param3" value="{!ebrecs.isSubstitute}"/>
                        </apex:actionsupport>
                    </apex:inputCheckbox>
        <!--/apex:actionRegion-->
                </apex:Column>
                
                <apex:Column >
                    <apex:facet name="header">Booking Name</apex:facet>
                    <apex:outputText value="{!ebrecs.EventBooking.Name}" rendered="{!ebrecs.isShow}"/>
                </apex:Column>

                <apex:Column >
                    <apex:facet name="header">Booking Account</apex:facet>
                    <apex:outputText value="{!ebrecs.bookingAccount.Name}" rendered="{!ebrecs.isShow}"/>
                </apex:Column>

                <apex:Column id="em" >
                    <apex:facet name="header">Email</apex:facet>
                    <apex:actionRegion >
                    <apex:outputPanel rendered="{!(ebrecs.isEmail)}">
                        <apex:inputField value="{!ebrecs.bookingContact.email}" rendered="{!ebrecs.isShow}">
                            <apex:actionsupport event="onchange" action="{!searchContact}" reRender="em,fm,lm,ph,bd">
                                <apex:param assignto="{!index}" name="param1" value="{!ebrecs.index}"/>
                                <apex:param assignto="{!serial}" name="param2" value="{!ebrecs.serial}"/>
                            </apex:actionsupport>
                        </apex:inputField>    
                    </apex:outputPanel>
                    <apex:outputPanel rendered="{!NOT(ebrecs.isEmail)}">
                        <apex:outputField value="{!ebrecs.bookingContact.email}" rendered="{!ebrecs.isShow}"/>
                    </apex:outputPanel>
                    </apex:actionRegion>
                </apex:Column>

                <apex:Column id="fm">
                    <apex:facet name="header">First Name</apex:facet>
                    <apex:outputPanel rendered="{!NOT(ebrecs.isSubstitute)}">
                        <apex:inputField value="{!ebrecs.bookingContact.firstname}" rendered="{!ebrecs.isShow}"/>
                    </apex:outputPanel>
                    <apex:outputPanel rendered="{!ebrecs.isSubstitute}">
                        <apex:outputField value="{!ebrecs.bookingContact.firstname}" rendered="{!ebrecs.isShow}"/>
                    </apex:outputPanel>
                </apex:Column>

                <apex:Column id="lm">
                    <apex:facet name="header">Last Name</apex:facet>
                    <apex:actionRegion >
                    <apex:outputPanel rendered="{!NOT(ebrecs.isSubstitute)}">
                        <apex:inputField value="{!ebrecs.bookingContact.lastname}" rendered="{!ebrecs.isShow}"/>
                    </apex:outputPanel>
                    <apex:outputPanel rendered="{!ebrecs.isSubstitute}">
                        <apex:outputField value="{!ebrecs.bookingContact.lastname}" rendered="{!ebrecs.isShow}"/>
                    </apex:outputPanel>
                    </apex:actionRegion>
                </apex:Column>

                <apex:Column id="ph">
                    <apex:facet name="header">Phone Number</apex:facet>
                    <apex:outputPanel rendered="{!NOT(ebrecs.isSubstitute)}">
                        <apex:inputField value="{!ebrecs.bookingContact.phone}" rendered="{!ebrecs.isShow}"/>
                    </apex:outputPanel>
                    <apex:outputPanel rendered="{!ebrecs.isSubstitute}">
                        <apex:outputField value="{!ebrecs.bookingContact.phone}" rendered="{!ebrecs.isShow}"/>
                    </apex:outputPanel>
                </apex:Column>

                <apex:Column id="bd">
                    <apex:facet name="header">Date of Birth</apex:facet>
                    <apex:outputPanel rendered="{!NOT(ebrecs.isSubstitute)}">
                        <apex:inputField value="{!ebrecs.bookingContact.birthdate}" rendered="{!ebrecs.isShow}"/>
                    </apex:outputPanel>
                    <apex:outputPanel rendered="{!ebrecs.isSubstitute}">
                        <apex:outputField value="{!ebrecs.bookingContact.birthdate}" rendered="{!ebrecs.isShow}"/>
                    </apex:outputPanel>
                </apex:Column>

                <apex:Column >
                    <apex:facet name="header">Booking Status</apex:facet>
                    <apex:selectList id="status" value="{!ebrecs.bookingStatus}" size="1" rendered="{!ebrecs.isShow}" disabled="{!ebrecs.isSubstitute}">
                        <apex:selectOption itemValue="novalue" itemLabel=""/>
                        <apex:selectOption itemValue="attended" itemLabel="Attended"/>
                        <apex:selectOption itemValue="noshow" itemLabel="No Show"/>
                    </apex:selectList>
                </apex:Column>
                
            </apex:pageblocktable>
        </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>
Controller
 
public class BSCDelegateCaptureController
{
    public Special_Event__c BSCEvent {get; set;}
    public List<Special_Event_Booking__c> BSCEventBookings {get; set;}

    public List<EventBookingRecs> EventBookingRecords {get; set;}
    public List<EventBookingRecs> trueBookingRecords {get; set;}
    public integer index {get; set;}
    public integer serial {get; set;}
    public Boolean isSubstitute {get; set;}

    public Set<Id> accIds {get;set;}

    public Map<String, Contact> allContactMap {get;set;}
    
    public class EventBookingRecs
    {
        public integer index {get; set;}
        public integer serial {get; set;}
        public Boolean isSubstitute {get; set;}
        public Boolean isShow {get;set;}
        public Boolean isCheckBoxShow {get;set;}
        public Boolean isEmail {get;set;}
        public String bookingStatus {get; set;}

        public Special_Event_Booking__c EventBooking {get; set;}
        public Account bookingAccount {get;set;}
        public Contact bookingContact {get;set;}
    }

    public List<EventBookingRecs> gettrueBookingRecords()
    {
        system.debug('Hello');
        return null;
    }

    public BSCDelegateCaptureController(ApexPages.StandardController controller) 
    {
        BSCEvent = (Special_Event__c)controller.getRecord();
        system.debug('BSCEvent - ' + BSCEvent);
        BSCEvent = [SELECT Name, Product__r.name FROM Special_Event__c where id = :BSCEvent.id];
        BSCEventBookings = [SELECT Name, Company__c, Company__r.name, Company__r.isPersonAccount, Contact__r.firstname, Contact__r.lastname, Contact__r.email, Contact__r.phone, Contact__r.birthdate FROM Special_Event_Booking__c where special_event__c = :BSCEvent.id];

        system.debug('BSCEventBookings - ' + BSCEventBookings);

        EventBookingRecords = new List<EventBookingRecs> ();
        trueBookingRecords = new List<EventBookingRecs> ();
        accIds = new Set<Id> ();
        allContactMap = new Map<String, Contact> ();

        integer counter = 0;
        integer serialCounter = 0;
        for(Special_Event_Booking__c seb : BSCEventBookings)
        {
            system.debug('Special_Event_Booking__c seb - ' + seb);

            EventBookingRecs ebrEven = new EventBookingRecs();
            ebrEven.EventBooking = seb;
            ebrEven.bookingAccount = new Account(Name=seb.Company__r.name);
            ebrEven.bookingContact = new Contact(Email=seb.Contact__r.email, FirstName=seb.Contact__r.firstname, LastName=seb.Contact__r.lastname, phone=seb.Contact__r.phone, birthdate=seb.Contact__r.birthdate);
            if(ebrEven.bookingContact.email != null)
            {
                ebrEven.isCheckBoxShow = true;
                ebrEven.isEmail = false;
            }
            else
            {
                ebrEven.isCheckBoxShow = false;
                ebrEven.isEmail = true;
            }

            ebrEven.isShow = true;
            ebrEven.isSubstitute = false;
            ebrEven.serial = serialCounter++;
            ebrEven.index = counter++;
            system.debug('ebrEven - ' + ebrEven);
            EventBookingRecords.add(ebrEven);
            

            EventBookingRecs ebrOdd = new EventBookingRecs();
            ebrOdd.EventBooking = seb;
            ebrOdd.bookingAccount = new Account(Name=seb.Company__r.name);
            ebrOdd.bookingContact = new Contact();
            ebrOdd.isCheckBoxShow = false;
            ebrOdd.isEmail = true;
            ebrOdd.isShow = false;
            ebrOdd.isSubstitute = false;
            ebrOdd.serial = serialCounter++;
            ebrOdd.index = counter++;
            system.debug('ebrOdd - ' + ebrOdd);
            EventBookingRecords.add(ebrOdd);
            counter++;

            accIds.add(seb.Company__c);
        }

       
        List<Contact> allAccountContacts = [Select Id, FirstName, LastName, Email, Phone, Birthdate From Contact where account.id in :accIds]; 

        system.debug('List<Contact> allAccountContacts - ' + allAccountContacts);
        
        for(Contact c : allAccountContacts)
        {
            allContactMap.put(c.email, c);
        }

        system.debug('allContactMap - ' + allContactMap);

        system.debug('EventBookingRecords - ' + EventBookingRecords);
        system.debug('EventBookingRecords.size() - ' + EventBookingRecords.size());
        counter = 0;
        for(EventBookingRecs er : EventBookingRecords)
        {
            if(er.isShow == true)
            {
                er.index = counter++;
                trueBookingRecords.add(er);
            }
        }
    }

    public void searchContact()
    {
        system.debug('index - ' + index);
        system.debug('serial - ' + serial);
        system.debug('trueBookingRecords[index].bookingContact.email - ' + trueBookingRecords[index].bookingContact.email);
        trueBookingRecords[index].bookingContact = allContactMap.get(trueBookingRecords[index].bookingContact.email);
        EventBookingRecords[serial].bookingContact = allContactMap.get(trueBookingRecords[index].bookingContact.email);
        system.debug('trueBookingRecords[index] - ' + trueBookingRecords[index]);
        system.debug('EventBookingRecords[serial] - ' + EventBookingRecords[serial]);
    }

    public void chngeShowFlag()
    {
        system.debug('index - ' + index);
        system.debug('serial - ' + serial);

        system.debug('trueBookingRecords- ' + trueBookingRecords);
        system.debug('EventBookingRecords first- ' + EventBookingRecords);
    }
}

Could you please help me to find exact issue? It will help a lot. Please also find VF and Apex code for your ref.

Best Regards,

Rahul
Hi,

I am running below code from sandbox execute anonymous window. I am not getting any mail after execution.
Account a = new Account(name='Acme Plumbing');

insert a;

Contact c = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber', accountid=a.id);

insert c;

Database.DMLOptions dlo = new Database.DMLOptions();

dlo.EmailHeader.triggerAutoResponseEmail = true;

Case ca = new Case(subject='Plumbing Problems', contactid=c.id);

database.insert(ca, dlo);
This is exmaple from Salesforce documentation. Do I have to any setting? Could I request a help?

Thanks,


I have a custom object called object__c instead of the standard related list I have a visualfprce page

<pre>
<apex:page standardController="Pobject__c">      

  <apex:form >

<apex:pageblock >
<apex:pageBlockTable Value="{!object__c.NotesAndAttachments}" var="item" columns="4" >

<apex:column HeaderValue="Title"  >   
<apex:outputLink value="/{!item.id}" id="the_link" >
<apex:outputField value="{!item.Title}" />
</apex:outputLink>
</apex:column>
<apex:column HeaderValue="Last Modified Date" >
<apex:outputField value="{!item.LastModifiedDate }" />
</apex:column>
<apex:column HeaderValue="Created By" >
<apex:outputField value="{!item.Createdbyid }" />

</apex:column>

</apex:pageBlockTable>
</apex:pageblock>

</apex:form>


</apex:page>

</pre>

When I click on the attachment link, insetad of opening the attachment , it opens like this


User-added image





Hi,

I am desigining a visualforce page for internal users to create a record in custom object and case object. Users can access this Visualforce page only after using their username and password.It will be accessed by max 25 users as of now.
These users will not have access to any other standard objects. Could you please suggest a cost effective user licenses?

We are also in process of buying new licenses.

I am confused with different types of licenses in Salesforce

I have checked licenses like

High Volume Customer Portal
Customer Portal Manager Custom

But want to make sure.

All expert opinion will help.

Thanks,

Clouddev
Hi,

I am desigining a web page for internal users to create a record in custom object and case object. It will be accessed by max 25 users as of now.
These users will not have access to any other standard objects. Could you please suggest a cost effective user licenses?

We are also in process of buying new licenses.

I am confused with different types of licenses in Salesforce

I have checked licenses like

High Volume Customer Portal
Customer Portal Manager Custom

But want to make sure.

All expert opinion will help.

Thanks,

Clouddev

How to remove trailing zero with decimal format for <apex:inputField>  and <apex:outputField>

Field Definition - Decimal - (10,5) - Five Decimal precision

Example :

Value : 5.01 - SFDC stores and displayed as 5.01000. I need to remove the trailing zeros. Actual value should be 5.01

Hi,

 

I have a query where its checking multiple email domain like @gmail.com , @hotmail.com etc.

 

The query is like

 

SELECT company FROM lead WHERE email LIKE '%@gmail.com' OR email LIKE '%@hotmail.com'.

 

If I have to check more that 100 email domains in one go then it is exceeding 100 SOQL limit and giving "Too many SOQL queries: 101".

 

Is there any alternative syntax to achieve this task ?

 

Please reply,

 

Thanks,

 

clouddev@surashri

Hi,

 

I am trying to extract a data from our org based web service and updating that inform on salesforce account object.

 

I am using shell script to do this task

1 - Using curl command its connecting to org based web service and fetching data using standard apis.

2 - doing some data formating and generating JSON format file

3 - using this JSON file to update salesforce fields, again using curl command to update those fields.

 

For step 3, i have written a @RestReource class and @HTTPPost based function. All is working fine.

 

But I want to know, can I convert step 1 "which is currently using curl command to access web services api" to some classes in salesforce ? How can I achieve that? It will help if you give some example links, pdf etc. I saw topics about HTTP callouts but didn't get it and how am I going to achieve this?

 

Thanks,

 

clouddev@surashri.

Hello, 

 

I have only 35% code coverage on the class below and I've been trying to increase it for a while but no success. Would someone please help me? :)

 

It has been developed to fix the 10000 soql limit, because my client has more than 100 fields in his page, as you can see there are one Edit VS page and a VIEW VS page.

 

public class Contracts_AVAC {
	
    public A_C_Availability__c q1 {get; private set;}
    public A_C_Availability__c q2 {get; private set;}
    public A_C_Availability__c q3 {get; private set;}
	
    public Contracts_AVAC (ApexPages.StandardController stdController) {
       
               ID qid = stdController.getRecord().Id;


//GENERAL FIELDS 

		q1 = [select A_C_Availability__c.Name, A_C_Availability__c.Status__c, A_C_Availability__c.Serial_Number__c

					from A_C_Availability__c where id = :qid limit 1];

//MORE FIELDS
				
		q2 = [select A_C_Availability__c.PInterior__c, A_C_Availability__c.POptional__c

					from A_C_Availability__c where id = :qid limit 1];

//MORE FIELDS
				
		q3 = [select A_C_Availability__c.LOptional__c, A_C_Availability__c.LOptionalF__c,					

					from A_C_Availability__c where id = :qid limit 1];
   }

		public PageReference save() {
			update q1;
			update q2;
			update q3;
			String changepage = '/apex/Contracts_View_AVAC?id='+ApexPages.currentPage().getParameters().get('id');
			PageReference pageref = new Pagereference(changepage);
			pageref.setRedirect(true);
			return pageref;  
		}
	
			
		public PageReference NewAVAC() {

		A_C_Availability__c NewAVAC = new A_C_Availability__c (name = 'New AVAC');
		insert NewAVAC;
	
// Load Edit page

		String changepage2 = '/apex/Contracts_New_AVAC?id='+NewAVAC.Id;
		PageReference pageref2 = new Pagereference(changepage2);
		pageref2.setRedirect(true);
        return pageref2;
		}	
				

}

 Test method:

 

public static testMethod void testContracts_AVAC() {

		// Make test AVAC	
				A_C_Availability__c testAVAC = new A_C_Availability__c (Name = 'Test AVAC');
				insert testAVAC;
		
		// Get ID from new AVAC	
				PageReference pageRef = new PageReference('/apex/Contracts_New_AVAC');
				ApexPages.currentPage().getParameters().put('id', testAVAC.id);
				Test.setCurrentPage(pageRef);
		
		// Open Custom Controller	
				ApexPages.StandardController avacController = new ApexPages.StandardController(testAVAC);
		
		// Open extension
				Contracts_AVAC qe1 = new Contracts_AVAC(avacController);
		
		// Create Test Object
				A_C_Availability__c TestAVAC1 = qe1.q1;
		
		// Check fields
				System.assertEquals('Test AVAC', TestAVAC1.Name);
	}

 

Thank you so much,

 

Ronaldo.

Hi There, I created a trigger to execute on a lead when the Lead Status value is changed.  I am able to save the code below, however the task is not being created.  I hardcoded the ownerID for the task for this test.   If anyone knows what I am missing this would be greatly appreciated!

 

trigger createLeadActivity on Lead (after update) { 

    //make a set to hold LeadIds that we need
    Set<Id> leadIds = new Set<Id>();
  
   
    for(Lead l : trigger.new)
        {
        //check to see if our field has been changed
        if(l.status != trigger.oldMap.get(l.Id).Status){
            
            leadIds.add(l.Id);
            
        }

       }
    
    if(!leadIds.isEmpty()){
        
       
        
        List<Lead> leadList = 
            [SELECT Id,Status
            FROM Lead
            WHERE Status = '4 - SAL Engaged' AND Id IN :leadIds ];
            
        
        
        
        
        for(Lead lead: trigger.new){
       
       
        
        
       
        Task newTask = new Task(Subject='LeadPassed',
Status='Not Started',Priority='Normal', OwnerId ='005E0000000QD4F');



        }
       
    }


}

 

Hi,

 

Recently for last 4-5 days I am not able to see posts on http://boards.developerforce.com/sforce/board?board.id=Visualforce

and getting error as below.

 

An Unexpected Error has occurred. Sorry, your request failed. A notification has been sent to the development team for investigation. Exception ID: 5F60D76C

Please click the Back button on your browser. .

Return to my original page

 

Can anyone tell me what could be the reason. I am able to see posts on other pages only problem with VF page.

 

Thanks,

 

Hi,

 

If I have to use destructivechanges.xml for removing couple of classes from org, do I need to specify those classes in package.xml in same directory. It is not clear from migration guide. Please clarify.

 

Thanks

Hi Team,

 

 I am going update twi fields in Crop Record(Average CP and Average Seeds) which is from ABS (Average CP and Average Seeds).

 

In Crop Record ABS is Lookup field.

 

This is i have done so far but it is not working..

 

 

public with sharing class ABS_TriggerHandler {

    private boolean m_isExecuting = false;
    private integer BatchSize = 0;
 
    public ABS_TriggerHandler(boolean isExecuting, integer size){
        m_isExecuting = isExecuting;
        BatchSize = size;
    }
    
    public void OnBeforeInsert(list<ABS__c> newObjects)
      {
         Updatepotential (newObjects);
      }
    
    public void OnAfterInsert(list<ABS__c> newObjects)
      {
         Updatepotential (newObjects);
      }
private void Updatepotential (list <ABS__c> newCPs){
        Set<String> years = new Set<String>();
        set<Id> territories = new set<Id>();
        set<Id> crops = new set<Id>();
        map<String, set<Id>> absCropsToUpdateMap = new map<String, set<Id>>();


         for(ABS__c abs : newCPs)
            {
                        years.add(abs.Name);
                        territories.add(abs.Territory_Name__c);
                        crops.add(abs.Crop__c);
                        String key = abs.Name + abs.Territory_Name__c;
                        
                        if(!absCropsToUpdateMap .containsKey(key))
                        absCropsToUpdateMap .put(key, new set<Id>{abs.Crop__c});
                        else
                        absCropsToUpdateMap .get(key).add(abs.Crop__c);                        
            }

         if(absCropsToUpdateMap.size() > 0)
          {
            list<ABS__c> CPCropsToBeInserted = new list<ABS__c>();
            List<Crop_Record__c> cropRecords = new List<Crop_Record__c>();
             for (ABS__c cpp : [ Select Id, Name, Average_CP__c, Average_Seeds__c,
                                 Crop__r.Name, Crop__c, (SELECT Average_CP__c,Average_Seeds__c,Crop__c FROM Crop_Records__r) From ABS__c Where  Name = :years
                                 and Crop__r.Name = :crops])
               
                             
                                 for (Crop_Record__c cr : cpp.Crop_Records__r) {
                                     if (cpp.Crop__c == cr.Crop__c) {
                                         cr.Average_CP__c = cpp.Average_CP__c;
                                         cr.Average_Seeds__c = cpp.Average_Seeds__c;
                                         cropRecords.add(cr);
                                     }
                                 }
                                
                             
               if (!cropRecords.isEmpty()){
                   update cropRecords;
               }
           }  
       }
 
    
}

  • January 23, 2013
  • Like
  • 0

Hi All,

 

In VF Developer's guide (pg 274) I found below code.

 

<apex:outputPanel onclick="methodOneInJavascript('Yes!')" styleClass="btn" >
    Click Me
</apex:outputPanel>

 

styleClass attribute is used in many VF components. The btn value here is for button.

 

What ref was used to refer 'btn' value in styleClass here?

Where can I find detail documentation about which styleClass is used for which component?

 

The VF dev guide don't have these details and its confusing to understand sometimes.

 

Thanks in Advance,

 

clouddev

Hi There,

 

I'm using visualforce page to specify to email address to send email and should be attached file, 

 

I want create from to send to anyone and can keep tracking to Activity History of Contact belong to this document.

 

 

SendEmail failed. First exception on row 0; first error: INVALID_EMAIL_ADDRESS, email address has bounced for id : 003W000000CRfYr: []

 

public with sharing class paymenthistoryCls {  
	
	public string uid;
	public string aid;
	public string cid; 
	public User objUser{get;set;}
	public list<Document__c> lstDocument{get;set;}
	public String DocId{get; set;}
    public String attId{get;set;}
    public String addresses{ get; set;}	
    	
	public paymenthistoryCls(){
		uid = Apexpages.currentPage().getParameters().get('id');//UserInfo.getUserId();
		getObjUser();
		getlstDocument();
	} 
	
	public void getObjUser(){
		if(uid != null){
		objUser = [Select 	User.ContactId,
							User.AccountId,
							User.UserType
	   				From	User
	   				Where	User.Id = :uid ];
	   	aid = objUser.AccountId;
	   	cid = objUser.ContactId;	
		}
	}
	
	public void getlstDocument(){
	lstDocument = [	SELECT	Document__c.Id,
	    							Document__c.Name,
	    							Document__c.Document_Name__c,
	    							Document__c.Description__c,
	    							Document__c.CreatedDate,
	    							Document__c.LastModifiedDate,
	    							(SELECT Document_Version__c.Id
	    							FROM	Document_Version__r)
	    					FROM	Document__c
	    					Where	Document__c.Account__c = :aid];
	}
	    
    public PageReference send() {
        PageReference pageReference =  ApexPages.currentPage();        
    	Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage(); 
        
        // Create the email attachment
       
		List<Messaging.EmailFileAttachment> efas = new List<Messaging.EmailFileAttachment>();
		
   	    for(Attachment a : [select	Attachment.Id,
	   	    						Attachment.Name,  
	   	    						Attachment.Body 
	   	    			 	from 	Attachment 
	   	    			 	where 	Attachment.ParentId = :attId]){
    	
	    	Messaging.EmailFileAttachment efa = new Messaging.EmailFileAttachment();
	    	efa.setFileName(a.Name);
	    	efa.setBody(a.body);
			efas.add(efa);
   	   }
   	   String[] toAddresses;
   	   if(addresses != ''){
		toAddresses = addresses.split(';', 0);	
   	   }
   	   EmailTemplate Temp = [Select EmailTemplate.Id , EmailTemplate.Name From EmailTemplate Where Name = 'Portal: Send Document'];
		
        email.setTargetObjectId(cid);        
        email.setSaveAsActivity(false);       
        email.setTemplateId(Temp.id);
        email.setToAddresses( toAddresses );        
        email.setFileAttachments(efas);
        email.setWhatId(attid);
		
	Messaging.SendEmailResult[] results = Messaging.sendEmail(new Messaging.SingleEmailMessage[] { email });
	system.debug('result size ='+ results.size());
	ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.CONFIRM,  'Email has been resent successfully '+results.size()+'.'+attId));
		return ApexPages.currentPage();
    }
}

 

23.0 APEX_CODE,DEBUG;APEX_PROFILING,INFO;CALLOUT,INFO;DB,INFO;SYSTEM,DEBUG;VALIDATION,INFO;VISUALFORCE,INFO;WORKFLOW,INFO
02:46:06.031 (31183000)|EXECUTION_STARTED
02:46:06.031 (31240000)|CODE_UNIT_STARTED|[EXTERNAL]|066W00000008eni|VF: /apex/paymenthistory
02:46:06.032 (32175000)|VF_DESERIALIZE_VIEWSTATE_BEGIN|066W00000008eni
02:46:06.042 (42671000)|VF_DESERIALIZE_VIEWSTATE_END
02:46:06.043 (43632000)|CODE_UNIT_STARTED|[EXTERNAL]|01pW0000000D4RH|paymenthistoryCls get(lstDocument)
02:46:06.043 (43658000)|SYSTEM_MODE_ENTER|true
02:46:06.043 (43688000)|CODE_UNIT_STARTED|[EXTERNAL]|01pW0000000D4RH|lstDocument
02:46:06.043 (43727000)|METHOD_ENTRY|[1]|01pW0000000D4RH|paymenthistoryCls.paymenthistoryCls()
02:46:06.043 (43828000)|SYSTEM_MODE_ENTER|false
02:46:06.043 (43840000)|SYSTEM_MODE_EXIT|false
02:46:06.043 (43850000)|METHOD_EXIT|[1]|paymenthistoryCls
02:46:06.043 (43862000)|CODE_UNIT_FINISHED|lstDocument
02:46:06.043 (43869000)|CODE_UNIT_FINISHED|paymenthistoryCls get(lstDocument)
02:46:06.054 (54757000)|CODE_UNIT_STARTED|[EXTERNAL]|01pW0000000D4RH|paymenthistoryCls get(addresses)
02:46:06.054 (54783000)|SYSTEM_MODE_ENTER|true
02:46:06.054 (54797000)|CODE_UNIT_STARTED|[EXTERNAL]|01pW0000000D4RH|addresses
02:46:06.054 (54814000)|CODE_UNIT_FINISHED|addresses
02:46:06.054 (54820000)|CODE_UNIT_FINISHED|paymenthistoryCls get(addresses)
02:46:06.057 (57496000)|CODE_UNIT_STARTED|[EXTERNAL]|paymenthistoryCls set(addresses,medemaza@gmail.com)
02:46:06.057 (57512000)|SYSTEM_MODE_ENTER|true
02:46:06.057 (57526000)|CODE_UNIT_STARTED|[EXTERNAL]|paymenthistoryCls set(addresses,medemaza@gmail.com)
02:46:06.057 (57573000)|CODE_UNIT_FINISHED|paymenthistoryCls set(addresses,medemaza@gmail.com)
02:46:06.057 (57581000)|CODE_UNIT_FINISHED|paymenthistoryCls set(addresses,medemaza@gmail.com)
02:46:06.057 (57659000)|CODE_UNIT_STARTED|[EXTERNAL]|paymenthistoryCls set(attId,a0VW0000000EJxGMAW)
02:46:06.057 (57677000)|SYSTEM_MODE_ENTER|true
02:46:06.057 (57689000)|CODE_UNIT_STARTED|[EXTERNAL]|paymenthistoryCls set(attId,a0VW0000000EJxGMAW)
02:46:06.057 (57710000)|CODE_UNIT_FINISHED|paymenthistoryCls set(attId,a0VW0000000EJxGMAW)
02:46:06.057 (57717000)|CODE_UNIT_FINISHED|paymenthistoryCls set(attId,a0VW0000000EJxGMAW)
02:46:06.057 (57784000)|CODE_UNIT_STARTED|[EXTERNAL]|paymenthistoryCls set(addresses,)
02:46:06.057 (57797000)|SYSTEM_MODE_ENTER|true
02:46:06.057 (57807000)|CODE_UNIT_STARTED|[EXTERNAL]|paymenthistoryCls set(addresses,)
02:46:06.057 (57826000)|CODE_UNIT_FINISHED|paymenthistoryCls set(addresses,)
02:46:06.057 (57834000)|CODE_UNIT_FINISHED|paymenthistoryCls set(addresses,)
02:46:06.057 (57896000)|CODE_UNIT_STARTED|[EXTERNAL]|paymenthistoryCls set(attId,a0VW0000000EJxBMAW)
02:46:06.057 (57909000)|SYSTEM_MODE_ENTER|true
02:46:06.057 (57919000)|CODE_UNIT_STARTED|[EXTERNAL]|paymenthistoryCls set(attId,a0VW0000000EJxBMAW)
02:46:06.057 (57939000)|CODE_UNIT_FINISHED|paymenthistoryCls set(attId,a0VW0000000EJxBMAW)
02:46:06.057 (57946000)|CODE_UNIT_FINISHED|paymenthistoryCls set(attId,a0VW0000000EJxBMAW)
02:46:06.058 (58011000)|CODE_UNIT_STARTED|[EXTERNAL]|paymenthistoryCls set(addresses,)
02:46:06.058 (58025000)|SYSTEM_MODE_ENTER|true
02:46:06.058 (58035000)|CODE_UNIT_STARTED|[EXTERNAL]|paymenthistoryCls set(addresses,)
02:46:06.058 (58054000)|CODE_UNIT_FINISHED|paymenthistoryCls set(addresses,)
02:46:06.058 (58061000)|CODE_UNIT_FINISHED|paymenthistoryCls set(addresses,)
02:46:06.058 (58124000)|CODE_UNIT_STARTED|[EXTERNAL]|paymenthistoryCls set(attId,a0VW0000000EJx6MAG)
02:46:06.058 (58137000)|SYSTEM_MODE_ENTER|true
02:46:06.058 (58147000)|CODE_UNIT_STARTED|[EXTERNAL]|paymenthistoryCls set(attId,a0VW0000000EJx6MAG)
02:46:06.058 (58171000)|CODE_UNIT_FINISHED|paymenthistoryCls set(attId,a0VW0000000EJx6MAG)
02:46:06.058 (58179000)|CODE_UNIT_FINISHED|paymenthistoryCls set(attId,a0VW0000000EJx6MAG)
02:46:06.058 (58244000)|CODE_UNIT_STARTED|[EXTERNAL]|paymenthistoryCls set(addresses,)
02:46:06.058 (58257000)|SYSTEM_MODE_ENTER|true
02:46:06.058 (58267000)|CODE_UNIT_STARTED|[EXTERNAL]|paymenthistoryCls set(addresses,)
02:46:06.058 (58286000)|CODE_UNIT_FINISHED|paymenthistoryCls set(addresses,)
02:46:06.058 (58293000)|CODE_UNIT_FINISHED|paymenthistoryCls set(addresses,)
02:46:06.058 (58355000)|CODE_UNIT_STARTED|[EXTERNAL]|paymenthistoryCls set(attId,a0VW0000000EJwhMAG)
02:46:06.058 (58368000)|SYSTEM_MODE_ENTER|true
02:46:06.058 (58378000)|CODE_UNIT_STARTED|[EXTERNAL]|paymenthistoryCls set(attId,a0VW0000000EJwhMAG)
02:46:06.058 (58398000)|CODE_UNIT_FINISHED|paymenthistoryCls set(attId,a0VW0000000EJwhMAG)
02:46:06.058 (58405000)|CODE_UNIT_FINISHED|paymenthistoryCls set(attId,a0VW0000000EJwhMAG)
02:46:06.058 (58470000)|CODE_UNIT_STARTED|[EXTERNAL]|paymenthistoryCls set(addresses,)
02:46:06.058 (58482000)|SYSTEM_MODE_ENTER|true
02:46:06.058 (58492000)|CODE_UNIT_STARTED|[EXTERNAL]|paymenthistoryCls set(addresses,)
02:46:06.058 (58511000)|CODE_UNIT_FINISHED|paymenthistoryCls set(addresses,)
02:46:06.058 (58518000)|CODE_UNIT_FINISHED|paymenthistoryCls set(addresses,)
02:46:06.058 (58581000)|CODE_UNIT_STARTED|[EXTERNAL]|paymenthistoryCls set(attId,a0VW0000000EJwmMAG)
02:46:06.058 (58593000)|SYSTEM_MODE_ENTER|true
02:46:06.058 (58606000)|CODE_UNIT_STARTED|[EXTERNAL]|paymenthistoryCls set(attId,a0VW0000000EJwmMAG)
02:46:06.058 (58625000)|CODE_UNIT_FINISHED|paymenthistoryCls set(attId,a0VW0000000EJwmMAG)
02:46:06.058 (58632000)|CODE_UNIT_FINISHED|paymenthistoryCls set(attId,a0VW0000000EJwmMAG)
02:46:06.058 (58713000)|CODE_UNIT_STARTED|[EXTERNAL]|paymenthistoryCls set(addresses,)
02:46:06.058 (58726000)|SYSTEM_MODE_ENTER|true
02:46:06.058 (58736000)|CODE_UNIT_STARTED|[EXTERNAL]|paymenthistoryCls set(addresses,)
02:46:06.058 (58755000)|CODE_UNIT_FINISHED|paymenthistoryCls set(addresses,)
02:46:06.058 (58762000)|CODE_UNIT_FINISHED|paymenthistoryCls set(addresses,)
02:46:06.058 (58826000)|CODE_UNIT_STARTED|[EXTERNAL]|paymenthistoryCls set(attId,a0VW0000000EJxLMAW)
02:46:06.058 (58838000)|SYSTEM_MODE_ENTER|true
02:46:06.058 (58849000)|CODE_UNIT_STARTED|[EXTERNAL]|paymenthistoryCls set(attId,a0VW0000000EJxLMAW)
02:46:06.058 (58868000)|CODE_UNIT_FINISHED|paymenthistoryCls set(attId,a0VW0000000EJxLMAW)
02:46:06.058 (58875000)|CODE_UNIT_FINISHED|paymenthistoryCls set(attId,a0VW0000000EJxLMAW)
02:46:06.058 (58940000)|CODE_UNIT_STARTED|[EXTERNAL]|paymenthistoryCls set(addresses,)
02:46:06.058 (58953000)|SYSTEM_MODE_ENTER|true
02:46:06.058 (58963000)|CODE_UNIT_STARTED|[EXTERNAL]|paymenthistoryCls set(addresses,)
02:46:06.058 (58982000)|CODE_UNIT_FINISHED|paymenthistoryCls set(addresses,)
02:46:06.058 (58989000)|CODE_UNIT_FINISHED|paymenthistoryCls set(addresses,)
02:46:06.059 (59052000)|CODE_UNIT_STARTED|[EXTERNAL]|paymenthistoryCls set(attId,a0VW0000000EJwwMAG)
02:46:06.059 (59065000)|SYSTEM_MODE_ENTER|true
02:46:06.059 (59076000)|CODE_UNIT_STARTED|[EXTERNAL]|paymenthistoryCls set(attId,a0VW0000000EJwwMAG)
02:46:06.059 (59095000)|CODE_UNIT_FINISHED|paymenthistoryCls set(attId,a0VW0000000EJwwMAG)
02:46:06.059 (59102000)|CODE_UNIT_FINISHED|paymenthistoryCls set(attId,a0VW0000000EJwwMAG)
02:46:06.060 (60968000)|CODE_UNIT_STARTED|[EXTERNAL]|01pW0000000D4RH|paymenthistoryCls invoke(send)
02:46:06.061 (61059000)|SYSTEM_MODE_ENTER|false
02:46:06.061 (61102000)|SYSTEM_METHOD_ENTRY|[44]|ApexPages.currentPage()
02:46:06.061 (61242000)|SYSTEM_METHOD_EXIT|[44]|ApexPages.currentPage()
02:46:06.062 (62232000)|SYSTEM_CONSTRUCTOR_ENTRY|[49]|<init>()
02:46:06.062 (62266000)|SYSTEM_CONSTRUCTOR_EXIT|[49]|<init>()
02:46:06.062 (62306000)|METHOD_ENTRY|[51]|01pW0000000D4RH|paymenthistoryCls.__sfdc_attId()
02:46:06.062 (62343000)|METHOD_EXIT|[51]|01pW0000000D4RH|paymenthistoryCls.__sfdc_attId()
02:46:06.063 (63343000)|SOQL_EXECUTE_BEGIN|[51]|Aggregations:0|select Attachment.Id, Attachment.Name, Attachment.Body from Attachment 
02:46:06.118 (118130000)|SOQL_EXECUTE_END|[51]|Rows:1
02:46:06.118 (118256000)|SYSTEM_METHOD_ENTRY|[51]|Database.QueryLocator.iterator()
02:46:06.118 (118449000)|SYSTEM_METHOD_ENTRY|[7]|QueryLocatorIterator.QueryLocatorIterator()
02:46:06.118 (118464000)|SYSTEM_METHOD_EXIT|[7]|QueryLocatorIterator
02:46:06.118 (118627000)|SYSTEM_METHOD_EXIT|[51]|Database.QueryLocator.iterator()
02:46:06.118 (118648000)|SYSTEM_METHOD_ENTRY|[51]|Database.QueryLocatorIterator.hasNext()
02:46:06.118 (118748000)|SYSTEM_METHOD_ENTRY|[33]|LIST<Attachment>.size()
02:46:06.118 (118784000)|SYSTEM_METHOD_EXIT|[33]|LIST<Attachment>.size()
02:46:06.118 (118804000)|SYSTEM_METHOD_EXIT|[51]|Database.QueryLocatorIterator.hasNext()
02:46:06.118 (118815000)|SYSTEM_METHOD_ENTRY|[51]|Database.QueryLocatorIterator.next()
02:46:06.118 (118830000)|SYSTEM_METHOD_ENTRY|[48]|Database.QueryLocatorIterator.hasNext()
02:46:06.118 (118852000)|SYSTEM_METHOD_ENTRY|[33]|LIST<Attachment>.size()
02:46:06.118 (118861000)|SYSTEM_METHOD_EXIT|[33]|LIST<Attachment>.size()
02:46:06.118 (118869000)|SYSTEM_METHOD_EXIT|[48]|Database.QueryLocatorIterator.hasNext()
02:46:06.118 (118909000)|SYSTEM_METHOD_EXIT|[51]|Database.QueryLocatorIterator.next()
02:46:06.119 (119249000)|SYSTEM_METHOD_ENTRY|[60]|LIST<Messaging.EmailFileAttachment>.add(Object)
02:46:06.119 (119285000)|SYSTEM_METHOD_EXIT|[60]|LIST<Messaging.EmailFileAttachment>.add(Object)
02:46:06.119 (119294000)|SYSTEM_METHOD_ENTRY|[51]|Database.QueryLocatorIterator.hasNext()
02:46:06.119 (119306000)|SYSTEM_METHOD_EXIT|[51]|Database.QueryLocatorIterator.hasNext()
02:46:06.119 (119325000)|METHOD_ENTRY|[63]|01pW0000000D4RH|paymenthistoryCls.__sfdc_addresses()
02:46:06.119 (119356000)|METHOD_EXIT|[63]|01pW0000000D4RH|paymenthistoryCls.__sfdc_addresses()
02:46:06.119 (119776000)|SOQL_EXECUTE_BEGIN|[66]|Aggregations:0|select EmailTemplate.Id, EmailTemplate.Name from EmailTemplate where Name = 'Portal: Send Document'
02:46:06.122 (122867000)|SOQL_EXECUTE_END|[66]|Rows:1
02:46:06.123 (123431000)|METHOD_ENTRY|[73]|01pW0000000D4RH|paymenthistoryCls.__sfdc_attId()
02:46:06.123 (123457000)|METHOD_EXIT|[73]|01pW0000000D4RH|paymenthistoryCls.__sfdc_attId()
02:46:06.123 (123567000)|SYSTEM_CONSTRUCTOR_ENTRY|[75]|<init>()
02:46:06.123 (123595000)|SYSTEM_CONSTRUCTOR_EXIT|[75]|<init>()
02:46:06.123 (123617000)|SYSTEM_METHOD_ENTRY|[75]|LIST<Messaging.SingleEmailMessage>.add(Object)
02:46:06.123 (123631000)|SYSTEM_METHOD_EXIT|[75]|LIST<Messaging.SingleEmailMessage>.add(Object)
02:46:06.123 (123683000)|SYSTEM_METHOD_ENTRY|[75]|Messaging.sendEmail(LIST<Messaging.Email>)
02:46:06.183 (183772000)|EXCEPTION_THROWN|[75]|System.EmailException: SendEmail failed. First exception on row 0; first error: INVALID_EMAIL_ADDRESS, email address has bounced for id : 003W000000CRfYr: []
02:46:06.184 (184625000)|SYSTEM_METHOD_EXIT|[75]|Messaging.sendEmail(LIST<Messaging.Email>)
02:46:06.184 (184655000)|SYSTEM_MODE_EXIT|false
02:46:06.184 (184741000)|FATAL_ERROR|System.EmailException: SendEmail failed. First exception on row 0; first error: INVALID_EMAIL_ADDRESS, email address has bounced for id : 003W000000CRfYr: []

Class.paymenthistoryCls.send: line 75, column 1
02:46:06.184 (184764000)|CODE_UNIT_FINISHED|paymenthistoryCls invoke(send)

 

 

 

 

 

I am trying to override the case accept button using the below VF page:

 

<apex:page standardController="Case" extensions="Test" action="{!nullValue(redir.url,urlFOR($Action.Case.Accept,Case.id,null,true))}">
</apex:page

 

I am getting an error on the redirect page as "Invalid parameters for URLFOR  ...

 

Did any override accept  button b4?

  • October 25, 2010
  • Like
  • 0