• Shravani M 9
  • 10 Points
  • Member since 2016

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
  • 5
Hi Friends,

When visual force pdf is converting into HTML in email attachments. Is this HTML link will stores pdf file in salesforce.

Thanks in Advance
Hi Friends,
We have a requirement that, we need to enable the upload button of Invoice once all other documents are uploaded.

Thanks in Advance.
<apex:actionRegion ><!-- Needed for re-rendering enclosed sections without re-rendering input file component -->

			<apex:pageBlockSection title="Close Down Requirements" columns="1">
				<apex:outputField value="{!workOrder.Resubmission_Notes__c}" rendered="{!NOT(ISBLANK(workOrder.Resubmission_Notes__c))}" />

				<apex:pageBlockSectionItem rendered="{!beforePicturesRequired}">
					<apex:outputPanel >
						<apex:outputLabel value="Before Pictures" />
						<br />
						<apex:outputText id="beforePictureStatus" value="({!workOrder.Before_Pictures__c})" />
                       <!-- <apex:actionSupport event="onclick" rerender="pbs"/> -->
					<c:PluploadS3 id="before" control="{!beforePictures}" uploadAction="{!gotBeforePictures}" rerender="beforePictureStatus" />

				<apex:pageBlockSectionItem rendered="{!afterPicturesRequired}">
					<apex:outputPanel >
						<apex:outputLabel value="After Pictures" />
						<br />
						<apex:outputText id="afterPictureStatus" value="({!workOrder.After_Pictures__c})" />
					<c:PluploadS3 id="after" control="{!afterPictures}" uploadAction="{!gotAfterPictures}" rerender="afterPictureStatus"/>

				<apex:pageBlockSectionItem rendered="{!lienWaiverRequired}">
					<apex:outputPanel >
						<apex:outputLabel value="Lien Waiver" />
						<br />
						<apex:outputText id="lienWaiverStatus" value="({!workOrder.Lien_Waiver_Status__c})" />
					<c:PluploadS3 id="lienWaiver" control="{!uploader}" uploadAction="{!gotLienWaiver}" rerender="lienWaiverStatus" />
				<apex:pageBlockSectionItem rendered="{!SiteSignoffRequired}">
					<apex:outputPanel >
						<apex:outputLabel value="Site Sign Off" />
						<br />
						<apex:outputText id="siteSignOffStatus" value="({!workOrder.Site_Sign_Off_Status__c})" />
					<c:PluploadS3 id="siteSignOff" control="{!uploader}" uploadAction="{!gotSiteSignOff}" rerender="siteSignOffStatus"/>

				<apex:pageBlockSectionItem rendered="{!PunchListRequired}">
					<apex:outputPanel >
						<apex:outputLabel value="Punch List" />
						<br />
						<apex:outputText id="punchListStatus" value="({!workOrder.Punch_List__c})" />
					<c:PluploadS3 id="punchList" control="{!uploader}" uploadAction="{!gotPunchList}" rerender="punchListStatus"/>

				<apex:pageBlockSectionItem rendered="{!StatDecRequired}">
					<apex:outputPanel >
						<apex:outputLabel value="Stat Dec / CCDC" />
						<br />
						<apex:outputText id="statDecStatus" value="({!workOrder.Stat_Dec_CCDC__c})" />
					<c:PluploadS3 id="statDec" control="{!uploader}" uploadAction="{!gotStatDec}" rerender="statDecStatus"/>
				<apex:pageBlockSectionItem rendered="{!othersRequired}">
					<apex:outputPanel >
							<apex:outputLabel value="Other Requirements" />
							<apex:outputText id="otherRequirementsStatus" value="({!workOrder.Other_Requirements_Status__c})" />
						<br />
							<apex:outputText escape="false" value="{!OtherCloseDownDetail}" />
					<c:PluploadS3 id="otherRequirements" control="{!uploader}" uploadAction="{!gotOtherRequirements}" />


			<apex:pageBlockSection columns="1" id="pbs">
				<apex:pageBlockSectionItem rendered="{!InvoiceRequired}" id="Pbst">
					<apex:outputPanel id= "p1">
						<apex:outputLabel value="Invoice" />
						<br />
						<apex:outputText id="invoiceStatus" value="({!workOrder.Invoice_Status__c})" />
					<apex:outputPanel id="p2">
						<apex:outputText value="Invoice # " />
						<apex:outputText value="{!invoiceRec.Number__c}" rendered="{!NOT(invoiceNotSubmitted)}" />
                    	<apex:inputText value="{!invoiceRec.Number__c}" size="10" rendered="{!invoiceNotSubmitted}" />
                    	<apex:inputFile value="{!invoiceDoc.body}" filename="{!invoiceDoc.name}" rendered="{!invoiceNotSubmitted}" />
                    	<apex:commandButton action="{!submitInvoice}" disabled="{!IF(workOrder.Before_Pictures__c !=null,true,false)}" value="Upload" rendered="{!invoiceNotSubmitted}" />                     
				<apex:repeat rendered="{!InvoiceRequired}" value="{!memberSpecificFields}" var="field" >
					<apex:pageBlockSectionItem >
						<apex:outputLabel value="{!field.label}" />
						<apex:inputField value="{!workOrder[field.fieldPath]}" />
				<apex:pageBlockSectionItem >
					<apex:outputPanel >
						<apex:outputLabel value="" />
					<apex:outputPanel >
				        <apex:commandButton action="{!submitForApproval}" value="Submit for Approval" />
				        <br />
                        <apex:outputText rendered="{!isSubmitted}" value="✓Last Submitted for Approval " />
                        <apex:outputField rendered="{!isSubmitted}" value="{!workOrder.Contractor_Submission_Date__c}" />

Now I am able to upload multiple files to Amazon but now I need to upload an entire zip file of pictures into Amazon from salesforce. May I know how can I achieve this.  Thanks In Advance
HI All,

Q). What is a Batch Apex,Queueable Apex and @Future methods?, What are the differences between them and when we are going to use these classes?
Can anyone explain these classes.......

Hey all, so awhile back i asked helped on the trigger Geolocation functionality to google. I found the information i need to create a trigger to google from



and everything works just fine now. But I am having a hard time bulkifying this code. Can someone help me?


trigger trgGeoCode on Address__c (after insert, after update) {
    List<Address__c> addList = [select id, AddressGeoLocation__Latitude__s, AddressGeoLocation__Longitude__s 
    from Address__c where Id IN: Trigger.newMap.keySet()
    and Account__r.Type__c includes (: 'Facility') ];
    for (Address__c a : addList){
        if (a.AddressGeoLocation__Latitude__s ==null ){

 and my main class stays the same based off the blog:

public class ClassGoogleGeoLocationCallout {

@future (callout=true)  // future method needed to run callouts from Triggers
      static public void getLocation(id addId){
        // gather account info
        Address__c a = [select Name, City__c, State__c,Zip__c, Latitude__c, Longitude__c, Country__c
        from Address__c 
        where id =: addId]; 
        // create an address string
        String address = '';
        if (a.Name != null)
            address += a.Name +', ';
        if (a.City__c != null)
            address += a.City__c +', ';
        if (a.State__c != null)
            address += a.State__c +' ';
        if (a.Zip__c != null)
            address += a.Zip___c +', ';
        if (a.Country__c != null)
        address += 'USA';
        address = EncodingUtil.urlEncode(address, 'UTF-8');
 		system.debug('=== ADDRESS ===' +address);
        // build callout
        Http h = new Http();
        HttpRequest req = new HttpRequest();
            // callout
            HttpResponse res = h.send(req);
 			System.debug('====RESPONSE====' +res.getBody());
            // parse coordinates from response
            JSONParser parser = JSON.createParser(res.getBody());
            double lat = null;
            double lon = null;
            while (parser.nextToken() != null) {
                if ((parser.getCurrentToken() == JSONToken.FIELD_NAME) &&
                    (parser.getText() == 'location')){
                       parser.nextToken(); // object start
                       while (parser.nextToken() != JSONToken.END_OBJECT){
                           String txt = parser.getText();
                           if (txt == 'lat')
                               lat = parser.getDoubleValue();
                           else if (txt == 'lng')
                               lon = parser.getDoubleValue();
                       System.debug('====LAT====' +lat);
            // update coordinates if we get back
            if (lat != null){
                a.AddressGeoLocation__latitude__s = lat;
                a.AddressGeoLocation__longitude__s = lon;
                update a;
        } catch (Exception e) {

 So in the end when I try to bulk update using dataloader i get an error saying:

System.LimitException: Too many future calls: 11.


Thanks for the help

I am trying to upload a zip file from salesforce to Amazon s3. The file is taken as input from user(as blob) and then encoded into base 64. This base encoding makes the string size grater than 3MB. As the maximum size of String allowed is 3MB, i am unable to upload zip files greater than 3 MB.
Also, even if i do upload the file without using salesforce, i need to read the zip file after uploading it. This is not posssible in Amazon without downloading the zip file again.
Is there any work around for this? Any help would be appreciated.
Thanks in advance.

  • January 09, 2011
  • Like
  • 0