• Philip F
  • NEWBIE
  • 5 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 10
    Replies
I can hear the choirfolk chanting: Visualforce is so stale!  To which I say: Unless you want to actually print your work. (It would be amazing if lightning could print in a useful way.)

I'm working on a Visualforce page that will be included included in a lightning component that will also be used for a printed version of the VF page contents renderd as pdf.   

I've tried every permutation of <apex:slds />, lightningStylesheets="true", applyHtmlTag="false", applyBodyTag="false", renderAs="pdf", and renderAs="advanced_pdf".

I appears that any attempt to render visualforce that includes the SLDS CSS causes Salesforce to puke with "An internal server error has occurred."  I'm not the first to discover this behavior: https://developer.salesforce.com/forums#!/feedtype=SINGLE_QUESTION_SEARCH_RESULT&id=9060G000000Ub1lQAC

I haven't tried embedding the LDS CSS in a static resource because it appears this didn't work for others: https://github.com/salesforce-ux/design-system/issues/341

Does anyone have insight into the best practice to style a Visualforce page to match the SLDS for inclusion in a lightning component and printing?

Thank you,
-Philip
The link in the sentence "The second class, slds-m-bottom--small is a spacing utility class to add some padding underneath the heading" currently points to https://www.lightningdesignsystem.com/components/utilities/sizing.  It should point to https://www.lightningdesignsystem.com/components/utilities/spacing/ instead.
Following the documentation on navigation with the sforce.one object, I'm attempting to create Opportunity Products with a link on a Visualforce page that has been added to the page layout and is visible in the Details section of the Lightning Experience view of the Opportunity. I'm calling:

sforce.one.createRecord('OpportunityLineItem');

When clicking "Add Product" from the standard Lightning Experience interface, the "Opportunity" value on the lightbox form is pre-populated.

User-added image
However, calling sforce.one.createRecord('OpportunityLineItem'); results in a blank "Opportunity" value and clicking in the Product textbox results in an error.

User-added image

Clearly, calling sforce.one.createRecord('OpportunityLineItem'); isn't providing the Opportunity ID to the Add Product form, but I haven't been able to find any documentation or discussion of how to make this work.

I did find a known issue with Salesforce, that looks like a similar problem.

I know I can create a Visualforce page of my own for adding products, but I'd rather leverage the "Add Product" functionality that already exists in Lightning Experience, if possible. Am I missing something, or are there any pointers you'd recommend?

I've also cross posted this on StackExchange and will report back with anything I learn there.
I can hear the choirfolk chanting: Visualforce is so stale!  To which I say: Unless you want to actually print your work. (It would be amazing if lightning could print in a useful way.)

I'm working on a Visualforce page that will be included included in a lightning component that will also be used for a printed version of the VF page contents renderd as pdf.   

I've tried every permutation of <apex:slds />, lightningStylesheets="true", applyHtmlTag="false", applyBodyTag="false", renderAs="pdf", and renderAs="advanced_pdf".

I appears that any attempt to render visualforce that includes the SLDS CSS causes Salesforce to puke with "An internal server error has occurred."  I'm not the first to discover this behavior: https://developer.salesforce.com/forums#!/feedtype=SINGLE_QUESTION_SEARCH_RESULT&id=9060G000000Ub1lQAC

I haven't tried embedding the LDS CSS in a static resource because it appears this didn't work for others: https://github.com/salesforce-ux/design-system/issues/341

Does anyone have insight into the best practice to style a Visualforce page to match the SLDS for inclusion in a lightning component and printing?

Thank you,
-Philip
I'm trying to write a test class and load bunch of test lead's data but for some reason when I call the static resource (that has my CSV) is not recognizing the custom fields. Example, Lead_insurance_Id__c

My CSV file - static resource:
// Example of how my CSV looks like

Id, Firstname, Lastname, Leads_Insurance_ID__c,..etc

000012, Fares, Alsyoufi, 12184111, ..etc
000011, Fare,syoufi, 12184211, ..etc
000013, Fares, syouf, 12184311, ..etc

My test class:
 
@isTest 
global class DataUtil {
    static testmethod void testLoadData() {
        // Load the test accounts from the static resource
        List<sObject> ls = Test.loadData(Account.sObjectType, 'TestData');
        
       }
}

Error message: 

User-added image

Seems like the standard Salesforce fields didn't cause any execptions but custom fields did (I tried other one beside Lead_Insurance_Id__c) and I still got the same error message. 

P.S:
I've tried to change my CSV header to all of these formats but non helped:

LEADS_INSURANCE_ID__c
Leads_insurance_Id__c
Lead.DLeads_insurance_Id__c
Insurance ID (Field's label)
I'm trying to use the HTML generated from the web-to-case form to add reCaptcha to a web-to-case form in a Lightning Community component. I'm running into the error that the script tag is not allowed. I'm assuming this is because it is in Lightning. Is there a simple workaround? I've seen some comments online about building a Visualforce page with the  and including it in the HTML component as an iframe; is that the best approach?
 
<script src="https://www.google.com/recaptcha/api.js"></script>
<script>
 function timestamp() { var response = document.getElementById("g-recaptcha-response"); if (response == null || response.value.trim() == "") {var elems = JSON.parse(document.getElementsByName("captcha_settings")[0].value);elems["ts"] = JSON.stringify(new Date().getTime());document.getElementsByName("captcha_settings")[0].value = JSON.stringify(elems); } } setInterval(timestamp, 500); 
</script>

 
The link in the sentence "The second class, slds-m-bottom--small is a spacing utility class to add some padding underneath the heading" currently points to https://www.lightningdesignsystem.com/components/utilities/sizing.  It should point to https://www.lightningdesignsystem.com/components/utilities/spacing/ instead.

In the User's Guide there is a sample http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_test.htm?CSHID=apex_methods_system_test.htm#TestLoadDataExampleSection

of how to use the Test.loadData method to load a csv file with Accounts.

 

I cannot see any documentation nor samples showing how to load records with references (lookup or master-detail) to parent records - e.g. if I want to load Contacts, which refer to Accounts.

 

Anyone who knows. I suppose I am not going to "invent" record IDs????

Our data structure runs on a quite a deep hierarchy. In order to have many of Object B, we must have at least a single Object A, and so forth.

 

How can we use Test.loadData() to set a list of records like this? Or is this not possible?

Am I right in thinking that this method can only set data to a single object and cannot populate relationships?

 

I would like to be able to something like:

 

ChildTestData.csv

"ID","Name","ParentID"

"1","Jim","2"

"2","John", "2"

"3","Jake","3"

 

 

ParentTestData.csv


"ID", "Name"

"1", "Kim"

"2", "Karen"

"3", "Kelly"

 

 

This would result in Jim and John to children of Karen, while Jake is a child of Kelly.

 

 

Also, does this method use up any DML statements?

 

Thanks

Hi Everyone,, 

 

I'm trying to remove a lead record type that's not used any longer...but I seem to be encountering the following error:

 

"This record type RVP cannot be deleted because the following profiles use this record type as default. External Who"  

 

Can anyone PLEASE explain to me why this is the case? I don't have a profile called "External Who"!!! Thanks so much for the help! 

 

Regards, 

 

Studzey

Hi,

 

Unable to fetch and save Force.com Components to Project: com.salesforce.ide.api.metadata.types.Metadata$JaxAccessorF_fullName cannot be cast to com.sun.xm.internal.bind.v2.runtime.reflect.Accessor

 

Abort or Continute Force.com project creation?

==============

while i am creating a new force.com project i got this error: can u please tell me why this error came. i downloaded eclipse and added force.com ide.... when i try to creating a new force.com project i got this error... and i am able to create a force.com project but not getting all existing classes and pages. And not added my new page or class content to the sever when i save. Is it required any other software installations?

 

I am trying build an outer join to display a list of contacts showing if they have a related portal user records or not.

 

I know you can get a list of related contacts from the user object but is it possible to go from contacts to user? 

 

I know this works...Select u.isactive, u.Contact.name From User u but what about Select name, c.user.isactive From Contact c?

 

Any thoughts how I can outer join these two tables and display one list? 

 

Thanks

 

Hi All, I wanted to retrieve Salesforce Id of a field in Apex code. Any Idea? Thanks
  • December 03, 2010
  • Like
  • 0

hi

 

can u please help me how to parse an XML.

 

Actually my requirement is create a webservice in APEX. The parameter for webservice is in the form of XML String. in that webservice i have to parse that XML. for example my input xml is in the form of

 

<?xml version="1.0" encoding="UTF-8" ?>
- <Body>
- <InvoiceRequest>
- <Item>
  <ItemName>num1</ItemName>
  <ItemPrice>$11.0</ItemPrice>
  <ItemId>01278390921098209AB872190</ItemId>
  <ItemType>NULL</ItemType>
  </Item>
- <Item>
  <ItemName>Misc. Service</ItemName>
  <ItemPrice>$23.0</ItemPrice>
  <ItemId>NULL</ItemId>
  <ItemType>Service</ItemType>
  </Item>
- <Item>
  <ItemName>Misc. Product</ItemName>
  <ItemPrice>$36.0</ItemPrice>
  <ItemId>NULL</ItemId>
  <ItemType>Product</ItemType>
  </Item>
  </InvoiceRequest>
  </Body>

 

for the above XML how can i parse this xml. Please help me. The above xml is related to Item Custom object. so i have to construct a List<Item__c> object for this XML.

 

 

Please help me.

  • September 16, 2009
  • Like
  • 0