• Trevor Roy
  • NEWBIE
  • 13 Points
  • Member since 2014


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 9
    Replies

Working through the "Get Ready to Create an App" trailhead module and I'm stuck on the step to create a new scratch org.
I keep getting this error:
          ERROR running force:org:create:  You do not have access to the [ScratchOrgInfo] object.

I'm using the copy function of the text snippet so I know it's not a syntax problem.
                sfdx force:org:create -s -f config/project-scratch-def.json -a GeoAppScratch

Anyone run into this?

I've been able to get my APEX REST class working just fine in the Workbench and via cUrl calls.
But what I really want to do is have a script in our NetSuite environment make a call to my REST function.
I've been looking at the forcetk.js project but I'm unclear as to whether it's what I need or if I need to write something of my own jquery based code to do the authorization and make the call to my REST class.

Does anyone have any experience doing this and have any advice?
Dear Community,
I am new to Lightning experience,i have some knowledge about lightning.i tried to generate the pdf for Account or any standard or custom object.i wrote the some logic the pfd is generated with empty sheet,i want all the fields of the perticular object which is i mentioned.i think i missed some logic in my components/controllers.
can any one suggest where i did mistake and also can tell me how to generate the pdf for perticular object either custom or standard
my code is 
Apex class:
public class DataDisplayController {
    public String PDFData{get;set;}
    
    public DataDisplayController(){
        
        PDFData = '';
    }
    public PageReference downloadPDF(){
        System.PageReference pageRef = new System.PageReference('/apex/PDFGenerator');
        //ensure pdf downloads and is assigned with defined name
        pageRef.getHeaders().put('content-disposition', 'attachment; filename=TestPDF.pdf');
        
        return pageRef;
    }
    }
Component:
<aura:component >
    <aura:attribute name = "sendData" type = "Account"/>
    <lightning:button label = "Download Document" onclick = "{!c.downloadDocument}" />
    
</aura:component>

client-side controller.js
({
 downloadDocument : function(component, event, helper){

  var sendDataProc = component.get("v.sendData");
  var dataToSend = {
     "label" : "This is test"
  }; //this is data you want to send for PDF generation

  //invoke vf page js method
  sendDataProc(dataToSend, function(){
              
  });
 }
})
Helper.js
({
    helperMethod : function(component,callbackMethod) {
        var action = component.get("c.download");
        action.setCallback(this,function(response){
            var state = response.getState();
            if(state === "SUCCESS"){
                var generatePdf = reponse.getReturnValue();
                component.set("v.sendData",generatePdf);
                console.log('pdf generated successfully');
                
            }
            else{
                console.log('unable to generate the pdf');
            }
        });
        $A.enqueueAction(action);
        
    }
})
VF Page:
<apex:page controller="DataDisplayController" showHeader="false">
    <apex:includeLightning />
    
    <apex:form>
        <apex:inputHidden id="hidData" value="{!PDFData}"/>
        <apex:actionFunction name="jsGeneratePDF" action="{!downloadPDF}"/>
        <div id = "lightning" />
        
        <script>
            function saveData(data, callback){
            var hidData = document.getElementById('{!$Component.hidData}');
            hidData.value = JSON.stringify(data);
            
            //invoke PDF Generation
            jsGeneratePDF();
         
            //invoke callback;
            if(typeof callback == 'function') callback();
        }
        
        
        function loadComponents(){
            console.log("Loading lightning component: DataProcessor");
            
            $Lightning.use("c:LightningPDFGeneratorDemoApp", function() {
                $Lightning.createComponent("c:DataProcessor",
                { 
                    sendData : saveData
                },
                "lightning",
                function(cmp) {
                    // do some stuff
                });
            });
        }
        
        loadComponents();
        </script>            
           </apex:form>
</apex:page>

<apex:page controller="DataDisplayController"  renderAs="pdf">
    {!PDFData}
</apex:page>

App:
<aura:application extends = "ltng:outApp" >
    <c:DataProcessor />
    
</aura:application>

thanks in advance
  • October 10, 2018
  • Like
  • 0
Doing the Build Flexible Apps with Lightning Components proyect, in step 2 (Use Base Lightning Components) I got a error: "Make sure the 'SimilarProperties' component has been added to the Property Record page", but I already added the component to the only Lightning record Page and activated it.   Anyone can help me? .
In FireFox after completing this module and running I am presented with this error:

This page has an error. You might just need to refresh it. First, would you give us some details? (We're reporting this as error ID: -2049513082)

[cannot use the given object as a weak map key]

FirefoxErrorChromeWorking

Working through the "Get Ready to Create an App" trailhead module and I'm stuck on the step to create a new scratch org.
I keep getting this error:
          ERROR running force:org:create:  You do not have access to the [ScratchOrgInfo] object.

I'm using the copy function of the text snippet so I know it's not a syntax problem.
                sfdx force:org:create -s -f config/project-scratch-def.json -a GeoAppScratch

Anyone run into this?

I am in the last action where the process builder calls the invocable apex class. When i look for the class it appears with the LabelName
 'Give a Thanks Badge' and the lookups do not show up on the Giver Id and Receiver Id fields. Can someone tell me what am I doing wrong?
User-added image
If i put the apex class name as is shown in the trail it still does not find the Giver Id and Receiver Id values. My apex code has an active status.
User-added image
Thank you.
​I keep getting

Challenge Not yet complete... here's what's wrong: 
The 'Top Laptop Industry' lens was not found. Please follow the requirements and ensure everything is setup correctly


I have named the Lens as step 2 - Enter D01 - Laptops Salespeople - Wall of Fame as the title AND/OR result set Top Laptop Industry

Neither seem to work. I have refresed the screen, even cleared cookies and rebooted the computer. 
I've been able to get my APEX REST class working just fine in the Workbench and via cUrl calls.
But what I really want to do is have a script in our NetSuite environment make a call to my REST function.
I've been looking at the forcetk.js project but I'm unclear as to whether it's what I need or if I need to write something of my own jquery based code to do the authorization and make the call to my REST class.

Does anyone have any experience doing this and have any advice?
I receive this error when I check my challenge.

User-added image
Challenge not yet complete... here's what's wrong: 
An account with a related opportunity did not calculate the correct potential value.

The task was to Create a rollup summary field that determines the potential value of the opportunities associated with an account.
Add a custom field to the standard account object that provides a rollup summary of the total expected revenue from all related opportunities.The rollup summary field should be labeled 'Potential Value' and have the Field Name of 'Potential_Value'. The resulting API name should be 'Potential_Value__c'.
The rollup summary should calculate the total expected revenue of all the opportunities related to the account.

Here is a snap shot of my work. Any suggestions as to why this is failing?

User-added image

Thanks,
Darren