• Samir Meshram
  • NEWBIE
  • 40 Points
  • Member since 2020

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 10
    Replies
I am trying to handle a event fired from lightning web component which is inside aura component, but i am getting below error:

ed.lightning.force.com/lightning/n/modules/c/meetingRoom.js:75:14

here is the code:

MeetingRoomAura.cmp

<aura:component implements="flexipage:availableForAllPageTypes">
    <aura:attribute name="meetingRoomInfo" type="List" />
    <aura:attribute name="selectedMeetingRoom" type="String" />
    <aura:handler name="init" value="{!this}" action="{!c.doInit}" />
    <lightning:card title="Meeting Rooms">
        <lightning:layout>
            <lightning:layoutItem size="4" padding="around-small">
                <ul>
                    <aura:iteration items="{!v.meetingRoomInfo}" var="item">
                        <li style="padding: 10px">
                            <c:meetingRoom meetingRoomInfo="{#item}" showRoomInfo="true" ontileclick="{!c.handleTileClick}"></c:meetingRoom>
                        </li>
                    </aura:iteration>
                </ul>
            </lightning:layoutItem>
            <lightning:layoutItem size="8" padding="around-small">
                You have selected : {!v.selectedMeetingRoom}
            </lightning:layoutItem>
        </lightning:layout>
    </lightning:card>
</aura:component>

MeetingRoomAuraController.js
({
    doInit : function(component, event, helper) {
        component.set("v.meetingRoomInfo", [
            {'roomName':'A-01', 'roomCapacity':'12'},
            {'roomName':'A-02', 'roomCapacity':'16'},
            {'roomName':'A-03', 'roomCapacity':'12'},
            {'roomName':'B-01', 'roomCapacity':'5'},
            {'roomName':'B-02', 'roomCapacity':'8'},
            {'roomName':'B-03', 'roomCapacity':'10'},
            {'roomName':'C-01', 'roomCapacity':'20'}
    
        ]);
    },
    handleTileClick : function(component, event, helper) {
        component.set("v.selectedMeetingRoom", event.detail.roomName;
    }
})

meetingRoom.html

<template>
    <template if:true={showRoomInfo}>
        <div class="slds-p-around_medium lgc-bg" onclick={tileClickHandler}>
            <lightning-tile label={meetingRoomInfo.roomName} href="/path/to/somewhere">
                <p class="slds-truncate" title={meetingRoomInfo.roomCapacity}>Room Capacity:
                    {meetingRoomInfo.roomCapacity}</p>
            </lightning-tile>
        </div>
    </template>
</template>

meetingRoom.js


import { LightningElement, api, wire } from 'lwc';
import {fireEvent} from 'c/pubsub';
import { CurrentPageReference } from 'lightning/navigation';
export default class MeetingRoom extends LightningElement {
    @api meetingRoomInfo = {roomName:'A-01', roomCapacity:'12'}
    @api showRoomInfo = false;
    @wire(CurrentPageReference) pageReference;    
    tileClickHandler(){
        const tileClicked = new CustomEvent('tileclick', {detail : this.meetingRoomInfo, bubbles :true});
        this.dispatchEvent(tileClicked);
        fireEvent(this.pageReference, 'pubsubtileclick', this.meetingRoomInfo);
    }
}

Someone please help me with this.
Hi Everyone,
 
can anyone suggest trigger which will be on case object to auto populate a contact Name in Case object.
While creating new case if user entered Phone number in custom Phone field named 'IB-Caller-Id', and that  phone number matches with any of the Contact's Phone number.
 
Thanks in advance.
Samir
 
Hi Everyone,
Is it possible to set default stage when we try to create new opportunity manualy, instead of 'None' in stage field can we have first stage as default there?
Hello evryone,
I have requirement like, in opportunity you cant not close a oppo to closed won untill you attach a file in attachment, after that there is a one field Signed__c you have to check that field, as soon as your file is attached and your Signed__c is checked, the opportunity should attomatically moved to closed won, i have written this trigger, but it is not working,

trigger AttachmentValidate on Opportunity (before update,before Insert, after insert, after update) {
    
    public boolean noAttachment = false;
    for(Opportunity o:Trigger.New)    
        
    {
        //ContentDocument a = new ContentDocument();
        if(o.StageName == 'Closed won')
        {
            try{
                ContentDocumentLink CDL = [SELECT ContentDocumentId,Id,IsDeleted,LinkedEntityId FROM ContentDocumentLink where LinkedEntityId =: o.Id];
                  system.debug('cdl :'+CDL);
                //  system.debug('count :'+CDL);
            }
            catch(exception e)
            {
                noAttachment = true;
            }
            if (noAttachment == true){
                o.addError('Add a MSA/SOW file in Notes and Attachment before you close the Opportunity as  Closed Won');
                  system.debug('noAttachment :'+noAttachment);
            }
            else if(o.Signed__c == false){
           o.addError('Please Check the Signed MSA/SOW attached checkbox');
                system.debug('o.Signed__c :'+o.Signed__c);
            }
            else{
                system.debug('hi');
            }
           
        }
    }
}

Please help me out on this, thanks
Hello Evryone, 
We have requirement like, whenever we attche a file or document in particular opportunity, that opprtunity stage should be automatically updated to closed/won.
Please help me on this if anybody has any idea about it.

Thanks
Hello Everyone,
Anybody have any idea on Yeastar Linkus integration with salesforce.?
My quetion is ,
In terms of integration with Yeastar, would  people use the phone app built into Salesforce with the back-end calls routed through  Yeastar VoIP phone system? Similarly, would calls coming into the Yeastar numbers ring on the Salesforce voice app?

Thanks.
one of our client has a requirement, that they want to use Social customer Services to turn instgram direct messages to case?  How can we achieve that? Please share your opinion, even it is possible or  not, if yes then please help me to achieve it

Thanks.
Hi Everyone,
 
can anyone suggest trigger which will be on case object to auto populate a contact Name in Case object.
While creating new case if user entered Phone number in custom Phone field named 'IB-Caller-Id', and that  phone number matches with any of the Contact's Phone number.
 
Thanks in advance.
Samir
 
Hello evryone,
I have requirement like, in opportunity you cant not close a oppo to closed won untill you attach a file in attachment, after that there is a one field Signed__c you have to check that field, as soon as your file is attached and your Signed__c is checked, the opportunity should attomatically moved to closed won, i have written this trigger, but it is not working,

trigger AttachmentValidate on Opportunity (before update,before Insert, after insert, after update) {
    
    public boolean noAttachment = false;
    for(Opportunity o:Trigger.New)    
        
    {
        //ContentDocument a = new ContentDocument();
        if(o.StageName == 'Closed won')
        {
            try{
                ContentDocumentLink CDL = [SELECT ContentDocumentId,Id,IsDeleted,LinkedEntityId FROM ContentDocumentLink where LinkedEntityId =: o.Id];
                  system.debug('cdl :'+CDL);
                //  system.debug('count :'+CDL);
            }
            catch(exception e)
            {
                noAttachment = true;
            }
            if (noAttachment == true){
                o.addError('Add a MSA/SOW file in Notes and Attachment before you close the Opportunity as  Closed Won');
                  system.debug('noAttachment :'+noAttachment);
            }
            else if(o.Signed__c == false){
           o.addError('Please Check the Signed MSA/SOW attached checkbox');
                system.debug('o.Signed__c :'+o.Signed__c);
            }
            else{
                system.debug('hi');
            }
           
        }
    }
}

Please help me out on this, thanks
Hello Evryone, 
We have requirement like, whenever we attche a file or document in particular opportunity, that opprtunity stage should be automatically updated to closed/won.
Please help me on this if anybody has any idea about it.

Thanks
I am trying to handle a event fired from lightning web component which is inside aura component, but i am getting below error:

ed.lightning.force.com/lightning/n/modules/c/meetingRoom.js:75:14

here is the code:

MeetingRoomAura.cmp

<aura:component implements="flexipage:availableForAllPageTypes">
    <aura:attribute name="meetingRoomInfo" type="List" />
    <aura:attribute name="selectedMeetingRoom" type="String" />
    <aura:handler name="init" value="{!this}" action="{!c.doInit}" />
    <lightning:card title="Meeting Rooms">
        <lightning:layout>
            <lightning:layoutItem size="4" padding="around-small">
                <ul>
                    <aura:iteration items="{!v.meetingRoomInfo}" var="item">
                        <li style="padding: 10px">
                            <c:meetingRoom meetingRoomInfo="{#item}" showRoomInfo="true" ontileclick="{!c.handleTileClick}"></c:meetingRoom>
                        </li>
                    </aura:iteration>
                </ul>
            </lightning:layoutItem>
            <lightning:layoutItem size="8" padding="around-small">
                You have selected : {!v.selectedMeetingRoom}
            </lightning:layoutItem>
        </lightning:layout>
    </lightning:card>
</aura:component>

MeetingRoomAuraController.js
({
    doInit : function(component, event, helper) {
        component.set("v.meetingRoomInfo", [
            {'roomName':'A-01', 'roomCapacity':'12'},
            {'roomName':'A-02', 'roomCapacity':'16'},
            {'roomName':'A-03', 'roomCapacity':'12'},
            {'roomName':'B-01', 'roomCapacity':'5'},
            {'roomName':'B-02', 'roomCapacity':'8'},
            {'roomName':'B-03', 'roomCapacity':'10'},
            {'roomName':'C-01', 'roomCapacity':'20'}
    
        ]);
    },
    handleTileClick : function(component, event, helper) {
        component.set("v.selectedMeetingRoom", event.detail.roomName;
    }
})

meetingRoom.html

<template>
    <template if:true={showRoomInfo}>
        <div class="slds-p-around_medium lgc-bg" onclick={tileClickHandler}>
            <lightning-tile label={meetingRoomInfo.roomName} href="/path/to/somewhere">
                <p class="slds-truncate" title={meetingRoomInfo.roomCapacity}>Room Capacity:
                    {meetingRoomInfo.roomCapacity}</p>
            </lightning-tile>
        </div>
    </template>
</template>

meetingRoom.js


import { LightningElement, api, wire } from 'lwc';
import {fireEvent} from 'c/pubsub';
import { CurrentPageReference } from 'lightning/navigation';
export default class MeetingRoom extends LightningElement {
    @api meetingRoomInfo = {roomName:'A-01', roomCapacity:'12'}
    @api showRoomInfo = false;
    @wire(CurrentPageReference) pageReference;    
    tileClickHandler(){
        const tileClicked = new CustomEvent('tileclick', {detail : this.meetingRoomInfo, bubbles :true});
        this.dispatchEvent(tileClicked);
        fireEvent(this.pageReference, 'pubsubtileclick', this.meetingRoomInfo);
    }
}

Someone please help me with this.