• Eran Vizel
  • NEWBIE
  • 15 Points
  • Member since 2014
  • CRM Architect
  • Perfecto Mobile

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 19
    Questions
  • 12
    Replies
I'm building a custom wizard in a Lightning compnent, and using a modal to confirm before submit.
I'm trying to make the modal appear in fade (similarly to the out of the box modals), but it doesn't seem to work although I'm working with the fade blueprint from SLDS.

This is my code, please advise?

<aura:component implements="flexipage:availableForAllPageTypes,force:hasRecordId" access="global" controller="SDR_Meeting_Controller">
    
    <aura:attribute name="isValuable" type="Boolean" default="false" />
    <aura:attribute name="currentEvent" type="Event" default="{ 'sobjectType': 'Event' }"/>
    <aura:attribute name="isExistingOpp" type="Boolean" default="false"/>
    <aura:attribute name="showActionRequiredCard" type="Boolean" default="true"/>
    <aura:attribute name="isOpen" type="boolean" default="false"/>
    
    <aura:handler name="init" action="{!c.init}" value="{!this}"/>
    
    <aura:if isTrue="{!v.showActionRequiredCard}">
        
        <lightning:card iconName="action:log_event">
            
            <aura:set attribute="title">
                Action Required
            </aura:set>
            
            <aura:set attribute="actions">
                <lightning:button label="Submit" type="submit" onclick="{!c.openModal}" variant="brand"/>
            </aura:set>
            
            <p class="slds-p-horizontal_small">
                
                <b><ui:outputText value="{!'This SDR Meeting is complete.'}"/></b><br/><br/>
                <ui:outputText value="{!'Name: '+ v.currentEvent.Who.Name}"/><br/>
                <ui:outputText value="Company: "/><br/>  
                <ui:outputText value="Meeting Date: "/><ui:outputDate value="{!v.currentEvent.SDR_Meeting_Completed__c}"/><br/><br/>

              <div class="demo-only slds-size_1-of-2">
                    <div class="slds-form-element">
                        
                        <label class="slds-checkbox_toggle slds-grid">
                            
                            <b><span class="slds-form-element__label slds-m-bottom_none">Was this meeting valuable?</span></b>
                            <ui:inputCheckbox aura:id="thebox" change="{!c.handleCheck}"/>
                            <span id="checkbox-toggle-2" class="slds-checkbox_faux_container" aria-live="assertive">
                                <span class="slds-checkbox_faux"></span>
                                <span class="slds-checkbox_on">Valuable</span>
                                <span class="slds-checkbox_off">Not Valuable</span>
                            </span>
                        </label>
                    </div>
                </div>
                <br/>
                <ui:outputText value="SDR Meeting Feedback Reason: "/>
                <force:inputField value="{!v.currentEvent.SDR_Meeting_Feedback_Reason__c}" change="{!c.handleOpp}"/><br/>
                
                <aura:renderif isTrue="{!v.isExistingOpp}">
                    
                    <aura:set attribute="body">
                        <ui:outputText value="Select Existing Opportunity: "/>
                        <force:inputField value="{!v.currentEvent.Opportunity__c}"/>
                        <br/> 
                    </aura:set>         
                </aura:renderif> 
                
            <ui:outputText value="Comments: "/>
                <force:inputField value="{!v.currentEvent.Description}"/><br/>
                
            </p>
   
        </lightning:card>
    </aura:if>
  
    <aura:if isTrue="{!v.isOpen}">
      
<div class="demo-only" style="height: 640px;">
  <section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open">
    <div class="slds-modal__container">
      <header class="slds-modal__header">
                        <lightning:buttonIcon iconName="utility:close"
                                              onclick="{!c.closeModal}"
                                              alternativeText="close"
                                              variant="bare-inverse"
                                              class="slds-modal__close"/>
                        <h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate">Confirmation</h2>
                    </header>
      <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1">
       Are you sure you want to submit this SDR Meeting?
      </div>
      <footer class="slds-modal__footer">
        <lightning:button variant="neutral" label="Cancel" onclick="{! c.closeModal }"/>
        <lightning:button variant="brand" label="OK" onclick="{! c.handleClick }"/>

      </footer>
    </div>
  </section>
  <div class="slds-backdrop slds-backdrop_open"></div>
</div>
        
</aura:if>    
</aura:component>
Hi all,

Is it possible to create a chatter component that displays the feed only of a particular group?
Couldn't find anything but the standard component and the <forceChatter:feed> component which doesn't seem to be able to display just a speicifc group taken as parameter. Please advise?
I wrote a trigger that runs upon creation of a case. The trigger goes to the parent account, fetches any Account Contact Roles that are named as "Case Auto CC", and creates coresponding Case Contact Roles.
This runs fine by any internal user or by integration user, but when a Customer Community user tries to open a case, this piece fails with the exception of : System.QueryException: No such column 'AccountId' on entity 'AccountContactRole'.

map<Id, Account> map_Accounts = new map<Id, Account>([SELECT Id,
                                                                         (Select ContactId, Role
                                                                          From AccountContactRoles
                                                                          Where Role = 'Case Auto CC')
                                                                  FROM Account
                                                                  WHERE Id in :accountIds]);

I suspect it has to do with the portal user permissions. However I've given the portal profiles both Read and Edit permissions for account object (Since I believe AccountContactRole inherits its permissions from Account), and opened account as public read/write in the OWD, still this exceptions presists. 

Any idea why?

Many thanks,
Eran
Hi,

I'm looking for a way to fetch the currently active case milestone's remaining time, and bring it to the case level in order to present in the list view, integrate into Jira, etc.
Since they won't let build triggers on CaseMilestone object, what's the best alternative way to achieve what I'm trying to do?

Many thanks,
Eran
Hi all,

We have a customer community based on Visualforce (custom made case page).
I was trying to embbed a few drag & drop attachment apps in the page to improve the user experience, but each one had some sort of incompitability to Visualforce / external page. 

Anyone knows a drag & drop app that would fit for this scenario? Or independent way to develop it for that matter?

Many thanks,
Eran
Hi all,

I'd like to prevent certain cases from coming in, and also notify the user about that.
Before insert trigger with AddError to prevent the case creation, also prevents the Messaging.SingleEmailMessage from being sent for some reason. Tried to run the message sending in a @future method, did not work either. Anybody has any idea or advice?

Thank you,
Eran
Hi all,

What could be the reason that a pageblock button is visible internally, but becomes invisible when posting the visualforce page on external sites.com?

Many thanks,
Eran
Hi all,

I'm building a class that implements Support.MilestoneTriggerTimeCalculator - as I want to put in a few milestones with dynamic time calculation. The tricky part - I want the calculation to base on constant time defined in other milestones of this entitlement process. Within the class I can obviously access the case and the entitlement in context, but I don't see how can I reach the entitlement process behind this case and entitlement, in order to get to its other milestone and grab the integers for the dynamic calculation of my dynamic milestones.

I ran into an object called SLAProcess which I think is the entitlement process, but the workbench doesn't show it has any child relationship with milestones.

Please advise,
Many thanks,
Eran
Hi,

When trying to add our production environment to Eclipse force.com API, I'm running into a error (See screenshot). Never encountered this and have no idea what it means. Anyone knows? Please advise.

Many thanks,
Eran

User-added image

 
Hi all,

I want to notify ownership change of a lead from owner in a certain group of roles to an owner withhin another group of roles. For this I created this not very scalable workflow: 

ISCHANGED( Lead_Owner_Role__c ) && 

( PRIORVALUE(Lead_Owner_Role__c ) = "VP_Business_Development" 
|| PRIORVALUE(Lead_Owner_Role__c ) = "Director_Business_Development" || PRIORVALUE(Lead_Owner_Role__c ) = "Enablement_Manager" || PRIORVALUE(Lead_Owner_Role__c ) = "Technology_Partners" || PRIORVALUE(Lead_Owner_Role__c ) = "Channel_Sales_Manager" ) 

&& 

( Lead_Owner_Role__c = "APAC_Sales_Director" || Lead_Owner_Role__c = "APAC_Sales_Representitive" || Lead_Owner_Role__c = "Eastern_Region_Sales_Director" || Lead_Owner_Role__c = "East_Region_Sales_Representitve" || Lead_Owner_Role__c = "South_Eastern_Sales_Director" || Lead_Owner_Role__c = "South_Eastern_Sales_Representitive" || Lead_Owner_Role__c = "TriState_Eastern_Sales_Director" || Lead_Owner_Role__c = "TrisState_Eastern_Sales_Representative" || Lead_Owner_Role__c = "EMEA_Sales_Director" || Lead_Owner_Role__c = "EMEA_Sales_Representitive" || Lead_Owner_Role__c = "Midwest_Canada_Region_Sales_Director" || Lead_Owner_Role__c = "Canada_Sales_Director" || Lead_Owner_Role__c = "Canada_Sales_Representative" || Lead_Owner_Role__c = "Midwest_Canada_Region_Sales_Representitive" || Lead_Owner_Role__c = "Midwest_Region_Sales_Representative" || Lead_Owner_Role__c = "South_Central_Region_Sales_Director" || Lead_Owner_Role__c = "South_Central_Region_Sales_Representative" || Lead_Owner_Role__c = "Telecommunications_Sales_Manager" || Lead_Owner_Role__c = "Western_Region_Sales_Director" || Lead_Owner_Role__c = "Western_Region_Sales_Representitve")

Is there a better way to do it?

Thank you,
Eran
Hi,

How to I attch a VF email template attachment that will be received as a JPG?
Tried this and the received file is corrupt.

<messaging:attachment filename="SpecialistAutomationIcon.jpg" >

<apex:image value="url('{!$Resource.Specialist_Automation_Cert_Icon}'"/>

</messaging:attachment>

Please advise,

Thanks,
Eran

Hi,

I'm trying to embed a pic within a Visualforce email template. The pic is taken from the Documents using this tag:

<apex:image value="https://perfectomobile--sandbox--c.cs8.content.force.com/servlet/servlet.FileDownload?file=015L0000000AsEM"/>

However, when I send a test email, this picture link just shows as broken:

Broken Image Link

The image doc is defined as "Available for External Use".

Please advise,
Thank you,
Eran

 

Hi,

I have a complicated assignment rule for cases which I use a before trigger to assign the case to.
I also use case assignment rules.
Problem is, I want the apex rule to be stronger than the assginment rules, yet the order of execution is triggers before assignment rules.

I try to put a condition in the validation rule saying current owner name should not be the one given in the apex trigger, in order to obey this assignment rule.
However it doesn't work. Could it be that the value put within the trigger is still not commited to the database at the assignment rule stage, thus does not get filtered?

Thank you,
Eran
Hi,

If I put 2 triggers on same object, and they both set to run on same event (before insert), how can I tell and/or decide which one of them will run first?

Thank you,
Eran
Hi guys,

Question regarding the new duplicate management. I'm trying to place a trigger on creation of DuplicateRecordSet, so that whenever there's a dupe match between account and lead, some code will run. Problem is I want to query and look on specific fields on DuplicateRecordItem only whenever it's connected to lead. The field "record" on DuplicateRecordItem is polymorphic and can be lookup to any existing object in the system. Therefore, when I try to query something like record.Related_Account__c (Related_Account__c is a field we have on Lead), it's not recognized and I cannot save the code.
Salesforce support says the TYPEOF function is not operable in production environments, so that's not a solution.

Please advise,
Many thanks,
Eran
Hi,

It is possible to create a trigger on OpportunityTeamMember objecy. However, I want to automate creation of coresponding Opportunity Splits on creation of OpportunityTeamMember. Correct me if I'm wrong, but it seems like the event in which an opportunity is created or updated with a new owner, and therefore a new OpportunityTeamMember is created for the new owner and all his default opportunity team (if exist) automatically, is not an action recognized as INSERT of OpportunityTeamMember, therefore does not fire the insert trigger.

Is this correct?

Thank you,
Eran

Hi,

I try to embbed a pretty simple bars chart on Visualforce, with 2 grouped bars per each X axis point (dates).

Problem: the last column set on the X axis is always being "cut" and displays only one of the bars. However, if I expand the X axis dates range, and make it wider, it will show fine.
See attached image and code.

What coould be the cause?

Many thanks,
Eran

User-added image


<apex:page controller="VF_OpenVsClosedCasesChartController" docType="html-5.0">
<apex:form >
<br/>
    <apex:pageBlock rendered="{!showSelection}">
    <apex:pageblockButtons >
    <apex:commandButton value="Submit" action="{!submit}"/>
    </apex:pageblockButtons>
   
    <apex:outputtext value="Enter Start Date: " style="font-weight: bold;"/> &nbsp;&nbsp;&nbsp;&nbsp;
    <apex:input type="date" value="{!beginDate}"/>
    <br/><br/>
    <apex:outputtext value="Enter End Date: " style="font-weight: bold;"/> &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;
    <apex:input type="date" value="{!endDate}"/>
    <br/><br/><br/>
    <apex:pageMessages />
    
    
    </apex:pageBlock>

  <apex:chart height="400" width="1500" data="{!allData}" legend="true" background="#F8F8F8" rendered="{!showChart}">
  <apex:legend position="right"/>
          <apex:axis type="Numeric" position="left" fields="openAmount,closeAmount" 
            title="Cases Opened / Closed" grid="true"/>
          <apex:axis type="Category" position="bottom" fields="dateLabel" 
            title="Date" gridFill="true">
        </apex:axis>
        <apex:BarSeries axis="left" orientation="vertical" xField="dateLabel" yField="openAmount,closeAmount" title="Cases Opened,Cases Closed"/>
   </apex:chart>
   </apex:form>
</apex:page>

Hi,

Lately our Case database seemed to have grown so much, that we started getting the excpetion for every Case update attempt:

caused by: System.QueryException: Non-selective query against large object type (more than 100000 rows). Consider an indexed filter or contact salesforce.com about custom indexing.
Even if a field is indexed a filter might still not be selective when:
1. The filter value includes null (for instance binding with a list that contains null) 2. Data skew exists whereby the number of matching rows is very large (for instance, filtering for a particular foreign key value that occurs many times)


This is the query that triggers this exception:

Map<Id, Case> map_Cases = new Map<Id, Case>([SELECT Id, Account.Renewal_Date__c FROM Case WHERE AccountId != null and AccountId in :set_AccountIds]);

Is AccountId on Case already indexed? If not, can I ask Salesforce support to do it? Will it resolve the problem? And if not, can you think of any other solution? I don't see how I can optimize this query anymore.

Thank you,
Eran
Hi all,

I'm trying to create a simple Customer Community login page on visualforce. Following the basic template given, I don't want the user to select his own password but receive an email with a random password for starters.

if ([SELECT Id FROM Contact WHERE Email = :email].size() > 0)
  {
   Contact existingCon = [SELECT Id, Account.Id FROM Contact WHERE Email = :email];
  
   String profileId = '00eD0000001PmG2'; // To be filled in by customer.
         //String roleEnum = null; // To be filled in by customer.
         String accountId = '0012000000OtpOj'; // To be filled in by customer.
        
         String userName = email;

         User u = new User();
         u.Username = userName;
         u.Email = email;
         u.FirstName = firstName;
         u.LastName = lastName;
         u.CommunityNickname = communityNickname;
         u.ProfileId = profileId;
   
   
   String userId = Site.createPortalUser(u, existingCon.Account.Id, null, true);
  
   ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.CONFIRM, 'Registration successful. Please check your email for password confirmation');
            ApexPages.addMessage(msg);
  
   return null;
  
  }


The user is being created and associated with the existing conact. However no password is being sent, although documentation on Site.createPortalSite states if a password is not send through the method (third parameter - null) and the boolean value is set to send a new member email (fourth parameter - true), an email is suppoused to be sent automatically.
Nothing is received. Please advise.

Thanks,
Eran
Hi all,

Is it possible to create a chatter component that displays the feed only of a particular group?
Couldn't find anything but the standard component and the <forceChatter:feed> component which doesn't seem to be able to display just a speicifc group taken as parameter. Please advise?
Hi all,

I'm trying to create a simple Customer Community login page on visualforce. Following the basic template given, I don't want the user to select his own password but receive an email with a random password for starters.

if ([SELECT Id FROM Contact WHERE Email = :email].size() > 0)
  {
   Contact existingCon = [SELECT Id, Account.Id FROM Contact WHERE Email = :email];
  
   String profileId = '00eD0000001PmG2'; // To be filled in by customer.
         //String roleEnum = null; // To be filled in by customer.
         String accountId = '0012000000OtpOj'; // To be filled in by customer.
        
         String userName = email;

         User u = new User();
         u.Username = userName;
         u.Email = email;
         u.FirstName = firstName;
         u.LastName = lastName;
         u.CommunityNickname = communityNickname;
         u.ProfileId = profileId;
   
   
   String userId = Site.createPortalUser(u, existingCon.Account.Id, null, true);
  
   ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.CONFIRM, 'Registration successful. Please check your email for password confirmation');
            ApexPages.addMessage(msg);
  
   return null;
  
  }


The user is being created and associated with the existing conact. However no password is being sent, although documentation on Site.createPortalSite states if a password is not send through the method (third parameter - null) and the boolean value is set to send a new member email (fourth parameter - true), an email is suppoused to be sent automatically.
Nothing is received. Please advise.

Thanks,
Eran
I'm building a custom wizard in a Lightning compnent, and using a modal to confirm before submit.
I'm trying to make the modal appear in fade (similarly to the out of the box modals), but it doesn't seem to work although I'm working with the fade blueprint from SLDS.

This is my code, please advise?

<aura:component implements="flexipage:availableForAllPageTypes,force:hasRecordId" access="global" controller="SDR_Meeting_Controller">
    
    <aura:attribute name="isValuable" type="Boolean" default="false" />
    <aura:attribute name="currentEvent" type="Event" default="{ 'sobjectType': 'Event' }"/>
    <aura:attribute name="isExistingOpp" type="Boolean" default="false"/>
    <aura:attribute name="showActionRequiredCard" type="Boolean" default="true"/>
    <aura:attribute name="isOpen" type="boolean" default="false"/>
    
    <aura:handler name="init" action="{!c.init}" value="{!this}"/>
    
    <aura:if isTrue="{!v.showActionRequiredCard}">
        
        <lightning:card iconName="action:log_event">
            
            <aura:set attribute="title">
                Action Required
            </aura:set>
            
            <aura:set attribute="actions">
                <lightning:button label="Submit" type="submit" onclick="{!c.openModal}" variant="brand"/>
            </aura:set>
            
            <p class="slds-p-horizontal_small">
                
                <b><ui:outputText value="{!'This SDR Meeting is complete.'}"/></b><br/><br/>
                <ui:outputText value="{!'Name: '+ v.currentEvent.Who.Name}"/><br/>
                <ui:outputText value="Company: "/><br/>  
                <ui:outputText value="Meeting Date: "/><ui:outputDate value="{!v.currentEvent.SDR_Meeting_Completed__c}"/><br/><br/>

              <div class="demo-only slds-size_1-of-2">
                    <div class="slds-form-element">
                        
                        <label class="slds-checkbox_toggle slds-grid">
                            
                            <b><span class="slds-form-element__label slds-m-bottom_none">Was this meeting valuable?</span></b>
                            <ui:inputCheckbox aura:id="thebox" change="{!c.handleCheck}"/>
                            <span id="checkbox-toggle-2" class="slds-checkbox_faux_container" aria-live="assertive">
                                <span class="slds-checkbox_faux"></span>
                                <span class="slds-checkbox_on">Valuable</span>
                                <span class="slds-checkbox_off">Not Valuable</span>
                            </span>
                        </label>
                    </div>
                </div>
                <br/>
                <ui:outputText value="SDR Meeting Feedback Reason: "/>
                <force:inputField value="{!v.currentEvent.SDR_Meeting_Feedback_Reason__c}" change="{!c.handleOpp}"/><br/>
                
                <aura:renderif isTrue="{!v.isExistingOpp}">
                    
                    <aura:set attribute="body">
                        <ui:outputText value="Select Existing Opportunity: "/>
                        <force:inputField value="{!v.currentEvent.Opportunity__c}"/>
                        <br/> 
                    </aura:set>         
                </aura:renderif> 
                
            <ui:outputText value="Comments: "/>
                <force:inputField value="{!v.currentEvent.Description}"/><br/>
                
            </p>
   
        </lightning:card>
    </aura:if>
  
    <aura:if isTrue="{!v.isOpen}">
      
<div class="demo-only" style="height: 640px;">
  <section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open">
    <div class="slds-modal__container">
      <header class="slds-modal__header">
                        <lightning:buttonIcon iconName="utility:close"
                                              onclick="{!c.closeModal}"
                                              alternativeText="close"
                                              variant="bare-inverse"
                                              class="slds-modal__close"/>
                        <h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate">Confirmation</h2>
                    </header>
      <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1">
       Are you sure you want to submit this SDR Meeting?
      </div>
      <footer class="slds-modal__footer">
        <lightning:button variant="neutral" label="Cancel" onclick="{! c.closeModal }"/>
        <lightning:button variant="brand" label="OK" onclick="{! c.handleClick }"/>

      </footer>
    </div>
  </section>
  <div class="slds-backdrop slds-backdrop_open"></div>
</div>
        
</aura:if>    
</aura:component>
Hi all,

Is it possible to create a chatter component that displays the feed only of a particular group?
Couldn't find anything but the standard component and the <forceChatter:feed> component which doesn't seem to be able to display just a speicifc group taken as parameter. Please advise?
Hi all,

We have a customer community based on Visualforce (custom made case page).
I was trying to embbed a few drag & drop attachment apps in the page to improve the user experience, but each one had some sort of incompitability to Visualforce / external page. 

Anyone knows a drag & drop app that would fit for this scenario? Or independent way to develop it for that matter?

Many thanks,
Eran
Hi all,

I'd like to prevent certain cases from coming in, and also notify the user about that.
Before insert trigger with AddError to prevent the case creation, also prevents the Messaging.SingleEmailMessage from being sent for some reason. Tried to run the message sending in a @future method, did not work either. Anybody has any idea or advice?

Thank you,
Eran
Hi all,

What could be the reason that a pageblock button is visible internally, but becomes invisible when posting the visualforce page on external sites.com?

Many thanks,
Eran
Hi,

When trying to add our production environment to Eclipse force.com API, I'm running into a error (See screenshot). Never encountered this and have no idea what it means. Anyone knows? Please advise.

Many thanks,
Eran

User-added image

 
Hi,

If I put 2 triggers on same object, and they both set to run on same event (before insert), how can I tell and/or decide which one of them will run first?

Thank you,
Eran
Hi,

It is possible to create a trigger on OpportunityTeamMember objecy. However, I want to automate creation of coresponding Opportunity Splits on creation of OpportunityTeamMember. Correct me if I'm wrong, but it seems like the event in which an opportunity is created or updated with a new owner, and therefore a new OpportunityTeamMember is created for the new owner and all his default opportunity team (if exist) automatically, is not an action recognized as INSERT of OpportunityTeamMember, therefore does not fire the insert trigger.

Is this correct?

Thank you,
Eran
Hi,

Lately our Case database seemed to have grown so much, that we started getting the excpetion for every Case update attempt:

caused by: System.QueryException: Non-selective query against large object type (more than 100000 rows). Consider an indexed filter or contact salesforce.com about custom indexing.
Even if a field is indexed a filter might still not be selective when:
1. The filter value includes null (for instance binding with a list that contains null) 2. Data skew exists whereby the number of matching rows is very large (for instance, filtering for a particular foreign key value that occurs many times)


This is the query that triggers this exception:

Map<Id, Case> map_Cases = new Map<Id, Case>([SELECT Id, Account.Renewal_Date__c FROM Case WHERE AccountId != null and AccountId in :set_AccountIds]);

Is AccountId on Case already indexed? If not, can I ask Salesforce support to do it? Will it resolve the problem? And if not, can you think of any other solution? I don't see how I can optimize this query anymore.

Thank you,
Eran