• dntfeedthemikey
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 4
    Replies

We've started using the visualforce jQuery mobile template pages with the computers new mobile app, it will save a lot time on list and detail layout pages. We just have a couple of basic questions on some of the components.

 

Does anyone know how to make the nextPage attribute on the List component a resource to a visualforce page?

 

Ex:

<c:List sobject="Account"
             labelField="Name"
             subLabelField="Phone"
             sortByField="Name"
             filter="owner"
             listFilter="true"
             nextPage="{!Page.AccountDetails}" />

 

Or does anyone know away to have the Detail Component read from the URL? Or jQuery document ready function?

 

Ex: /apex/MobileAccountDetail?Id=012040000000144

 

The reason we are looking for this functionally is because we are going be doing some drilling down on the sObject along with some additional @remoteaccces in the details page. 



 

We are trying to run a script that calls an Email Template(Code Below) and creates a list of Messaging.SingleEmailMessage for a custom object and emails the SingleEmailMessage list to customers. 

The issue we ran into was after the first email was sent out, the rest of the email PDF attachment loses it reference to the style sheet. 

Script Code: 

List<CustomObject>invoices = [select id 
,name 
,Email 
,OwnerId 
from CustomObject 
where already_sent__c = true]; 
User u = [select email 
,Name 
from User 
where name like '%Admin%']; 

EmailTemplate invEmail = [select id 
from EmailTemplate 
where name = 'correctCustomObject']; 

List<Messaging.SingleEmailMessage>emails = new List<Messaging.SingleEmailMessage>(); 

for (SCMC__Invoicing__c invoice : invoices){ 

String invoiceEmailAddr = invoice.Email; 
String ownerEmail = u.email; 
String[] toAddresses = new String[] {invoiceEmailAddr};

Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); 
mail.setToAddresses(toAddresses); 
mail.setReplyTo(ownerEmail); 
mail.setSenderDisplayName(u.Name); 
mail.setUseSignature(false); 
mail.setTemplateId(invEmail.id); 
mail.setTargetObjectId(invoice.OwnerID); 
mail.setSaveAsActivity(false); 
mail.setWhatId(invoice.id); 
emails.add(mail); 


try { 
Messaging.sendEmail(emails); 
} catch(Exception ex) { 
System.debug(ex.getMessage()); 



Visual Force Email Template: 

<messaging:emailTemplate subject="Your Corrected PDF" relatedToType="Custom Object"> 
<messaging:plainTextEmailBody > 
Text Here! 
</messaging:plainTextEmailBody> 
<messaging:htmlEmailBody > 
Text Here! 
</messaging:htmlEmailBody> 
<messaging:attachment renderAs="PDF" filename="{!RelatedTo.name}.pdf"> 
<c:Layout invId="{!RelatedTo.id}" /> 
</messaging:attachment> 
</messaging:emailTemplate> 

Layout Component: 

<apex:component access="global" controller="ControllerClass" layout="none"> 
<apex:attribute name="idValue" type="string" required="false" assignTo="{!idValue}" description="The id of the item being rendered."/> 
<apex:stylesheet value="{!$Resource.FormsStyleSheetExtension}" /> 
<apex:componentBody > 

Body of the custom object be display 

</apex:componentBody > 
</apex:component> 




I've even moved the stylesheet resource inside the email template and that did not work. 
Has anyoneseen this issue before? And does anyone have a work around? 

We have several visualforce email templates where there is an attachment that is a visualforce component. Most of the time the emails go out and the attachment is rendered correctly. Sometimes the attachment is not rendering correctly and it appears that the style sheet is not being considered. 

 

Example email template attachment tag:
<messaging:attachment renderAs="PDF" filename="{!RelatedTo.name}.pdf">
<c:component invId="{!RelatedTo.id}" />
</messaging:attachment>


Example Component:

<apex:component access="global" controller="ControllerClass">
<apex:attribute name="Id" type="string" required="false" assignTo="{!ObjId}" description="The id of the item being rendered."/>
<apex:stylesheet value="{!URLFOR($Resource.StyleSheetExtension)}" />
<apex:stylesheet value="{!URLFOR($Resource.PDFStyleSheet)}" />
<apex:componentBody >

html code here

</apex:componentBody>

 

FYI - All resource files are cache control public. 

 

Thanks

We are trying to create a hybrid app using visualforce pages, @remoteaction and sencha touch 2.0. I'm having issues with understanding the proxy method on Sencha Touch in relationship to the @remoteaction and loading data.  Is there a good tutorial?

 

Our goal is to use Sencha Designer 2 to create UI and copy code to a visualforce page. Then hooking up the remote action. I saw this at Cloudforce in SF in March 2012 but cannot find any documentation. The session was "Partner Session: Build a HTML5 App from scratch with the Sencha Framework"

 

Can anyone help?

We are trying to run a script that calls an Email Template(Code Below) and creates a list of Messaging.SingleEmailMessage for a custom object and emails the SingleEmailMessage list to customers. 

The issue we ran into was after the first email was sent out, the rest of the email PDF attachment loses it reference to the style sheet. 

Script Code: 

List<CustomObject>invoices = [select id 
,name 
,Email 
,OwnerId 
from CustomObject 
where already_sent__c = true]; 
User u = [select email 
,Name 
from User 
where name like '%Admin%']; 

EmailTemplate invEmail = [select id 
from EmailTemplate 
where name = 'correctCustomObject']; 

List<Messaging.SingleEmailMessage>emails = new List<Messaging.SingleEmailMessage>(); 

for (SCMC__Invoicing__c invoice : invoices){ 

String invoiceEmailAddr = invoice.Email; 
String ownerEmail = u.email; 
String[] toAddresses = new String[] {invoiceEmailAddr};

Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); 
mail.setToAddresses(toAddresses); 
mail.setReplyTo(ownerEmail); 
mail.setSenderDisplayName(u.Name); 
mail.setUseSignature(false); 
mail.setTemplateId(invEmail.id); 
mail.setTargetObjectId(invoice.OwnerID); 
mail.setSaveAsActivity(false); 
mail.setWhatId(invoice.id); 
emails.add(mail); 


try { 
Messaging.sendEmail(emails); 
} catch(Exception ex) { 
System.debug(ex.getMessage()); 



Visual Force Email Template: 

<messaging:emailTemplate subject="Your Corrected PDF" relatedToType="Custom Object"> 
<messaging:plainTextEmailBody > 
Text Here! 
</messaging:plainTextEmailBody> 
<messaging:htmlEmailBody > 
Text Here! 
</messaging:htmlEmailBody> 
<messaging:attachment renderAs="PDF" filename="{!RelatedTo.name}.pdf"> 
<c:Layout invId="{!RelatedTo.id}" /> 
</messaging:attachment> 
</messaging:emailTemplate> 

Layout Component: 

<apex:component access="global" controller="ControllerClass" layout="none"> 
<apex:attribute name="idValue" type="string" required="false" assignTo="{!idValue}" description="The id of the item being rendered."/> 
<apex:stylesheet value="{!$Resource.FormsStyleSheetExtension}" /> 
<apex:componentBody > 

Body of the custom object be display 

</apex:componentBody > 
</apex:component> 




I've even moved the stylesheet resource inside the email template and that did not work. 
Has anyoneseen this issue before? And does anyone have a work around? 

We have several visualforce email templates where there is an attachment that is a visualforce component. Most of the time the emails go out and the attachment is rendered correctly. Sometimes the attachment is not rendering correctly and it appears that the style sheet is not being considered. 

 

Example email template attachment tag:
<messaging:attachment renderAs="PDF" filename="{!RelatedTo.name}.pdf">
<c:component invId="{!RelatedTo.id}" />
</messaging:attachment>


Example Component:

<apex:component access="global" controller="ControllerClass">
<apex:attribute name="Id" type="string" required="false" assignTo="{!ObjId}" description="The id of the item being rendered."/>
<apex:stylesheet value="{!URLFOR($Resource.StyleSheetExtension)}" />
<apex:stylesheet value="{!URLFOR($Resource.PDFStyleSheet)}" />
<apex:componentBody >

html code here

</apex:componentBody>

 

FYI - All resource files are cache control public. 

 

Thanks

We are trying to create a hybrid app using visualforce pages, @remoteaction and sencha touch 2.0. I'm having issues with understanding the proxy method on Sencha Touch in relationship to the @remoteaction and loading data.  Is there a good tutorial?

 

Our goal is to use Sencha Designer 2 to create UI and copy code to a visualforce page. Then hooking up the remote action. I saw this at Cloudforce in SF in March 2012 but cannot find any documentation. The session was "Partner Session: Build a HTML5 App from scratch with the Sencha Framework"

 

Can anyone help?