• kaushal sharma 24
  • NEWBIE
  • -4 Points
  • Member since 2020

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

Hi!

In a Community Page, I have a LWC with an handler for message events (I use it to intercept message from an iframe).
The problem is that the handler intercepts an infinite number of message events.

For simplicity, we can consider the following LWC:
HTML

<template>
<div>-- COMPONENT TEST --</div>
<div>-- EVENTS: {counter} --</div>
</template>

JAVASCRIPT

import {LightningElement, track, api, wire} from 'lwc';

export default class Test extends LightningElement {

    counter = 0;

    checkEvent(event) {
        console.log('--> Event: ', event.type);
        this.counter++;
    }

    checkEventBind = this.checkEvent.bind(this);

    connectedCallback() {
        console.log('--> connectedCallback');
        if (window.addEventListener) {
            window.addEventListener("message", this.checkEventBind, true);
        } else {
            window.attachEvent("onmessage", this.checkEventBind);
        }
    }

    disconnectedCallback() {
        window.removeEventListener('message', this.checkEventBind, true);
    }
}

Metadata

<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>47.0</apiVersion>
    <description>Test</description>
    <isExposed>true</isExposed>
    <masterLabel>Test</masterLabel>
    <targets>
        <target>lightningCommunity__Page</target>
        <target>lightningCommunity__Default</target>
        <target>lightning__RecordPage</target>
    </targets>
</LightningComponentBundle>
 

The error occurs when the LWC is on a Community Page with a Flexible Layout. Clicking anywhere on the page generates an infinite number of message events.

The problem seems related to the Flexible Layout because it doesn’t occur if the LWC is on a Community Page with a full-width column layout.

Another example:

  1. I add the LWC on a Community Page with a Flexible Layout and on a Community Page with a full-width column layout
  2. I first open the Page with the Flexible Layout and then the Page with a full-width column layout
  3. Now, clicking anywhere on the Page with the full-width column layout, starts the generation of an infinite number of message events.

How can I solve the problem?
Do I have to avoid Flexible Layout in my Community?

I need to create a left arrow back button and when someone clicks this back button ,it should perform some action. Is there any out of the box functionality of lightning button with left arrow key. Please help me .  Refer the image with the first card.  <        Manage ConsentUser-added image

 
I created a BatchApexErrorEvent Trigger and it is working as expected when the Batch is throwing CPU limit Exception. I am not able to Cover the Trigger with Test Class code. I tried using Test.getEventBus().deliver(); but the Trigger is not covered. 

Please help if anyone has written a Test Class to cover the trigger on BatchApexErrorEvent object. 

Thanks,
Nargis
Can anyone look at this and tell me why this is NOT prompting the validation rule to fire?
The rule says, IF first field = x and the second field = NULL, then fire rule.
 
AND(ISPICKVAL(Sales_Status__c, "Startup (pre-startup meeting)"),
Startup_Meeting_Date__c = NULL)

 
Hi there :)

i'm currently working on an native Android app for my company and ran into some problems with Salesforce lately.

I hope i can find some help here.

What i want to achieve:
The company has a lot of Accounts in Salesforce with 3 important fields for the app: Name, Business (Workshop or Parts Dealer) and location(latitude, longitude)
I would like to show those Accounts(Workshops/Parts Dealers) as markers on a google map in my Android app based on a radius around the user's current location. So it would be more than sufficient to get the data as JSON or XML(i read about sObjects, which would be nice too)

The app will be freely available on Google Play Store and every user should be able to see all the Workshops/Parts dealers around the world.

The problem i'm facing is that i can't find a way to fetch the data inside my app without authenticating every user with a Salesforce-Login. 
Which API is the best to use in this case?

It would be so awsome if anybody could help me with this problem.

What i tried so far: 
- SalesforceMobileSDK: If i extend SalesForceApplication i always end up with the Salesforce-Login Screen.
It seems that every client has to be authenticated for API-calls to work. I tried using the method "peekUnauthenticatedRestClient", but this method only works on full path URL's(e.g. "https://api.spotify.com/v1/search?q=James%20Brown&type=artist"), which isn't really practically for my Use-case.

- I feel like i read nearly all docs about salesforce api, but can't quite get my head around how to solve this problem, although it seems like to be a pretty common use-case.  

- would a salesforce-apex method which would select all records inside a set radius around the user's location be accessable without authentication?

Thanks for your help in advance!

Roman
Error Message:
Challenge Not yet complete... here's what's wrong: 
The AccountTab Visualforce page does not include one or both of the following: the apex:slds tag in the page, or the slds-table value in the table.

Hello all. I am working on the new superbadge and getting stuck on Challenge 3 . I have tried several solutions but cannot get the data to display in table format. Here is my code below, my main issue is where to place the table class in realtion to the pageBlockTable.

<apex:page standardStylesheets="false" standardController="Account" recordSetVar="accounts" tabStyle="account" applyBodyTag="false">
    <apex:slds >
        
        <div class="slds-scope">
             
                <apex:pageBlock>
                    
                    <table class="slds-table"> 
                    <apex:pageBlockTable  value="{!accounts}" var="a">
                       
                        <apex:column headerValue="{!$ObjectType.Account.Fields.Name.Label}">
                            <apex:outputLink value="{!URLFOR($Action.Account.View, a.id)}">{!a.name}</apex:outputLink>
                        </apex:column>
                        
                    </apex:pageBlockTable> 
                    </table>
                    
                </apex:pageBlock>
            
        </div>
    </apex:slds>    
</apex:page>

 
Hi, I'm running into an issue with getting an access token using a connected app with grant_type = password.  Here is my curl script:

curl https://test.salesforce.com/services/oauth2/token -H "Content-Type:application/x-www-form-urlencoded" -d "grant_type=password" -d "client_id=<my client_id>" -d "client_secret=<my client_secret>" -d "username=<myusername@domain.com>" -d "<my password+secret>"

I'm getting an invalid_grant error  "Authentication failure" 
 

Hello Helper

 

I want to export   from an org a package  containing  custom objects,  Custom fields , classes,  custom buttons......

 

I created a package.xml  file where I included  the Metadata  types  I want to export

 

I can not  specify  Custom button Metadata  type

Looking into the salesforce docs it seems to me that is is  considered as weblink

 

I tried  something like  below

 

.....

<types>
<members>Account.CustomButton_1</members>
<members>Account.CustomButton_1</members>
<name>webLinks</name>
</types>

 

 

 

but it does not work

 

any suggestion?

 

 

Thanks in advance

Csaba

 

 

 

 

  • September 22, 2013
  • Like
  • 1