Answers - Salesforce Trailblazer Community
Ask Search:
Brandy FungBrandy Fung 
There are few account record type in the Account object, I want to display different account page layout base on the account record type when the account selected, how can I do it ?
Best Answer chosen by Brandy Fung
Madan Lal BakoliyaMadan Lal Bakoliya
Go to setup > Account > Page layout > Click on Page Layout assignment
 You can pick your desired layout for your recordType for your profiles.

thanks
Amar NijerAmar Nijer 
How do I synchronize my salesforce calendar with google calendar? Is it possible to integrate by any setting present in salesforce or I have to use any application? 
Best Answer chosen by Moderator (salesforce.com) 
Amar NijerAmar Nijer
Thanks Karanraj, I got setting by this link.
http://www.youtube.com/watch?v=8ODqVm4HMA0
Sarah LeeSarah Lee 
Hi everyone,

I need to write a default value formula on a custom date/time field on Opptys. I have a start and end date/time field, and would like the end field to automatically populate with one hour after the start field. I want my users to be able to adjust this as needed, but I want to pre-populate it with the most common duration of meetings. The fields will be used to create a related event record via process builder. 

When I go to build the formula on the end date/time field, I'm only seeing these options, none of which hold the custom start field:
User-added image

What am I missing here?
Best Answer chosen by Sarah Lee
Ahilesh RagavanAhilesh Ragavan
Hi Sarah,
You can't set up the default values like that. Its not possible to reference other fields in a default value.

Default values are populated at the time the form is rendered, to prepopulate the field and save the user some work, and also encourage the right values to be entered. At rendering time there is no data in any other field on the record, so any reference to another field on the same record would always return a blank value. 

You will have to write a workflow rule or process to populate the end date like you need. But this is going to work only after-save.
Ekta GuptaEkta Gupta 
I have to prepare a report for Marketing team and they need few specific fields on that report which I cant see on the report builder.

I am planning to modify the custom Report type used for this report to pull on those new fields.
Does this modification will affect existing reports in any way. I am not sure but some other users might have used this custom report type to build their own reports which I dont want to discturb.
So just need all your advise what should I do in this scenario?
Best Answer chosen by Ekta Gupta
Narender SinghNarender Singh
If you are just adding some extra fields to the report type layout then it's fine, but if you add any child object as secondard object or remove any field from the report type layout then that might impact the existing reports.
Steve BerleySteve Berley 
I'm editing the Account page in the Lightning App Builder and using the List View Component to show Contacts.  This is to both provide a filtered view of contacts and inline editing from within the LV.

I can't figure out how to make the LV Component only show contacts for the current account.  Its showing all contacts regardless of account.

What am I missing?  

Thanks,

Steve
Best Answer chosen by Steve Berley
Deepak K AnandDeepak K Anand
Now, this is going to be a little long. So you will have to bear with me on that.

What's the shortcoming of the ListView Component?
The shortcoming of the ListView Component (the one that you can place on the Record Page Layouts) is that it can ONLY show Filters or Views from an object that are marked as global or shared with all the Users.
 
User-added image
 
This means that if you place a ListView Component on say on the Account's Record Page Layout, you will ONLY be able to select Views or Filters defined on the Contact object that is shared with all the Users.
 
User-added image
 
And moreover, these Views or Filters will have pre-defined criteria. That means you don't really have an option to show Contacts that belongs to the Account in context or so. They are not DYNAMIC.

Creating a Dynamic ListView Filter Criteria for Contact object
So how do we create a ListView filter criteria to be dynamic so that it shows the Contact's belonging to an Account record that is being currently viewed.

So, in the first place, we need some kind of a Formula Field on the Contact object which checks itself to TRUE when the Contact belongs to an Account that is currently being viewed on the screen by a User.

Woah! Now, to accomplish this, when you or a User views an Account, we need to update a place or a field or something within the Salesforce Org saying - "The Account being Viewed by User 'X' is 0016D00000DFnqAQAT".

Now, this place where we will be storing the Id (of the Account record being viewed by User 'X') needs to be accessible in Formula Fields too. Guess why? Because ONLY then, we can write a Formula that says - If the Contact.AccountId equals the Id of the Account Being Viewed Currently, then checked else unchecked.

Now, an only place like this where we can store the Account Id (of the Account record being viewed) per User at the same time accessible in Formula is a Hierarchy based Custom Setting.

So let's create one - 
 
User-added image


Now, the next step is to create the Formula Field on the Contact object - 
 
User-added image
AccountId = LEFT($Setup.Last_Viewed_Account__c.Account_Id__c, 15)
Notice, the Formula. The best thing about Hierarchy based Custom Setting is that you can access them in Formulas like above - $Setup.Last_Viewed_Account__c.Account_Id__c. That's not. The Account Id stored will differ from User to User too. We don't want the ListView to show Contact's of an Account that is currently being viewed by another User. So there will be entries in this Hierarchy based Custom Setting for every single User as and when they view Accounts.

But how will the Account Id be updated into this Hierarchy based Custom Setting as and when each User views an Account? Let's not worry about it now.

Now, let's create the List View - 
User-added image
Note: Don't forget to make it Visible to All Users.
Creating the Lightning Component
This will answer the question - But how will the Account Id be updated into this Hierarchy based Custom Setting as and when each User views an Account?

This tiny Lightning Component will be placed on the Account Record Page and will take care of updating the Custom Setting record for the Current User with the Id of the Account being viewed by him or her. Let's name it - CaptureLastViewedAccount.

Component Markup:
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId" access="global" controller="CaptureLastViewedAccountCtrl">
	<aura:handler name="init" value="{!this}" action="{!c.init}"></aura:handler>
</aura:component>
Component Controller:
({
	init : function(component, event, helper) {
		let action = component.get( "c.captureAccId" );
        
        action.setParams( { accId : component.get( "v.recordId" ) } );
        
        action.setCallback( this, ( response ) => { 
            if( response.getState() === "SUCCESS" && 
            	response.getReturnValue() ) {
            	$A.get( "e.force:refreshView" ).fire();
        	}
        } );
        
        $A.enqueueAction( action );
	}
})
Apex Controller:
public class CaptureLastViewedAccountCtrl {
    @AuraEnabled
    public static Boolean captureAccId( String accId ) {
        Last_Viewed_Account__c lva = Last_Viewed_Account__c.getInstance( UserInfo.getUserId() );
        
        if( lva.Account_Id__c != accId ) {
            lva.SetupOwnerId 	= UserInfo.getUserId();
            lva.Account_Id__c 	= accId;
            
            UPSERT lva Id;

            return true;
        }
        else {
            return false;
        }
    }
}

Setting them all up!
Now, all you have to do is drag and drop the Lightning Component on the Account Record Page.
 
User-added image

Finally, drag and drop the ListView. The most important thing here is to set the View / Filter to the one you created above.
User-added image

I know that was too long and probably you might find it difficult and overwhelming too. That being said, I will create a Package so that you can simply install and the - Formula Field, List View Filter, Lightning Component and the Apex Class w/Unit Tests will all be readily available. You will then just have to place them all on the App Builder.
Pranil SarodePranil Sarode 
Hi,
I'm getting below error, not able to get whats wrong.
1->System.QueryException: List has no rows for assignment to SObject
2-> No such entity PriceBook__c on Account

My code is as below,

 public PageReference addRecord()
   {
        Account acc = [select PriceBook__c from Account where id = :stockReturnRecord.From__c];
        System.Debug('Account PB ' + acc.PriceBook__c);
        
       PricebookEntry[] pbeId = [SELECT Id, UnitPrice FROM PricebookEntry WHERE Pricebook2Id = :acc.PriceBook__c AND Product2Id = :stockReturnItem.Article_Number_PB__c];
        
        PageReference pf=new PageReference('/apex/vfp_StockReturn?id='+this.stockReturnId);
        if (pbeId.size() > 0){
            this.stockReturnItem.Stock_Return__c = this.stockReturnId;
            if(this.stockReturnItem.Amount__c == null)
            {
                this.stockReturnItem.Amount__c = pbeId[0].UnitPrice;
            }
            insert this.stockReturnItem;
            pf.setRedirect(true);
        }else{
            ApexPages.Message msg = new Apexpages.Message(ApexPages.Severity.Error,'Product is not in the Price Book' );
            ApexPages.addmessage(msg);
        }
        
        return pf;
    }
Best Answer chosen by Pranil Sarode
Divya Priya RDivya Priya R
Hello Pranil,

The error "System.QueryException: List has no rows for assignment to SObject" generally occurs when a query returns 0 results.

Now, in the above code, there are two queries ,
 
[select PriceBook__c from Account where id = :stockReturnRecord.From__c]
and
 
[SELECT Id, UnitPrice FROM PricebookEntry WHERE Pricebook2Id = :acc.PriceBook__c AND Product2Id = :stockReturnItem.Article_Number_PB__c]
So first check to do is to verify which query is causing the error list has no rows for assignment. For that, in the query editor, try to run the queries above individually with the hard coded value as follows :
[select PriceBook__c from Account where id = <any account record Id>]
and also check  the other query as follows:
 
[SELECT Id, UnitPrice FROM PricebookEntry WHERE Pricebook2Id = :acc.PriceBook__c AND Product2Id = <Any Product record Id>]
Check if the above queries return any results. If no then that is the issue, there are  no records returned and hence you are receiving the error in apex. To avoid this, make sure the query returns atleast one record.

For the other error, "No such entity PriceBook__c on Account" , make sure the API name of the custom field named PriceBook is same in the account. That could be the issue.

Hope this helps, let me know if you are still facing any issue. I would be glad to help.

Thank you!



 
Dale MendezDale Mendez 
How can I create a tag cloud? See https://appexchange.salesforce.com/listingDetail?listingId=a0N30000000q6w9EAA for an example. This is not like chatters hashtags but like the tag fuction displayed in an more interactive and user friendly way.

User-added image
Best Answer chosen by Dale Mendez
Ashutosh TripathiAshutosh Tripathi
Hi Dale,

I think you need to connect Tableau with salesforce and use Tablead wordcloud.Tableau has a standard one-click connector that links to salesforce and has great features for creating wordcloud.

http://kb.tableau.com/articles/howto/creating-a-word-cloud
https://www.grazitti.com/blog/the-power-of-tableau-and-salesforce-analytics/


Thanks!
Alex Twomey-McLeodAlex Twomey-McLeod 
I am trying to figure out if the new Attendee  functionality on the Event object sends invitiations to Contacts. It seems to do this for Users, but in my testing invite emails are no being sent to Contacts in the Attendee list.

I have followed these (https://help.salesforce.com/articleView?id=customizeactivities_event_invite_lex.htm&type=0) instructions and read this (https://help.salesforce.com/articleView?id=creating_events_lex.htm&type=5) , but nothing in Salesforce Help actually helps and makes this clear. 

Is this functionality actually limited to only sending invites to users and not contacts? Even though it clearly states "Invitations initiated in Lightning Experience and the Salesforce app are emailed to attendees"
Best Answer chosen by Alex Twomey-McLeod
Alex Twomey-McLeodAlex Twomey-McLeod
We figured out the issue. The user which owns the Contact record needs to be active and have an active outlook account, even if they're not sending out the invite
Brad HoldenBrad Holden 
Ok I am sorry for being a complete newbie... I have spent the last year grappling with some very minor Salesforce development (on a part-time basis) for a small non-profit. I have learned a lot, but still have only placed a very tiny scratch on the surface! 
So now our Self-Signed Certificate is apparently expiring and I have NO IDEA what that means. Any googling of this quickly gets into going-over-my-head territory. Can someone please explain what I have to do and what is in danger of happening if I don't do it? Here's the message:

You have one or more certificates in your Salesforce org Tin Roof Global 00D6100000084nr that will expire soon. Review the list below and visit Certificate and Key Management from Setup to make an update.

I have gone to Certificate and Key Management and have downloaded the .crt file but am really unsure what I am supposed to do with it!

Thanks in adavance
Best Answer chosen by Brad Holden
LBK MuthukrishnanLBK Muthukrishnan
Hey Brad,

There are few places where a sefl-signed certificate could be used.

1. Identify Provider - If you are using SFDC as IDP for Single Sign On. You can find it under Setup >> Administer >> Security Controls >> Identity Provider.

2. Single Sign-On Settings - If you are using SFDC as Consumer for Single Sign On. You can find it under Setup >> Administer >> Security Controls >> Single Sign-On Settings.

If your certificate is used in one of the above places, it is quite intuitive to edit this screen and replace the certificate.

3. Installed Packages / Connected Apps.
Some of the third party apps could use your Self-Signed Certificates (Environment Hub is an example).
You can look at them in Setup >> Build >> Installed Packages
I suggest you go through them one at time and find out if they use your certificate.

Connected Apps will be same procedure as above. But you will find the connected apps under Setup >> Manage Apps >> Connected Apps.

Hope this helps.
 
Holly ThompsonHolly Thompson 
I'm getting insufficient permissions for the component: 
Insufficient permissions for Activity component
I can't find any reason why. I thought it was because this can't live alongside Activity History related lists, but I made sure we weren't using those. Now I can't figure out how to display this.
Best Answer chosen by Jayson (salesforce.com) 
Meaghan HarraghyMeaghan Harraghy
Our user switched to Salesforce Classic and then back to Lightening and it worked.