• Daniele Negroni 11
  • NEWBIE
  • 0 Points
  • Member since 2018

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

Hey guys,

is there a workaround for getting lightning:outputField "value"?

Look at this code!

UI.cmp

<lightning:outputField fieldName="ExternalCode__c" aura:id="adrExternalCode" />
I've tried to do something like this in the UIController.js
component.find('adrExternalCode').get('v.value');

but it does not work, and i even got an error because component.find('adrExternalCode') is undefined.
 

Wait: i can display the value (through fieldName="ExternalCode__c"), but i can't take it and do anything with it?

I am attempting to create a pdf blob from a url to attach to a custom object.  Currently I have this, which creates a blank pdf object with the correct number of pages....

 

 

public Blob getBlob(String url){
	PageReference pageRef = new PageReference(url);
	Blob ret = Blob.valueOf(pageRef.getContent().toString());
        return ret;
}

 If I change it to this I get the error 'An internal service error has occurred'...

 

public Blob getBlob(String url){
	PageReference pageRef = new PageReference(url);
	Blob ret = Blob.toPdf(pageRef.getContent().toString());
	return ret;
}

 The url I am feeding in the is URL of a VF page that is rendered as a PDF doc and loads fine otherwise.