• Nandu
  • NEWBIE
  • 30 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 17
    Replies
User-added image
When click on flow it's throwning above error
this flow is calling external services.i updated latested  url also but it's not working .
 this flow is working in other sandboxs but in developer sandbox it's not working ..
i redeplyod  this flow  still it's not working

Please help me

Thanks,
Mahesh  
  • November 29, 2019
  • Like
  • 0
User-added image

i'm not able to find lookup filter on standard field owner (work order object )

please help me how to set lookup filter for this field
  • October 14, 2019
  • Like
  • 0
Custom button logic
{!URLFOR($Site.Prefix+'/apex/PDF_Export?Id='+Applications__c.Id)}

i am getting Error User-added image

Excpeted out put (record in pdf format for community user)

User-added image
  • June 18, 2019
  • Like
  • 0

<table class="slds-table slds-table_cell-buffer slds-table_bordered">
            <thead>
                <tr class="slds-line-height_reset slds-border--bottom">
                    <th class="" scope="col"><ui:inputCheckbox/></th>
                    <th class="" scope="col">
                         <div class="slds-truncate " title="Name">Name</div>
                    </th>
                    <th class="" scope="col">
                         <div class="slds-truncate" title="Name">Industry</div>
                    </th>
                    <th class="" scope="col">
                         <div class="slds-truncate" title="Name">Phone</div>
                    </th>
                    <th class="" scope="col">
                         <div class="slds-truncate" title="Name">Rating</div>
                    </th>
                </tr>
            </thead>
            <aura:iteration items="{!v.accounts}" var="ac">
                <tr class="slds-hint-parent">
                    <td class="slds-truncate"><ui:inputCheckbox aura:id="checkbox" change="{!c.handleCheckbox}"/></td>
                    <td class="slds-truncate">{!ac.Name}</td>
                    <td class="slds-truncate">{!ac.Industry}</td>
                    <td class="slds-truncate">{!ac.Phone}</td>
                    <td class="slds-truncate">{!ac.Rating}</td>
                </tr>
            </aura:iteration>
        </table>

output:

User-added image


Expected output:
User-added image

Thanks&Regards
Mahesh

 
  • April 11, 2019
  • Like
  • 0
Component
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" access="global" >
    <aura:attribute name="latitude" type="Decimal" default="20.5937"/>
    <aura:attribute name="longitude" type="Decimal" default="78.9629"/>
    <aura:attribute name="markers" type="Object"/>
    <aura:attribute name="map" type="Object"/>
    <ltng:require styles="/resource/leaflet/leaflet.css" />    
    <ltng:require scripts="/resource/leaflet/leaflet.js"
             afterScriptsLoaded="{!c.jsLoaded}" />
    <aura:handler event="c:carDetailsEvent" action="{!c.carSelectedLocation}"/>
  
        <div class="map" id="map"></div>

</aura:component>

Controller
jsLoaded: function(component, event, helper) {
       var lat=component.get("v.latitude");
        var long=component.get("v.longitude");
       helper.doinit_helper(component,lat,long);
       
},
    carSelectedLocation:function(component,event,helper){
        component.set("v.latitude",event.getParam("latitudeValue"));
        component.set("v.longitude",event.getParam("longitudeValue"))
        //alert('lat....'+event.getParam("latitudeValue"));
       var map = component.get('v.map');
        var lat=component.get("v.latitude");
        var long=component.get("v.longitude");
        helper.doinit_helper(component,lat,long);
        alert('lat..'+lat+'...long...'+long);
}

Helper clas
doinit_helper : function(component,lat,long) {
        setTimeout(function() {
            //alert('lat....'+lat+'  .long....'+long);
            var map = L.map('map', {zoomControl: false,tap: false}).setView([lat, long],6);
            L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}',
                        {
                            attribution: 'Tiles © Esri'
                        }).addTo(map);
            
            // Add marker
            L.marker([lat, long]).addTo(map)
            .bindPopup('Home of Dreamforce');
        });
    }

s​
  • September 18, 2018
  • Like
  • 0
User-added image
Component
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" access="global" >
    <aura:attribute name="map" type="Object"/>
   <ltng:require 
        styles="{!$Resource.mahesh_space__leaflet + '/leaflet.css'}"
        scripts="{!$Resource.mahesh_space__leaflet + '/leaflet.js'}"
        afterScriptsLoaded="{!c.jsLoaded}" />
    
     <!--<ltng:require 
                  styles="{!$Resource.mahesh_space__leaflet + '/leaflet.css'}"
                  scripts="{!join($Resource.mahesh_space__leaflet + '/leaflet.js', 
                           $Resource.mahesh_space__leaflet + '/leaflet-src.js')}"
                  afterScriptsLoaded="{!c.jsLoaded}" />-->
    <lightning:card>
        <div aura:id="map" style="width:100%;hieght:100%">
        </div>
    </lightning:card>
</aura:component>

Controler
({
    jsLoaded: function(component, event, helper) {
        var map = L.map('map', {zoomControl: false, tap: false}).setView([37.784173, -122.401557], 14);
        L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}',
                    {
                        attribution: 'Tiles © Esri'
                    }).addTo(map);
        component.set("v.map", map);
    }
})

 
  • August 30, 2018
  • Like
  • 0
String jsonText = '{"Data": [{"attributes": {"type": "Contact","url":"/services/data/v35.0/sobjects/Contact/0036100000JUXKkAAP"},"Email":"positi@gmail.com","Description": "","Phone":"9999999","LastName": "sasumi"},{"attributes": {"type": "Contact","url":"/services/data/v35.0/sobjects/Contact/0036100000JUXKkAAP"},"Email":"edge@gmail.com","Description": "","Phone":"88888","LastName": "pavanTL"}]}';

Map<String, Object> deserialized = (Map<String, Object>)JSON.deserializeUntyped(jsonText);
List<Map<String, Object>> data = new List<Map<String, Object>>();
for (Object instance : (List<Object>)deserialized.get('Data')){
    data.add((Map<String, Object>)instance); 
}

String dataSerialize=JSON.serialize(data);
System.debug('dataSerialize...'+dataSerialize);
try
{
   SObject customObject = (SObject)JSON.deserialize(dataSerialize, Sobject.class);
    Database.upsert(customObject);
    System.debug(' customObject...: '+customObject);
}
catch(Exception ex)
{
    System.debug(' @@@@@ Don\'t visible '+ex.getMessage());
}

 
  • August 15, 2018
  • Like
  • 0
event :recordDetailpage
<aura:event type="APPLICATION" description="Event template">
    <aura:attribute name="BoatRecord_Id" type="String"/>
</aura:event>
component 1
<aura:registerEvent name="RecDetail_Event" type="c:recordDetailpage"/>


Helper Class
imgclick_helper:function(component,event,recId){
        var appEvent = $A.get("e.c:recordDetailpage");
        alert('recId from boat search..'+recId);
        appEvent.setParams({
            "BoatRecord_Id" : recId});
        appEvent.fire();
}

component 2
 
<aura:handler name="RecDetail_Event" event="c:recordDetailpage" action="{!c.Controller_RecDetail}"/>
controller_RecDetail
var selecteRecodID=event.getParam("BoatRecord_Id");
        component.set("v.selectedRec_id", selecteRecodID);


  • August 08, 2018
  • Like
  • 0
<aura:component implements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" controller="lntg_DataTableClass" access="global" >
    <aura:attribute name="data" type="Object" default="{'sobjectType':'Account'}"/>
    <aura:attribute name="columns" type="List"/>
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    <lightning:card title="Account Editable Datatable">
        <lightning:datatable
                aura:id="accountDataTable"
                keyField="id"
                data="{!v.data}"
                columns="{!v.columns}"
                onsave ="{!c.onSave}"
                hideCheckboxColumn="false"/>
    </lightning:card>
</aura:component>


({
    doInit : function(component, event, helper) {
        var tableHeder=[
            {label: 'Name', fieldName: 'Name', editable:false, type: 'text'},
            {label: 'Industry', fieldName: 'Industry', type: 'text'},
            {label: 'Phone', fieldName: 'Phone', editable:true, type: 'Phone'},
            {label: 'Rating', fieldName: 'Rating', editable:true, type: 'text'}
        ];
        component.set("v.columns",tableHeder);
        helper.getdata(component,event,helper);
    },
    onSave:function(component,event,helper){
       
        helper.saveDataTable(component,event,helper);
    }
})



({
    getdata : function(component,event,helper) {
        var action=component.get("c.getAccounts");
        action.setCallback(this,function(response){
            var state=response.getState();
            if(state=="SUCCESS"){
                component.set("v.data",response.getReturnValue());
            }
        });
        $A.enqueueAction(action);
    },
    saveDataTable:function(component,event,helper){
        var action=component.get("c.editRecordsupdated");
        /*var editRec =  component.find("accountDataTable").get("v.draftValues");
        alert('editRec..'+JSON.stringify(editRec));*/
        
        var draftValues = event.getParam('draftValues');
        var editRecordsLenght=draftValues.length;
        
        alert('draftValues..'+draftValues);
        action.setParams({
            'editReds':draftValues
        });
        action.setCallback(this,function(response){
            var state=response.getState();
            alert('state...'+state);
            if(state=="SUCCESS"){
                if(response.getReturnValue() === true){
                    alert('Record updated');
                    helper.showToast({
                        "title": "Record Update",
                        "type": "success",
                        "message": editRecordsLenght+" Account Records Updated"
                    });
                    helper.reloadDataTable();
                } else{ //if update got failed
                    helper.showToast({
                        "title": "Error!!",
                        "type": "error",
                        "message": "Error in update"
                    });
                }
            }else if (state === "INCOMPLETE") {
                // do something
            }
                else if (state === "ERROR") {
                    var errors = response.getError();
                    if (errors) {
                        if (errors[0] && errors[0].message) {
                            console.log("Error message: " + 
                                        errors[0].message);
                        }
                    } else {
                        console.log("Unknown error");
                    }
                }
        });
        $A.enqueueAction(action);
    },
    /*
     * Show toast with provided params
     * */
    showToast : function(params){
        alert('showToast');
        var toastEvent = $A.get("e.force:showToast");
        if(toastEvent){
            toastEvent.setParams(params);
            toastEvent.fire();
        } else{
            alert(params.message);
        }
    },
    
    /*
     * reload data table
     * */
    reloadDataTable : function(){
        var refreshEvent = $A.get("e.force:refreshView");
        if(refreshEvent){
            refreshEvent.fire();
        }
    }
})

public class lntg_DataTableClass {
    @AuraEnabled
    public static List<Account> getAccounts(){
        return[select id,name,industry,phone,rating from Account limit 5];
    }
    @AuraEnabled
    public static Boolean editRecordsupdated(List<Account> editReds){
        try{
            System.debug('beforce editRecords..'+editReds);
            update editReds;
            System.debug('editRecords..'+editReds);
            return true;
        }catch(Exception e){
            System.debug('e.'+e);
            return false;
        }
    }

}

 
  • August 03, 2018
  • Like
  • 0
<form class="slds-form--stacked">
                    <lightning:input type="text" aura:id="newItemForm" label="Name"
                                     name="Name"
                                     value="{!v.newItem.Name}"
                                     required="true"/> 
                    <lightning:input type="number" aura:id="newItemForm" label="Price"
                                     name="Price"
                                     min="0.1"
                                     formatter="currency"
                                     step="0.01"
                                     value="{!v.newItem.Price__c}"
                                     messageWhenRangeUnderflow="Enter an amount that's at least $0.10."/>       
                    <lightning:input aura:id="newItemForm" label="Packed"  
                                     name="Packed" type="checkbox" 
                                     checked="{!v.newItem.Packed__C}" value="{!v.newItem.Packed__C}"
                                     />
                    <lightning:input type="number" aura:id="newItemForm" label="Quantity"
                                     name="Quantity"
                                     min="1"
                                     step="1"
                                     value="{!v.newItem.Quantity__c}"
                                     placeholder="0"/>
                </form>
  • July 03, 2018
  • Like
  • 0
User-added image
When click on flow it's throwning above error
this flow is calling external services.i updated latested  url also but it's not working .
 this flow is working in other sandboxs but in developer sandbox it's not working ..
i redeplyod  this flow  still it's not working

Please help me

Thanks,
Mahesh  
  • November 29, 2019
  • Like
  • 0
Custom button logic
{!URLFOR($Site.Prefix+'/apex/PDF_Export?Id='+Applications__c.Id)}

i am getting Error User-added image

Excpeted out put (record in pdf format for community user)

User-added image
  • June 18, 2019
  • Like
  • 0
I create a pdf page now i want to use external css on pdf page.i used give to link for boot streap but it's not working.

<table class="slds-table slds-table_cell-buffer slds-table_bordered">
            <thead>
                <tr class="slds-line-height_reset slds-border--bottom">
                    <th class="" scope="col"><ui:inputCheckbox/></th>
                    <th class="" scope="col">
                         <div class="slds-truncate " title="Name">Name</div>
                    </th>
                    <th class="" scope="col">
                         <div class="slds-truncate" title="Name">Industry</div>
                    </th>
                    <th class="" scope="col">
                         <div class="slds-truncate" title="Name">Phone</div>
                    </th>
                    <th class="" scope="col">
                         <div class="slds-truncate" title="Name">Rating</div>
                    </th>
                </tr>
            </thead>
            <aura:iteration items="{!v.accounts}" var="ac">
                <tr class="slds-hint-parent">
                    <td class="slds-truncate"><ui:inputCheckbox aura:id="checkbox" change="{!c.handleCheckbox}"/></td>
                    <td class="slds-truncate">{!ac.Name}</td>
                    <td class="slds-truncate">{!ac.Industry}</td>
                    <td class="slds-truncate">{!ac.Phone}</td>
                    <td class="slds-truncate">{!ac.Rating}</td>
                </tr>
            </aura:iteration>
        </table>

output:

User-added image


Expected output:
User-added image

Thanks&Regards
Mahesh

 
  • April 11, 2019
  • Like
  • 0
I need Apex and Visualforce\

Create Vf page for Salesforce users.
Add additional field Password
if I click on save button user has to be created with password
Note: No need sending email to the user emailid
Component Code
<aura:component controller="AccountController11">
     
	 <aura:attribute name="newAccount" type="Account"
         default="{ 'sobjectType': 'Account',
                        'Name': '',
                        'Type': '',
                        'Industry': '',
                        'ParentId':'',
                        
                   }"/>
    
    <aura:attribute name="Type" type="List" />
     <aura:handler name="init" value="{!this}" action="{!c.loadOptions}" />
    <force:outputField aura:id="accountLookupOutput" value="{!v.newAccount.ParentId}" class="slds-hide"></force:outputField>
    <aura:attribute name="accounts" type="Account[]"/>
   
    <form class="slds-form--stacked">
        <lightning:input aura:id="accountform" label="Account Name"
                             name="Accountname"
                             value="{!v.newAccount.Name}"
                             required="true"/>
        <lightning:select name="select" label="Select a Account Type" required="true" messageWhenValueMissing="Did you forget to select Account Type?" value="{!v.newAccount.Type}">
             <option value="">-- None --</option>
             <aura:iteration items="{!v.Type}" var="T1">
            <option value="{!T1}" text="{!T1}"></option>
            </aura:iteration>
    </lightning:select>
        <force:inputField aura:id="accountLookup" value="{!v.newAccount.ParentId}"></force:inputField>
    <lightning:button label="Create Account" 
                              class="slds-m-top--medium"
                              variant="brand"
                              onclick="{!c.clickCreate}"/>
    </form>
</aura:component>

Controller Code
({
	loadOptions: function(component, event, helper) {
	var action=component.get("c.accountType");
    action.setCallback(this, function(response){
     component.set("v.Type",response.getReturnValue())
        });
        $A.enqueueAction(action);
	},
    clickCreate : function(component, event, helper) {
		var newAccount=component.get("v.newAccount");
        console.log(newAccount);
        if($A.util.isEmpty(newAccount.Name) || $A.util.isUndefined(newAccount.Name)){
            alert(' Name is Required');
            return;
        }
        
        
        console.log("Create Account: " + JSON.stringify(newAccount));
        var b=JSON.stringify(newAccount);
        console.log("Create Account:"+JSON.parse(b));
        helper.createAccount(component,newAccount);
	}
    
})

Helper Code​
({
	createAccount: function(component, acc) {
        var action = component.get("c.saveAccount");
        console.log(acc);
        action.setParams({
            "acc1": acc
            
        });
        action.setCallback(this, function(response){
            var state = response.getState();
            if (state === "SUCCESS") {
                var accounts = component.get("v.accounts");
                accounts.push(response.getReturnValue());
                component.set("v.accounts", accounts);
            }
        });
        $A.enqueueAction(action);
    }    
})

This Code is working only upto the page,but its not saving the the account when ever i click the create account button,but if i remove the force inputfield the account is getting created.
String jsonText = '{"Data": [{"attributes": {"type": "Contact","url":"/services/data/v35.0/sobjects/Contact/0036100000JUXKkAAP"},"Email":"positi@gmail.com","Description": "","Phone":"9999999","LastName": "sasumi"},{"attributes": {"type": "Contact","url":"/services/data/v35.0/sobjects/Contact/0036100000JUXKkAAP"},"Email":"edge@gmail.com","Description": "","Phone":"88888","LastName": "pavanTL"}]}';

Map<String, Object> deserialized = (Map<String, Object>)JSON.deserializeUntyped(jsonText);
List<Map<String, Object>> data = new List<Map<String, Object>>();
for (Object instance : (List<Object>)deserialized.get('Data')){
    data.add((Map<String, Object>)instance); 
}

String dataSerialize=JSON.serialize(data);
System.debug('dataSerialize...'+dataSerialize);
try
{
   SObject customObject = (SObject)JSON.deserialize(dataSerialize, Sobject.class);
    Database.upsert(customObject);
    System.debug(' customObject...: '+customObject);
}
catch(Exception ex)
{
    System.debug(' @@@@@ Don\'t visible '+ex.getMessage());
}

 
  • August 15, 2018
  • Like
  • 0
event :recordDetailpage
<aura:event type="APPLICATION" description="Event template">
    <aura:attribute name="BoatRecord_Id" type="String"/>
</aura:event>
component 1
<aura:registerEvent name="RecDetail_Event" type="c:recordDetailpage"/>


Helper Class
imgclick_helper:function(component,event,recId){
        var appEvent = $A.get("e.c:recordDetailpage");
        alert('recId from boat search..'+recId);
        appEvent.setParams({
            "BoatRecord_Id" : recId});
        appEvent.fire();
}

component 2
 
<aura:handler name="RecDetail_Event" event="c:recordDetailpage" action="{!c.Controller_RecDetail}"/>
controller_RecDetail
var selecteRecodID=event.getParam("BoatRecord_Id");
        component.set("v.selectedRec_id", selecteRecodID);


  • August 08, 2018
  • Like
  • 0
Dear
I do not know why but the inputfiled can not show the value
and the source as below
does anyone can help me to fix it ?

<aura:component implements="lightning:actionOverride,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:lightningQuickActionWithoutHeader,force:hasRecordId" access="global" >
            <lightning:recordEditForm aura:id="edit" recordId="0017F00000MWJ11QAH" recordtypeid="0127F000000SCs7QAG" objectApiName="Account"  >
                <div aura:id="msg">
                    <lightning:messages  />
                </div>
                     <lightning:inputField fieldName="Name" />
                       <lightning:inputField fieldName="Phone" />
                

                <footer class="slds-modal__footer">
                    <lightning:button variant="neutral" label="Cancel" onclick="{!c.cancelBtn}"/>
                    <lightning:button aura:id="submit" label="Save" variant="brand" type="submit"  />
                </footer>
            </lightning:recordEditForm>
    </aura:component>
it only the button can show but the input filed can not show anything

User-added image
<aura:component implements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" controller="lntg_DataTableClass" access="global" >
    <aura:attribute name="data" type="Object" default="{'sobjectType':'Account'}"/>
    <aura:attribute name="columns" type="List"/>
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    <lightning:card title="Account Editable Datatable">
        <lightning:datatable
                aura:id="accountDataTable"
                keyField="id"
                data="{!v.data}"
                columns="{!v.columns}"
                onsave ="{!c.onSave}"
                hideCheckboxColumn="false"/>
    </lightning:card>
</aura:component>


({
    doInit : function(component, event, helper) {
        var tableHeder=[
            {label: 'Name', fieldName: 'Name', editable:false, type: 'text'},
            {label: 'Industry', fieldName: 'Industry', type: 'text'},
            {label: 'Phone', fieldName: 'Phone', editable:true, type: 'Phone'},
            {label: 'Rating', fieldName: 'Rating', editable:true, type: 'text'}
        ];
        component.set("v.columns",tableHeder);
        helper.getdata(component,event,helper);
    },
    onSave:function(component,event,helper){
       
        helper.saveDataTable(component,event,helper);
    }
})



({
    getdata : function(component,event,helper) {
        var action=component.get("c.getAccounts");
        action.setCallback(this,function(response){
            var state=response.getState();
            if(state=="SUCCESS"){
                component.set("v.data",response.getReturnValue());
            }
        });
        $A.enqueueAction(action);
    },
    saveDataTable:function(component,event,helper){
        var action=component.get("c.editRecordsupdated");
        /*var editRec =  component.find("accountDataTable").get("v.draftValues");
        alert('editRec..'+JSON.stringify(editRec));*/
        
        var draftValues = event.getParam('draftValues');
        var editRecordsLenght=draftValues.length;
        
        alert('draftValues..'+draftValues);
        action.setParams({
            'editReds':draftValues
        });
        action.setCallback(this,function(response){
            var state=response.getState();
            alert('state...'+state);
            if(state=="SUCCESS"){
                if(response.getReturnValue() === true){
                    alert('Record updated');
                    helper.showToast({
                        "title": "Record Update",
                        "type": "success",
                        "message": editRecordsLenght+" Account Records Updated"
                    });
                    helper.reloadDataTable();
                } else{ //if update got failed
                    helper.showToast({
                        "title": "Error!!",
                        "type": "error",
                        "message": "Error in update"
                    });
                }
            }else if (state === "INCOMPLETE") {
                // do something
            }
                else if (state === "ERROR") {
                    var errors = response.getError();
                    if (errors) {
                        if (errors[0] && errors[0].message) {
                            console.log("Error message: " + 
                                        errors[0].message);
                        }
                    } else {
                        console.log("Unknown error");
                    }
                }
        });
        $A.enqueueAction(action);
    },
    /*
     * Show toast with provided params
     * */
    showToast : function(params){
        alert('showToast');
        var toastEvent = $A.get("e.force:showToast");
        if(toastEvent){
            toastEvent.setParams(params);
            toastEvent.fire();
        } else{
            alert(params.message);
        }
    },
    
    /*
     * reload data table
     * */
    reloadDataTable : function(){
        var refreshEvent = $A.get("e.force:refreshView");
        if(refreshEvent){
            refreshEvent.fire();
        }
    }
})

public class lntg_DataTableClass {
    @AuraEnabled
    public static List<Account> getAccounts(){
        return[select id,name,industry,phone,rating from Account limit 5];
    }
    @AuraEnabled
    public static Boolean editRecordsupdated(List<Account> editReds){
        try{
            System.debug('beforce editRecords..'+editReds);
            update editReds;
            System.debug('editRecords..'+editReds);
            return true;
        }catch(Exception e){
            System.debug('e.'+e);
            return false;
        }
    }

}

 
  • August 03, 2018
  • Like
  • 0
Re-factored my code from previous units with base lightning components, but receiving this error.  Here's my new form component.  Any help would be much appreciated.

<aura:component >   
    <aura:attribute name="newItem" type="Camping_Item__c"    default="{ 'sobjectType': 'Camping_Item__c',
                         'Name': '',
                         'Price__c': 0,
                         'Quantity__c': 0,                         
                         'Packed__c': false
                       }"/>
 
    <aura:registerEvent name="addItem" type="c:addItemEvent"/>
    <lightning:layout >
        <lightning:layoutItem padding="around-small" size="6">
<div aria-labelledby="newItemForm">

    <!-- BOXED AREA -->
    <fieldset class="slds-box slds-theme--default slds-container--small">

    <legend id="newItemForm" class="slds-text-heading--small 
      slds-p-vertical--medium">
      Add Camping Item
    </legend>

    <!-- CREATE NEW CAMPING ITEM FORM -->
    <form class="slds-form--stacked">          
        <lightning:input aura:id="itemForm" label="Camping Item Name"
                         name="Name"
                         value="{!v.newItem.Name}"
                         required="true"/> 
        <lightning:input type="number" aura:id="itemForm" label="Quantity"
                         name="Quantity"
                         maxlength="16"
                         min="0"
                         step="1"
                         value="{!v.newItem.Quantity__c}"
                         required="true"/>
        <lightning:input type="number" aura:id="itemForm" label="Price"
                         name="Price"
                         min="0"
                         step=".01"
                         value="{!v.newItem.Price__c}"
                         formatter="currency"
                         messageWhenRangeUnderflow="Enter an amount that's at least .01."/>
        <lightning:input type="checkbox" aura:id="itemForm" label="Packed?"  
                         name="Packed"
                         checked="{!v.newItem.Packed__c}"/>
        <lightning:button label="Create Expense" 
                          class="slds-m-top--medium"
                          variant="brand"
                          onclick="{!c.clickCreateItem}"/>
    </form>
  </fieldset>
  <!-- / BOXED AREA -->

</div>
        </lightning:layoutItem>
    </lightning:layout>
</aura:component>
I can include an external resource in my component and it will work in salesforce. However it does not work when using the component in "lightning out".

For example. This is the correct way to include a static resource javascript library. 
<ltng:require scripts="{!$Resource.FileSaver_js_zip + '/FileSaver.js-master/FileSaver.js'}" />

works just fine in salesforce.

using this component in "Lightning out". I get the error due to trying to pull in the static resource on the 'origin host' rather that my salefsorce org.

aura_proddebug.js:15863 GET https://{origin_host}/resource/1481801758000/FileSaver_js_zip/FileSaver.js-master/FileSaver.js 404 (Not Found)


Is there a work-around? If not this will be very limiting.