• Angel Z
  • NEWBIE
  • 75 Points
  • Member since 2019

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 13
    Questions
  • 9
    Replies
Hello,

I want to display "New event" next to "New task",

i have added the "New Event" in section ""Quick Actions in the Salesforce Classic Publisher" and "Salesforce Mobile and Lightning Experience Actions"


tst

How can i add event to tab ?
thank you fir suggesion
  • June 12, 2019
  • Like
  • 0
Hello,
We have setup SSO with Azure AD. We have enabled "User native browser for user auithentication on iOS".

When a user wants to logs in, a Chatter agreement pops up which the user has to allow.

The problem is with the logout. The same pop up is shown (Chatter Wants to Use salesforce.com to Sign In) and if "Continue" button is clicked - the user is back logged in to Salesforce. The "Deny" button must be clicked in order to be logged out which is confusing.

Has anyone been able to bypass such scenario?
Hello,

I am displaying sums of different fields based on certain criteria in LWC.

I have a wrapper class which is invoked in the LWC.

How can get the updated data from the LWC without page refresh?
I am not storing the values in fields.

Thanks,
Angel
Hello,

I have a LWC record edit form which updates custom fields on contact.
 
<lightning-record-edit-form  
        record-id={contactrecordid}
        object-api-name="Contact">
        <lightning-messages></lightning-messages>
        <div class="textGeneric">
          <lightning-input-field  data-id="newsletter" onchange={detectCheckboxUpdate} value={customFieldVal} variant="standard" field-name="Custom_Field__c"></lightning-input-field>
        </div>
        <div class="textGeneric">
          <button data-id="formSubmitButton" onclick={updateContactSubscription} class="saveChangesButton" type="submit" name="submit">{labels.saveChanges}</button>
       </lightning-record-edit-form>
 
@api detectCheckboxUpdate(event) {
    this.changeSaved = false;
    switch (event.currentTarget.dataset.id) {
      default:
      case 'customValue1':
      this.newsletterChanged = true;
      break;
    }....
}
it('updates the checkbox', () => {
    const element = createElement('c-lwc', {
      is: lwc
    });
    document.body.appendChild(element);
    getRecordWireAdapter.emit(mockGetRecord);
    const newsletterCheckbox = element.shadowRoot.querySelector('lightning-input-field[data-id="newsletter"]');
    const newslEvent = new CustomEvent('click', { currentTarget: { dataset: { id: 'newsletter' } } });
    element.dispatchEvent(newslEvent);
    element.detectCheckboxUpdate(newslEvent);
    const buttonEl = element.shadowRoot.querySelector('button[data-id="formSubmitButton"]');
    buttonEl.dispatchEvent(new CustomEvent('click'));
    return Promise.resolve().then(() => {
      expect(newsletterCheckbox.value).toBe(false);
    });
  });

I get an error on the switch statement "TypeError: Cannot read property 'dataset' of null"

Any ideas how to fix that?
Thank you!
 
Hello!

I am trying to show/hide text dynamically on window resize but it doesn't work. Here's the code:
 
<template>
     <template if:true={resolutionLessThan768}>
          resolutionLessThan768
     </template>
     <template if:true={resolutionLessThan1280}>
        resolutionLessThan1280
     </template>
     <template if:true={resolutionGreaterThan1280}>
        resolutionGreaterThan1280
     </template>
</template>
export default class lwc extends LightningElement {
    
    resolutionLessThan1280 = false;
    resolutionLessThan768 = false;
    resolutionGreaterThan1280 = false;

    
    pageLayoutChanged(){
        if (window.innerWidth < 768) {
            this.resolutionLessThan768 = true;
        }
        else if (window.innerWidth >= 768 && window.innerWidth < 1280) { 
            this.resolutionLessThan1280 = true;
        }
        else if(window.innerWidth >= 1280) {
            this.resolutionGreaterThan1280 = true;
        }
        
    }

   connectedCallback() {      
        this.pageLayoutChanged();
    }

   renderedCallback() {
        this.pageLayoutChanged();
    }
}


Any ideas what I am missing?

Thanks
Hi all,

I have a vf page with static text which would like to show on a community page. When I'm logged in to the community as myself (admin rights), I can see the text.

However, when I am logged in as a community user, nothing shows up. I've already granted access to the community profile to the vf page.

What do I miss?

Thanks.
Hello, 

We have a js application stored as a static resource. An aura component hosts it and is supposed to show it on a community page.

The data is showing up for administrator, but not for a community user. The access to the static resource has already been setup to "public" and the aura component has global access.

What else can I be missing?

Thanks,
Angel
Hi guys,

I need a piece of advice. I have a LWC which displays records returned from an apex method.

Here's the markup:
<template if:true={customObjectRecords.data}>
    <template for:each={customObjectRecords.data}   for:item="com">
      <div key={com.Id}>
        <p>
          <span>{com.CustomField1__c}</span>
	  <span>{com.CustomField2__c}</span>
        </p>
        <p>
          <span>{com.Name}</span>
	  <span>{com.CustomField3__c}</span>
        </p>
      </div>
    </template>
  </template>
  <template if:true={error}>
    {error}
  </template>
And here's the JS:
 
import { LightningElement, wire, track, api } from 'lwc';
import callApex from '@salesforce/apex/ApexClass.apexMethod';

export default class className extends LightningElement {
  @track customObjectRecords;

  @wire(callApex, {userContactId: 'parameter'})
    
    customObjectRecordsData(data,error) { 
        if(data){
            console.log('Data ====>', JSON.stringify(data));           
            this.customObjectRecords=data;

        } else if(error){
            console.log('error -->'+error);   
        }
    } 
}

How do I access fields of the returned customObjectRecords?

I need to do a check on a custom field for each returned record.

Thanks.

 
Hi all,

I need to display an image from a file to an aura component.

Can someone give me a piece of advice for the img source?

I tried 
<img src="{!'/sfc/servlet.shepherd/version/download/0681w000000iOxfAAE'}" />

However, it does not work.

Thanks,
Angel
Hi All,

I have an attribute:
<aura:attribute name="changeAccountStatus" type="Aura.Component[]" required="false"/>

and a handler:
 
<aura:handler name="change" value="{!v.changeAccountStatus}" action="{!c.statusChanged}"/>

I want to detect when the value has been updated:
 
statusChanged : function(cmp, event, helper) {

      console.log("old value: " + event.getParam("oldValue"));
      console.log("current value: " + event.getParam("value"));

}
However, it never fires the statusChanged method.

Any help would be greatly appreciated.

Thanks,
Angel

 
Hi all,

I have 3 components. Parent, Child and Grandchild.

There's a aura:method on the Child component which invokes an action of the Grandchil.Controller
The Grandchild.Controller's action calls an apex method. 

What's the best way to call the Granchild.Controller's action from the Parent component?

Thanks in advance.
  • September 20, 2019
  • Like
  • 0
Hi All,

I am trying create a lightning component which uses e.force:recordCreate and prepopulates a list of ContactIds in the EventWhoIds field.
 
console.log(component.get("v.contactIds"));
  	
    var contactRecords = component.get("v.contactIds");
        console.log("contactRecords: " + contactRecords);
        
        var createEvent = $A.get("e.force:createRecord");
			createEvent.setParams({
                "entityApiName": "Event",
                "defaultFieldValues": {   
                    'WhatId' : component.get("v.recordId"),
                    'EventWhoIds' : contactRecords
                }
            });
            createEvent.fire();

Here's a screenshot of the console log:

Console logHowever, the contact do not get prepopulated in the form.

Any ideas/suggestions would be greatly appreciated.

Thanks!
Hi all,

I want to use e.force:createRecord to create an event and attach multiple contacts to it.
console.log(component.get("v.contactIds"));
        
        var createEvent = $A.get("e.force:createRecord");
			createEvent.setParams({
                "entityApiName": "Event",
                "defaultFieldValues": {
                    'WhatId' : component.get("v.recordId"),
                    'EventWhoIds' : component.get("v.contactIds")
                }
            });
            createEvent.fire();

It does not work. Any ideas?
Hi all,

I want to invoke a lightning component from a list button.

Everything works fine except if I use "e.force:createRecord".

Here's the error message: 
This page has an error. You might just need to refresh it. Action failed: c:leadCollector$controller$createRecordHelper [Cannot read property 'setParams' of undefined] Failing descriptor: {c:leadCollector$controller$createRecordHelper}

Any piece of advice would be greatly appreciated.
Thanks
Hello,
We have setup SSO with Azure AD. We have enabled "User native browser for user auithentication on iOS".

When a user wants to logs in, a Chatter agreement pops up which the user has to allow.

The problem is with the logout. The same pop up is shown (Chatter Wants to Use salesforce.com to Sign In) and if "Continue" button is clicked - the user is back logged in to Salesforce. The "Deny" button must be clicked in order to be logged out which is confusing.

Has anyone been able to bypass such scenario?
Hi all,

I have a vf page with static text which would like to show on a community page. When I'm logged in to the community as myself (admin rights), I can see the text.

However, when I am logged in as a community user, nothing shows up. I've already granted access to the community profile to the vf page.

What do I miss?

Thanks.
Hello, 

We have a js application stored as a static resource. An aura component hosts it and is supposed to show it on a community page.

The data is showing up for administrator, but not for a community user. The access to the static resource has already been setup to "public" and the aura component has global access.

What else can I be missing?

Thanks,
Angel
Hi guys,

I need a piece of advice. I have a LWC which displays records returned from an apex method.

Here's the markup:
<template if:true={customObjectRecords.data}>
    <template for:each={customObjectRecords.data}   for:item="com">
      <div key={com.Id}>
        <p>
          <span>{com.CustomField1__c}</span>
	  <span>{com.CustomField2__c}</span>
        </p>
        <p>
          <span>{com.Name}</span>
	  <span>{com.CustomField3__c}</span>
        </p>
      </div>
    </template>
  </template>
  <template if:true={error}>
    {error}
  </template>
And here's the JS:
 
import { LightningElement, wire, track, api } from 'lwc';
import callApex from '@salesforce/apex/ApexClass.apexMethod';

export default class className extends LightningElement {
  @track customObjectRecords;

  @wire(callApex, {userContactId: 'parameter'})
    
    customObjectRecordsData(data,error) { 
        if(data){
            console.log('Data ====>', JSON.stringify(data));           
            this.customObjectRecords=data;

        } else if(error){
            console.log('error -->'+error);   
        }
    } 
}

How do I access fields of the returned customObjectRecords?

I need to do a check on a custom field for each returned record.

Thanks.

 
Hi all,

I have 3 components. Parent, Child and Grandchild.

There's a aura:method on the Child component which invokes an action of the Grandchil.Controller
The Grandchild.Controller's action calls an apex method. 

What's the best way to call the Granchild.Controller's action from the Parent component?

Thanks in advance.
  • September 20, 2019
  • Like
  • 0
Hi all,

I want to use e.force:createRecord to create an event and attach multiple contacts to it.
console.log(component.get("v.contactIds"));
        
        var createEvent = $A.get("e.force:createRecord");
			createEvent.setParams({
                "entityApiName": "Event",
                "defaultFieldValues": {
                    'WhatId' : component.get("v.recordId"),
                    'EventWhoIds' : component.get("v.contactIds")
                }
            });
            createEvent.fire();

It does not work. Any ideas?
Hello,

I want to display "New event" next to "New task",

i have added the "New Event" in section ""Quick Actions in the Salesforce Classic Publisher" and "Salesforce Mobile and Lightning Experience Actions"


tst

How can i add event to tab ?
thank you fir suggesion
  • June 12, 2019
  • Like
  • 0