+ Start a Discussion
Matt HendersonMatt Henderson 
Hello Salesforce experts,

We are attempting to perform what should be an extremely simple relationship query in SOQL.  

Essentially, we are querying the "OpportunitySplit" object and attempting to obtain the firstname and lastname from the User object.  It appears that there is a child relationship from user to the opportunitySplit object, so I am assuming that this should work without too much trouble.  

The SQL that we are attempting to run is as follows:  

SELECT
 OpportunitySplit.SplitOwnerId
,OpportunitySplit.SplitAmount
,user.FirstName
,user.LastName
 
 FROM
    OpportunitySplit



This is resulting in an error stating "Failed to execute query successfully, error message was: INVALID_FIELD: ,user.FirstName.  Error at Row:4:Column2.  Didn't understand relationship 'user' in field path.  If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name."

Any insight on the best / easiest way to do this would be very appreciated.  

Thanks so much for your assistance!  

MSH
Best Answer chosen by Matt Henderson
Raj VRaj V
Select OpportunitySplit.SplitOwnerId,OpportunitySplit.SplitAmount,SplitOwner.FirstName ,SplitOwner.LastName FROM OpportunitySplit

 
Prema -Prema - 
Because in my current company they told me that they would be hiring for Developers now m doing kind of consultant jobs, everytime calling with clients. So please let me know from where i should prepare and crack the interview which would happen on Thursday.
Thanks a lot in advance.
SKollcakuSKollcaku 
Hi,

Maybe this is an already question, but I did not find the right one:
how can I know the user limits I can create in SFDC for a Salesforce edition license (Enterprise, Professional, etc)?

Thanks a lot,
Skender
Best Answer chosen by SKollcaku
Vinod ChoudharyVinod Choudhary
Hi Skollcaku,

Personal:  1
Contact Manager: 5 
Group Edition: 10 
Professional Edition: Unlimited
Enterprise Edition: Unlimited
Unlimited and Performance Edition: Unlimited
Developer Edition: 2


https://resources.docs.salesforce.com/206/latest/en-us/sfdc/pdf/salesforce_app_limits_cheatsheet.pdf
https://help.salesforce.com/articleView?id=overview_limits_general.htm&type=5

Thanks
Vinod
Best Answer chosen by Raghavendra M 13
piyush_sonipiyush_soni
HI Raghavendra, i have simmler sample for your requirement try this one :

apex class :
public class OpportunitybyOwnerbasedontotal{
    
    @AuraEnabled
    public static List<wrapper> getopps() {
        map<string,wrapper> mapOwnerWiseWrapper = new map<string,wrapper>();
        List<wrapper> lstWrapper = new List<wrapper>();
        List<opportunity> oppList = [select id,Name,Amount,owner.Id,owner.Name from opportunity LIMIT 100];
        
        
        for(opportunity opp : oppList){
             wrapper oWrap = new wrapper();
              if(mapOwnerWiseWrapper.containsKey(opp.owner.Id)){
                oWrap = mapOwnerWiseWrapper.get(opp.owner.Id);
              }
                       
              integer oppSize = 0;
               if(oWrap.oppTotal != null){
                 oppSize += oWrap.oppTotal;    
               }
            
              decimal oppAmountTotal = 0;
               if(oWrap.amountTotal != null){
                oppAmountTotal += oWrap.amountTotal;    
               }
            
              if(opp.Amount != null){
                oppAmountTotal += opp.Amount;  
              }   
           
              oppSize ++;
            
            List<opportunity> lstOppWithOwner = new List<opportunity>();
             if(oWrap.lstOpp != null){
                lstOppWithOwner = oWrap.lstOpp;
             }
              
             lstOppWithOwner.add(opp);
            
             oWrap.ownerName = opp.owner.Name;
             oWrap.oppTotal = oppSize;
             oWrap.amountTotal = oppAmountTotal;
             oWrap.lstOpp = lstOppWithOwner;
            
            //lstWrapper.add(oWrap);
            mapOwnerWiseWrapper.put(opp.owner.Id, oWrap);
        }
        
        return  mapOwnerWiseWrapper.values(); 
    }
    
    public class wrapper{
        @AuraEnabled public List<Opportunity> lstOpp{get;set;}
        @AuraEnabled public String ownerName{get;set;}
        @AuraEnabled public String ownerId{get;set;}
        @AuraEnabled public decimal amountTotal{get;set;}
        @AuraEnabled public Integer oppTotal{get;set;}
    }
    
}
LC :
<aura:component controller="OpportunitybyOwnerbasedontotal" implements="flexipage:availableForAllPageTypes,force:appHostable" access="global">
    <aura:handler name="init" value="{!this}" action="{!c.myAction}"/>
    <aura:attribute name="opportunities" type="Opportunity[]"/>
    <aura:attribute name="opportunitiesbByowner" type="Opportunity[]"/>
    
    <aura:attribute name="wraperOpportunitiesbByowner" type="List"/>
    
    <div class="slds-box" style="background:rgb(0, 161, 223);font-weight:bold;font-size:15pt;">
        <p>Opportunities Totals by Owner</p>
    </div><br/>
    
    
    <table class="slds-table slds-table--bordered slds-table--striped slds-table--cell-buffer slds-table--fixed-layout">
        <thead>
            <tr>
                <th scope="col">
                    <div class="slds-truncate" title="Owner" style="font-weight:bold;font-size:12pt;">
                        Owner
                    </div>
                </th>
                <th scope="col">
                    <div class="slds-truncate" title="Number of Opportunities" style="font-weight:bold;font-size:12pt;text-align:center;">
                        Number of Opportunities
                    </div>
                </th>
                <th scope="col">
                    <div class="slds-truncate" title="Opportunity Total by Owner" style="font-weight:bold;font-size:12pt;text-align:center;">
                        Opportunity Total by Owner
                    </div>
                </th>
            </tr>
        </thead>
        <tbody> 
            <aura:iteration items="{!v.wraperOpportunitiesbByowner}" var="oWrapper">
                <tr>
                    <td><div class="slds-truncate" title="{!oWrapper.ownerName}"><a><ui:outputText click="{!c.Clicked}" title="{!oWrapper.ownerName}" value="{!oWrapper.ownerName}" /></a></div></td>
                    <td style="text-align:center"><div class="slds-truncate" title="{!oWrapper.oppTotal}">{!oWrapper.oppTotal}</div></td>
                    <td style="text-align:center"><div class="slds-truncate" title="{!oWrapper.amountTotal}"><ui:outputNumber value="{!oWrapper.amountTotal}" format='$###,###,###.00'/></div></td>  
                </tr>
                <tr>      
                    <table style="width:300%" class="slds-table slds-table--bordered slds-table--striped slds-table--cell-buffer slds-table--fixed-layout">
                        <thead >  
                            <tr style="background-color:red">
                                <th scope="col" style="background-color: #E6E6FA">
                                    <div class="slds-truncate" title="Name" style="font-weight:bold;font-size:12pt;text-align:center;">
                                        Name
                                    </div>
                                </th>
                                <th scope="col" style="background-color: #E6E6FA">
                                    <div class="slds-truncate" title="Stage" style="font-weight:bold;font-size:12pt;text-align:center;">
                                        Stage
                                    </div>
                                </th>
                                <th scope="col" style="background-color: #E6E6FA">
                                    <div class="slds-truncate" title="Amount" style="font-weight:bold;font-size:12pt;text-align:center;">
                                        Amount
                                    </div>
                                </th>
                                <th scope="col" style="background-color: #E6E6FA">
                                    <div class="slds-truncate" title="Closed Date" style="font-weight:bold;font-size:12pt;text-align:center;">
                                        Closed Date
                                    </div>
                                </th>
                                
                            </tr>
                            
                        </thead>
                        <tbody>
                            <aura:iteration items="{!oWrapper.lstOpp}" var="opp">
                                <tr>
                                    <td><div class="slds-truncate">{!opp.Name}</div></td>
                                    <td style="text-align:center"><div class="slds-truncate" title="{!opp.StageName}">{!opp.StageName}</div></td>
                                    <td style="text-align:center"><div class="slds-truncate" title="{!opp.Amount}">{!opp.Amount}</div></td>
                                    <td style="text-align:center"><div class="slds-truncate" title="{!opp.CloseDate}">{!opp.CloseDate}</div></td>
                                </tr>
                            </aura:iteration>
                        </tbody>
                    </table>
                </tr>
            </aura:iteration>   
        </tbody>
    </table>
    
    <div>
        
    </div> 
</aura:component>
javaScript controller :
({
	myAction : function(component, event, helper) {
		var action = component.get("c.getopps");
        console.log('The action value is: '+action);
         action.setCallback(this, function(a){ 
             
            component.set("v.wraperOpportunitiesbByowner", a.getReturnValue());
            console.log('The opps are :'+JSON.stringify(a.getReturnValue()));
          
        });
        $A.enqueueAction(action);
	},
    Clicked : function(component, event, helper){
        var ctarget = event.getSource().get("v.title");
        console.log(ctarget);
        var action = component.get("c.getOpportunityRecords");
         action.setParams({ ownerId :  ctarget});
         action.setCallback(this, function(response) {
            var state = response.getState(); //Checking response status
            console.log("opportunities... "+JSON.stringify(response.getReturnValue()));
            if (component.isValid() && state === "SUCCESS")
                component.set("v.opportunitiesbByowner", response.getReturnValue());  // Adding values in Aura attribute variable.   
        });
        $A.enqueueAction(action);
    }
})
Hopes it will helps you, let us know if it helps you
Thanks
http://sfdcmonkey.com



 
naveen reddy 68naveen reddy 68 
I have created a visual force page  with two tabs for the same object fields.
when i click on the button it must go to second tabs.

Here is my code:

<apex:page standardController="product_Development__c" extensions="HistoryPageController">
<apex:form >

<apex:pageblock title="VF Page Tabs" >
<apex:tabPanel id="theTabPanel" value="{!tabOpt}" >
<apex:tab label="Basic Info">
<b>Name:</b><apex:inputField value="{!product_Development__c.name}"/><br/>
<b>closed Date:</b>
<apex:inputField value="{!product_Development__c.Policy_Name__c}"/>
<br/>
<b>Education Requirement:</b><apex:inputField value="{!product_Development__c.Policy_Name__c}"/><br/>
<apex:commandButton value="Go to Two" action="{!switch}" rerender="theTabPanel"/>
</apex:tab>
<apex:tab label="DetailPage">
<b>Apex:</b><apex:inputField value="{!product_Development__c.product_Id__c  }"/><br/>
<b>Max_Pay:</b>
<apex:inputField value="{!product_Development__c.product_Id__c}"/>
<br/>
<b>Min_Payt:</b><apex:inputField value="{!product_Development__c.product_Id__c}"/><br/>
</apex:tab>
</apex:tabPanel>
</apex:pageblock>
  </apex:form>

</apex:page>

apex class:
public class HistoryPageController
{
    public String tabOpt {get;set;}
    private ApexPages.StandardController controller;

    public HistoryPageController(ApexPages.StandardController controller)
    {
    this.controller = controller;
    }
      
    
    public void switch()
    {
        tabOpt = 'DetailPage';
    }
}
 here the button is created and it not switching the second  tab.
Please help me.
Best Answer chosen by naveen reddy 68
Sohan Raj GuptaSohan Raj Gupta
Hi Naveen,

You can use below code:
 
public class HistoryPageController
{
    public String tabOpt {get;set;}
    private ApexPages.StandardController controller;

    public HistoryPageController(ApexPages.StandardController controller)
    {
    this.controller = controller;
     selectedTab = 'tab1';
    }
      
   
    
    private string selectedtab;

  public boolean getistab1disabled() {
    return selectedTab <> 'tab1';
  }

  public boolean getistab2disabled() {
    return selectedTab <> 'tab2';
  }

  public void Previous() {
    selectedtab = 'tab1';
  }

  public void Next() {
    selectedtab = 'tab2';
  }

  public string getselectedtab() {
     return selectedtab;
  }
}
 
<apex:page standardController="product_Development__c" extensions="HistoryPageController">
    <apex:form >
        <apex:pageblock title="VF Page Tabs" >
            <apex:tabPanel id="theTabPanel" value="{!tabOpt}" selectedTab="{!selectedTab}" >
                <apex:tab label="Basic Info" id="tab1" disabled="{!istab1disabled}">
                    <b>Name:</b><br/>
                    <b>closed Date:</b>
                    
                    <br/>
                    <b>Education Requirement:</b><br/>
                    <apex:commandButton value="Next" action="{!Next}" rerender="theTabPanel"/>
                </apex:tab>
                
                <apex:tab label="DetailPage" id="tab2" disabled="{!istab2disabled}">
                    <b>Apex:</b><br/>
                    <b>Max_Pay:</b>
                    
                    <br/>
                    <b>Min_Payt:</b><br/>
                    <apex:commandButton value="Previous" action="{!Previous}" rerender="theTabPanel" />
                </apex:tab>
            </apex:tabPanel>
        </apex:pageblock>    
    </apex:form>

</apex:page>

Hope this will help you.

Please let me know if it helped or you need any more assistance.

Please mark this is as the solution if it solved your purpose.

Thanks,
Sohan Raj Gupta
Su Wang 3Su Wang 3 
Learning Salesforce DX, have downloaded the DreamHouse project from gitHub site, made a new branch of my own.  Then, in the Unit of "Create and Test Our Scratch Org", at the beginning, it says "Enter cat config/project-scratch-def.json" to see some of the options available. When I did this in the command line, I got "cat not recognized as an internal or external command".  Online articles say that "cat" is a Unix code, can't be used in Windows system.  Now, my question is what should I use in Windows?

Thanks!
Best Answer chosen by Su Wang 3
Dev_AryaDev_Arya
Use windows powershell.  WIndows 7 afterwards, it comes along with the windows.

Hope this helps. Please dont ask me about SFDX bcz i am myself struggling with the sfdx setup. :-P
Erin Evarts 13Erin Evarts 13 
I am trying to exclude an Opportunity Type picklist value when calculating a commission.
My formula is:
IF (NOT(ISPICKVAL(Type, 'Flooring')))
   Total_Amount_Invoiced__c >= 5000.00,
   500.00,
    0.00)
If the Total Amount Invoiced >= 5000.00 for all Opportunity types EXCEPT 'Flooring', return 500.00, if not >=5000.00, return 0.00.


IF ( 
Total_Amount_Invoiced__c >= 5000.00, 
500.00, 
0.00) 
works but need to exclude 'Flooring' and I am stuck. 
 
Best Answer chosen by Erin Evarts 13
@anilbathula@@anilbathula@
Hi Erin,

There was a extra brace after flooring,Now removed that try this code :-
IF (AND(NOT(ISPICKVAL(Type, 'Flooring')),
   Total_Amount_Invoiced__c >= 5000.00),
   500.00,
    0.00)

Thanks
Anil.B
Karen Brown 39Karen Brown 39 
When I add a date field to a visualforce page and its an input field the calendar automatically opens even if a date is already populated, and this means users have to click out of the date field to see the other fields for data entry.  I tested if the first input field in the section is not a date field and this works, but many of our sections start with date fields... 

User-added image

 
Best Answer chosen by Karen Brown 39
Ryan GreeneRyan Greene
This is a common issue and I don't know of a good fix other than not using Date fields as the first field on a page. Whenever a Date field is the first field (top left) the calendar will always automatically open. If you can move it over or down this will solve your problem.
Karen Brown 39Karen Brown 39 
Hi,

I am using visualforce to make opportunity page sections tabular in lightning, I have a field that in in a 1 column page section in classic but when I add to the visualforce page as a 1 cloumn section with this 1 field only the placement is not left allinged.

Here is the code for the page block, what do i need to add to allign it to the left?

<apex:pageBlockSection title="Scheme Outline" columns="1"> <apex:outputField value="{!opportunity.Summary_Scheme_Calc_SF__c}"/> </apex:pageBlockSection>

I want it to be all the way to the left.
User-added image
Best Answer chosen by Karen Brown 39
Sohan Raj GuptaSohan Raj Gupta
Hi Karen,

Can you give complete code? If not just try style="float:left" attribute in outputfield.

Thanks,
Sohan Raj Gupta
basha skbasha sk 
            Hi All,

            I'm trying to filter the below mentioned response like below please check it once

              Map<String,String> customsettingValues = new Map<String,String>();
              Map<String,String> SelectedValues = new Map<String,String>();
              Set<String> orderList1 = new Set<String>();
              for(String firstKey : customsettingValues.keySet()){                     
                  String firstValue = customsettingValues.get(firstKey);                    
                for(String secondKey : SelectedValues.keySet()){                      
                    String secondValue = SelectedValues.get(secondKey);                      
                       if(firstValue.equals(secondKey)){
                            
                           orderList1.add(secondValue);
                           System.debug('orderList1:::---------'+orderList1);
                                                                    
                  }
                }
              }

            I got the Response Like below for the above code

            orderList1:::---------{chandra}
            orderList1:::---------{chandraiii@gmail.com,chandra}
            orderList1:::---------{Not Attended,chandraiii@gmail.com,chandra}
            orderList1:::---------{vizag,Not Attended,chandraiii@gmail.com,chandra}
            orderList1:::---------{ap,vizag,Not Attended,chandraiii@gmail.com,chandra}
            orderList1:::---------{Ind,ap,vizag,Not Attended,chandraiii@gmail.com,chandra}
            orderList1:::---------{88888888888,Ind,ap,vizag,Not Attended,chandraiii@gmail.com,chandra}

            How to change above response like below

            orderList1:::---------{chandra}
            orderList1:::---------{chandraiii@gmail.com}
            orderList1:::---------{Not Attended}
            orderList1:::---------{vizag}
            orderList1:::---------{ap}
            orderList1:::---------{Ind}
            orderList1:::---------{88888888888}

            If anybody having idea please let me know

            Thanks In Advance
            Basha
Best Answer chosen by basha sk
Sohan Raj GuptaSohan Raj Gupta
Hi Basha,

Try below update code:
 
Map<String,String> customsettingValues = new Map<String,String>();
        Map<String,String> SelectedValues = new Map<String,String>();
        Set<String> orderList1 = new Set<String>();
        
        for(String firstKey : customsettingValues.keySet()){                     
            String firstValue = customsettingValues.get(firstKey);
            
            if(SelectedValues.containsKey(firstValue)){
                System.debug('orderList1:::---------'+SelectedValues.get(firstValue));
            }
        }

I hope this will help you.

Thanks,
Sohan Raj Gupta