• PatMcClellan__c
  • NEWBIE
  • 235 Points
  • Member since 2017
  • Proton 7 Grouop

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 38
    Replies
I have a Platform Event trigger in my managed package. For some reason, it generated an error on a customer's sandbox, and now it's in error state and won't run.
I updated the trigger and pushed the new managed package to this org, but the trigger still shows error state.
The docs say "To resume processing of new event messages, fix and save the trigger."... but this is a managed package, so there's no way to open/save the trigger to reset things. Not sure how to proceed...
I created a Platform Event in my scratch org. When I try to pull it into source, I get the error:
ERROR:  Cannot retrieve translation for object:[my platform event name].
Translation is not enabled on the scratch org, and I don't need it.

I tried to .forceignore it, no-go. I can't pull the other things from my scratch org in that I need. I don't know where/how to fix this in the scratch org. I'm stuck...  
I need to send a push notification to Salesforce1 users when a new record is created (tied to a parent object owned by the respective user.) This should be easy with Process Builder Post to Chatter, or with and APEX trigger that creates a FeedItem record.

The challenge is that the new record the triggers the whole process is created by an incoming REST call, so the createdBy field on those records shows up as [MySiteName] Site Guest User. I have a trigger that fires on the new record insertion, and I need it to create a Chatter Post to notify the appropriate user of the new record. However, because the Context User for the new record is the Site Guest User, they don't have access rights to create the Chatter Post (FeedItem).
 
I know others have already proposed adding a "post as System" capability for Chatter, and I've upvoted the idea. In the meantime, what's a workaround? I've tried Process Builder Post to Chatter, I've tried posting to a group rather than a specific profile, I've tried APEX, I've tried runAs() -- that only works for Test methods, I've tried setting the CreatedById. All result in the same error because of the context user and lack of privileges.
 
What I'm trying to accomplish is Push Notification to Salesforce1 users, and posting to their Chatter profile seemed to be the best tact, but I'm open to other tactics if there are other routes to the push notification. Any ideas?

#pushNotifications #Salesforce1 
I'm trying to understand the efficiencies of Lightning Data Service versus using APEX. I DO understand that many people have a phobia regarding APEX, but I don't, so that's not a benefit to me. I'm really asking about things like performance (responsiveness), demands on the server, governor limits, etc.

Here's a specific example:
I'm building a Lightning Component (list.cmp) that iterates through 20 message__c records, using a tile.cmp to display 5 fields from message__c on each of the record tiles in the scrollable list. I can accomplish this 2 ways.
  1. listController calls APEX, returning a list<message__c>  of the 20 records with 5 fields per record. I aura:iterate through the list, passing a message__c object as the parameter. The tile.cmp receives the full message__c object and builds the tile. Or...
  2. listController calls APEX, returning a list of message__c Id numbers. I aura:iterate through the list passing only the recordId to tile.cmp, which uses force:recordData to pull the record data using LDS, then builds the tile.
Either way, I have to do a SOQL query, but in the second instance, I'm just pulling recordIds. I do understand that if those same message__c records are displayed in other components on the page, that changes in one place will be automatically reflected elsewhere, but for this example, that's not the case. Just viewing the data in this one place. So this is strictly a question about performace.

I have actually already built this using the first method and it works fine, but I'm really trying to drink the LDS Kool-Aid and use it wherever it makes sense. I just need more info to understand whether it makes sense.

Same question for saving a new record via LDS vs APEX. Is LDS faster? easier on the server? better with regard to governor limits?
 
I know LDS only connects to one record at a time, but is that per component?
I want to use LDS on custom (parent) component ConversationDisplay to access a conversation__c record, and use LDS to create a new Message__c record from my (child) MessageEntry component that is included in Conversation Display. Possible?
I'm using LDS to create a new record -- it's a simple one field input. After input, the record is saved and the init handler for the component runs again, clearing out my {!v.Message} attribute -- I have verified that this new record is "empty". However, when I enter a new message, it is overwriting the previously saved record instead of creating a new record.

Do I need to do a full reload (instead of a refreshView) of the component to get a fresh new record? If so, the docs are not clear on that process (see code below). Specifically, does this go in the Controller for the component I'm refreshing? If so, then what's the 'c.myController' reference? 
refresh : function(component, event, helper) {
    var action = cmp.get('c.myController');
    action.setCallback(cmp,
        function(response) {
            var state = response.getState();
            if (state === 'SUCCESS'){
                $A.get('e.force:refreshView').fire();
            } else {
                 //do something
            }
        }
    );
    $A.enqueueAction(action);
}

 
I'm seeking more info on lightning:input for use in a Lightning Component.

What I want to do is have the input text field submit when the user presses the Enter key. However, the Enter key seems to be ignored by lightning:input. Also, I can't even retrieve the keycode with my handler.

component markup:
                  <lightning:input aura:id="body"
                                         label=""
                                         name="Body"
                                         placeholder="Enter message..."
                                         value="{!v.Message.Body__c}"
                                         onchange="{!c.keyCheck}"/>

                    </lightning:layoutItem>
And my keyCheck handler:
keyCheck: function(component, event, helper){
        console.log(event.getParams('keyCode')); 
        }
The handler is getting called, but the value is undefined. I think it's undefined because the event that is happening is NOT the keypress/keyDown/keyUp, but rather the input field is changing. But lightning:input chokes (won't compile) if I try to add a keyDown event in its parameters in the markup.

BTW, I've tried doing this with ui:inputText as well, and that doesn't work either.

Help please?

 

I'm building a Lightning Component that includes a ui:scrollerWrapper, containing an aura:iteration. I want the scroller to default scrollTo the bottom. 

I found this documentation: https://developer.salesforce.com/docs/atlas.en-us.208.0.lightning.meta/lightning/aura_compref_ui_scrollerWrapper.htm? that lists the Methods, including scrollTo(destination) where destination is a string with options "top", "bottom", "left" and "right".  But I can't figure out where to put that method.

My component markup:
 

<ui:scrollerWrapper class="scrollerSize" aura:Id="scroller">

        <aura:iteration items="{!v.messages}" var="message">
            <c:MessageTile message="{!message}" inits="{!v.conversation.GroupInits__c}"/>
        </aura:iteration>

    </ui:scrollerWrapper>
My css:
.THIS.scrollerSize {
    height: 400px;
}
I tried this in the doInit handler:
var scroller = component.find("scroller");
scroller.scrollTo('bottom');
But it doesn't work.

Advice?

 
Cross-posting here from the Trailhead forum, where I'm working on the Lightning Components Framework SuperBadge. We're implementing LDS on a page, but NOT using force:hasRecordId. Instead, we're dynamically setting an aura:attribute, and then referencing it in the LDS parameter for recordId. I've been researching this for hours, but all the reference docs and Trailhead modules assume the case where you're using the implicit recordId on the page. No examples I can find where they're setting the recordId and then forcing the reload.

In this case, the id attribute is successfully being set, but LDS isn't loading the record. The error message says: The onBoatSelected handler in the BoatDetails controller must force Lightning Data Service to load the specified record, using logic in the controller.

In the controller, I'm using a reloadRecord command: component.find("service").reloadRecord() where "service" is the aura:id for the force:recordData element.

Is there some other command required to get the LDS to load the record?

Here's the component markup with the force:recordData info:
<aura:attribute name="id" type="String"/>
    <aura:attribute name="boat" type="Boat__c"/>
    <aura:attribute name="boatSimple" type="Boat__c"/>
    <aura:attribute name="recordError" type="String"/>

    <aura:handler event="c:BoatSelected" action="{!c.onBoatSelected}"/>

    <force:recordData aura:id="service"
                      recordId="{!v.id}"
                      mode="VIEW"
                      fields=  "Id,
                                Name,
                                Description__c,
                                Price__c, Length__c,
                                Contact__r.Name,
                                Contact__r.Email,
                                Contact__r.HomePhone,
                                BoatType__r.Name,
                                Picture__c"
                      targetRecord="{!v.boat}"
                      targetFields="{!v.boatSimple}"
                      targetError="{!v.recordError}"
                      recordUpdated="{!c.onRecordUpdated}" />
Am I screwing up something in the markup? 

 
How to delete a target property from config elements from lwc.

for exx:
 <targetConfigs>
        <targetConfig targets="lightningCommunity__Default">
            <property name="recordId" type="String" label="Record ID" default="{!recordId}"  description="The value should be {!recordId}."/>
         <property name="objectApiName" type="String" label="Object Name" description="Automatically bind the page's object name to the component variable"
            default="{!objectApiName}" />
        </targetConfig>
    </targetConfigs>

i want to delete property objectApiName but when i remove code or delete from community page and publish that then also it return me errot that i can delete a config property,
I have a Platform Event trigger in my managed package. For some reason, it generated an error on a customer's sandbox, and now it's in error state and won't run.
I updated the trigger and pushed the new managed package to this org, but the trigger still shows error state.
The docs say "To resume processing of new event messages, fix and save the trigger."... but this is a managed package, so there's no way to open/save the trigger to reset things. Not sure how to proceed...
Hi all,

I am trying to use lightning:fileUpload in my lightning page and I am getting an error saying can't upload while uploading the file..

Component:

<aura:component implements="force:lightningQuickAction,flexipage:availableForAllPageTypes" access = "global">
    
    <aura:attribute name="displayedSection" type="string" default=""/>
    <aura:attribute name="accept" type="List" default="['.jpg', '.jpeg']"/>
    <aura:attribute name="multiple" type="Boolean" default="true"/>
    <aura:attribute name="disabled" type="Boolean" default="false"/>
    <br></br>
    <br></br>
    <br></br>
    <aura:attribute name="options" type="List" default="[
                                                        {'label': 'Cash Claim', 'value': '0127F000000EPoKQAW'},
                                                        {'label': 'Cell Phone Claim', 'value': '0127F000000EPoUQAW'},
                                                        {'label': 'Broadband Claim', 'value': '0127F000000EPoPQAW'},
                                                        {'label': 'Petrol &amp; Driver Claim Phone', 'value': '0127F000000EPoZQAW'}]"/>
    <aura:attribute name="value" type="String"/>
    <div class="slds-box">
        <div aura:id="firstsection" class="{!if(v.displayedSection == '','slds-show','slds-hide')}">
            <lightning:radioGroup name="radioGroup"
                                  label="Claim Record Type"
                                  options="{! v.options }"
                                  value="{! v.value }"
                                  type="radio"
                                  onclick= "{!c.displaySection2}"/>
        </div>
    <br><br>
        </br></br>    
    
    <div aura:id="secondsection" class="{!if(v.displayedSection == 'secondsection','slds-show','slds-hide')}">
        <lightning:recordEditForm aura:id="recordViewForm" recordTypeId="{!v.value}" objectApiName="Claim_Request__c"> 
            <lightning:messages />  
            
            
            <lightning:inputField fieldName="Claim_Amount__c" required = "true" />
            <lightning:inputField fieldName="Claim_Month__c" required = "true" />
            <lightning:inputField fieldName="Claim_Year__c" required = "true"/>
            <lightning:inputField fieldName="Description__c" />
            <lightning:inputField fieldName="Phone_Number__c" default = "In case of cell phone claim"/>
            <lightning:inputField fieldName="Broadband_Number__c"  default = "In case of broadband claim" />
            
            <lightning:button aura:id="submit" type="submit" label="Create Claim" class="slds-m-top_medium" onclick = "{!c.showSuccessToast}" /> 
            
        </lightning:recordEditForm>        

        <lightning:fileUpload label="Add attachment" multiple="{!v.multiple}" 
                          accept="{!v.accept}" recordId="{!v.value}" 
                          onuploadfinished="{!c.handleUploadFinished}" />
        
        
    </div>
</div>
</aura:component>

controller: 

({
    displaySection1 : function(component, event, helper) {
        component.set("v.displayedSection","firstsection");
        var action = component.find("v.value");
    },
 
    displaySection2 : function(component, event, helper) {
        var action = component.get("v.value");
        //action.setParams({
        //    "ID": component.get("v.recordId")          
        //})
        //component.find("firstsection");
        ///component.set("v.displayedSection","section1");
        component.set("v.displayedSection","secondsection");
        console.log("Claim Request has been submitted");
        
    },
    
    handleUploadFinished : function(component, event, helper) {
        var uploadedFiles = event.getParam("files");
        var documentId = uploadedFiles[0].documentId;
        var fileName = uploadedFiles[0].name;
        var toastEvent = $A.get("e.force:showToast");
        toastEvent.setParams({
            "title": "Success!",
            "message": "File "+fileName+" Uploaded successfully."
        });
        toastEvent.fire();
        
        $A.get('e.lightning:openFiles').fire({
            recordIds: [documentId]
        });
        
    },
    
    showSuccessToast : function(component,event,helper)
    {
        var newClaimRequest = {'objectApiName' : 'claim_request__c', 
                               'claim_amount__c' : '', 
                               'claim_month__c' : '',
                               'claim_year__c' : '',
                               'claim_description__c' : '',
                               'Phone_Number__c' : '',
                               'Broadband_Number__c' : ''
                              };
        //resetting the Values in the form
        component.set("v.recordViewForm",newClaimRequest); 
        
        var toastEvent = $A.get("e.force:showToast");
        toastEvent.setParams({
            "title": "Success!",
            "message": "claim request has been successfully submitted"
        });
        toastEvent.fire();
    }  
});

please help, tried a lot and not able to identify what's missing.
I created a Platform Event in my scratch org. When I try to pull it into source, I get the error:
ERROR:  Cannot retrieve translation for object:[my platform event name].
Translation is not enabled on the scratch org, and I don't need it.

I tried to .forceignore it, no-go. I can't pull the other things from my scratch org in that I need. I don't know where/how to fix this in the scratch org. I'm stuck...  
Hi All,
I would like to send push notifications to salesforce mobile app given by salesforce.
I looked into the documentation by salesforce, but couldn't succeed.

I have created the trigger given in the below link
 https://developer.salesforce.com/docs/atlas.en-us.pushImplGuide.meta/pushImplGuide/pns_apex_trigger.htm.
I have also configure the connected App as suggested in the below link:
https://developer.salesforce.com/docs/atlas.en-us.pushImplGuide.meta/pushImplGuide/pns_create_connected_app_android.htm
I have turned on the push notification settings in my developer org.
 
Any help on how to proceed further will be much appreciated.
Thanks

I'm building a Lightning Component that includes a ui:scrollerWrapper, containing an aura:iteration. I want the scroller to default scrollTo the bottom. 

I found this documentation: https://developer.salesforce.com/docs/atlas.en-us.208.0.lightning.meta/lightning/aura_compref_ui_scrollerWrapper.htm? that lists the Methods, including scrollTo(destination) where destination is a string with options "top", "bottom", "left" and "right".  But I can't figure out where to put that method.

My component markup:
 

<ui:scrollerWrapper class="scrollerSize" aura:Id="scroller">

        <aura:iteration items="{!v.messages}" var="message">
            <c:MessageTile message="{!message}" inits="{!v.conversation.GroupInits__c}"/>
        </aura:iteration>

    </ui:scrollerWrapper>
My css:
.THIS.scrollerSize {
    height: 400px;
}
I tried this in the doInit handler:
var scroller = component.find("scroller");
scroller.scrollTo('bottom');
But it doesn't work.

Advice?

 

Hi!

I receive this error message : Challenge Not yet complete... here's what's wrong: 
Lincoln Ulrich cannot set up and execute marketing campaigns to his accounts.  

I probed adding permission set, set to marketing user, set to system admin but I have the same issue.

  • October 18, 2017
  • Like
  • 1
I know its open ended question but I researched a lot to figure out the solution for the same but I didn't find the any concrete solution. I am stuck with an issue of sending push notification to Salesforce1 App through customization functionality of Salesforce. On the update of a particular field of Case object which defines the severity of Case created, I want to send the push notification to few related users.

I have gone through the documentation "Salesforce Mobile Push Notifications Implementation Guide" but it seems its more related to sending the push notification to Salesforce1 app from other applications. But I am looking for a solution to send push notification from salesforce.com to Salesforce1 app.

Any help??

Thanks in advance!!
I am trying to connect to a Push Topic via the Salesforce Streaming API using Python. My application completes the initial handshake correctly, but then fails on the following connect call, with the error: "403::Unknown client".

My messages work as follows:

Handshake Request
{
    "channel":"/meta/handshake",
    "id":"1",
    "supportedConnectionTypes":["long-polling"],
    "version":"1.0",
    "minimumVersion":"1.0"
}
Handshake Response
{
    "channel":"/meta/handshake",
    "clientId":"xxx",
    "version":"1.0",
    "successful":true,
    "minimumVersion":"1.0",
    "id":"1",
    "supportedConnectionTypes":["long-polling"]
}
It's completed the handshake fine. And then...
Connect Request
{
    "channel":"/meta/connect",
    "clientId":"xxx",
    "id":"2",            
    "connectionType":"long-polling"
}
Connect Response
{
    "channel":"/meta/connect",
    "clientId":"xxx",
    "advice":{
        "reconnect":"handshake",
        "interval":500
    },
    "error":"403::Unknown client",
    "successful":false,
    "id":"2"
}
I have seen this issue here:
https://success.salesforce.com/issues_view?id=a1p30000000T0F0AAK

And read through the documentation, including:
http://www.salesforce.com/developer/docs/api_streaming/Content/DebuggingStreamingAPIApplications.htm

After reading this however, I am no closer to determining what the actual fault or problem is, or how to remedy it.

I have tried a lot of different things and am at a loss at how to get it to work. I am using this Bayeux client library https://github.com/dkmadigan/python-bayeux-client, with some custom amendments to get the authentication working.

Any help would be greatly appreciated.