• Robert_Strunk
  • NEWBIE
  • 99 Points
  • Member since 2015
  • Senior Salesforce Developer
  • Coastal Cloud


  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 5
    Likes Given
  • 1
    Questions
  • 42
    Replies
Hi,

I have a apex repeat inside my pageblocktable, and for some reason my header's not showing up inside the repeat.  Any ideas?

Thanks,
 
<apex:page controller="FiscalPivot_Class">
 
    
    <apex:pageblock >
    <apex:pageblocktable value="{!completeRowList}" var="row">
		 <apex:column >
      	  <apex:outputtext >{!row.name}</apex:outputtext>
        </apex:column>
        
        <apex:repeat value="{!row.amountMap}" var="periodYear">
        <apex:column>   
            <apex:facet name="header">{!periodYear}</apex:facet>
            <apex:outputtext value="{0,number,###,###,##0}" ><apex:param value="{!row.amountMap[periodYear]}"/></apex:outputtext> 
            </apex:column>
        </apex:repeat>
        
         <apex:column>
		<apex:facet: name="header">Total</apex:facet:>           
        <apex:outputtext value="{0,number,###,###,##0}" ><apex:param value="{!row.lineTotal}"/></apex:outputtext> 
        </apex:column>
                    
        </apex:pageblocktable>
    </apex:pageblock>
</apex:page>



 
I have a wrapper class for a custom object Referral__c but I need to add the parent object so only the child object display. The purpose for the wrapper class is so when looking at the ClientDetails__c object, a user can delete child records with a check box. I have displayed the child records previously with an extention, but I'm not able to duplicate the functionality with this wrapper class. Can you help?

__________________________________________________
public class ApartmentDeleteWrapperCLs{

public ClientDetails__c CID {get; set;}
public Referral__c Ref {get; set;}

public List<ApartmentRecordCls> accWrapperRecordList {get;set;}

public ApartmentDeleteWrapperCLs(){

//Fetch Referrals
List<Referral__c> accList= new List<Referral__c>();
accWrapperRecordList = new List<ApartmentRecordCls>();
accList = [select id, Apartment__r.Complex_Name__c, Apartment__r.Warning_Image__c, Apartment__r.Phone__c, Apartment__r.Year_Built__c, 
Apartment__r.Submarket__r.Name, Apartment__r.Address__c, Apartment__r.City__c, Apartment__r.State__c, Apartment__r.Zip_Code__c,Apartment__r.Commission_Bonus__c,
Unit__r.Bedrooms__c, Unit__r.Bathrooms__c, Unit__r.Layout__c, Unit__r.Square_Feet__c, Unit__r.Rent__c, Unit__r.CR_6M_Final__c, 
Unit__r.CR_6M_Final_Percent__c, Unit__r.CR_12M_Final__c, Unit__r.CR_12M_Final_Percent__c, Unit__r.Status__c,
ClientDetails__r.ID, ClientDetails__r.Referring_Locator__r.ID, ClientDetails__r.First_Name__c  
from Referral__c WHERE ClientDetails__c = :CID];


//For loop to set data
  if(!accList.isEmpty()) {
    for(Referral__c acc: accList){
     ApartmentRecordCls arcls = new ApartmentRecordCls();
     arcls.isSelected =  false;
     arcls.accObj = acc;
     accWrapperRecordList.add(arcls);
    
    } //end of for loop.
  
  } //end of if condition.
 }
  
  /*
   Delete Apartment functionality based on the selected records.
  */
  public PageReference DeleteApartment(){
   List<Referral__c> accToDelete = new List<Referral__c>();
   //To hold the unselected Apartment records.
   List<ApartmentRecordCls> listUnSelectedRecords  = new List<ApartmentRecordCls>();  
    if(accWrapperRecordList !=null && accWrapperRecordList.size()>0) {
      for(ApartmentRecordCls wrapObj :  accWrapperRecordList){
        if(wrapObj.isSelected == true){
          accToDelete.add(wrapObj.accObj);
        }else{
          listUnSelectedRecords.add(wrapObj);
        }
      
      
      }//end of for.
      /*
       checking the delete list size and assign the unselected values to 
       original wrapper list.
      */
      if(accToDelete !=null && accToDelete.size()>0){
       delete accToDelete;
       accWrapperRecordList.clear();
       accWrapperRecordList.addAll(listUnSelectedRecords);
      }
    
    }else{
     ApexPages.Message  myMsg = new ApexPages.Message(ApexPages.Severity.info, 'Records were not there to delete.');
     ApexPages.addMessage(myMsg);
    }
    
    return null;
  }

  

 /* Wrapper class with checkbox and Apartment object. 
  this is also  called as inner class 
  */

 public class ApartmentRecordCls{
  public boolean isSelected {get;set;}
  public Referral__c accObj {get;set;}

 }

}
Hello,
I am getting 71% code coverage. I have to be missing something really simple.

I have posted my test plan and trigger below.

Please let me know if you have any questions.

I would appreciate any help.

== Test Plan ==
@isTest(SeeAllData=false)
private class TestCreateOppTeam{

    @isTest(SeeAllData=false)
    private static void TestCreateOppTeam() {

        Opportunity opp = new Opportunity(Name='Test opp', StageName='stage', Probability = 10, CloseDate=system.today(), Campaign_Medium__c = 'Campaign_Medium__c',Campaign_Name__c = 'Campaign_Name__c',Product__c = '01t90000004q3PH',Call_Centre__c = 'Call_Centre__c');     
        insert opp;
        
        Opportunity [] OL = [select Id from Opportunity where Id = :opp.id];
        
        for (Opportunity o: OL ) {
            UserRole rn=[Select Name from UserRole where Id= :UserInfo.getUserRoleId()];
            String Role = rn.name;
        
            OpportunityTeamMember newTeamMember = new OpportunityTeamMember();
            newTeamMember.OpportunityId = o.id;
            newTeamMember.UserId = UserInfo.getUserId();
        
            if (role != 'Admin') {
                if (role.containsIgnoreCase('TEST WORD')) {
                    newTeamMember.TeamMemberRole = 'Role 1';
                } else {
                    newTeamMember.TeamMemberRole = 'Role 2';
                }
                insert newTeamMember;
            }
        }
    }
}

== Trigger ==
trigger CreateOppTeam on Opportunity (after insert) {
    
    for (Opportunity o: trigger.new) {
        UserRole rn=[Select Name from UserRole where Id= :UserInfo.getUserRoleId()];
        String Role = rn.name;
        
        OpportunityTeamMember newTeamMember = new OpportunityTeamMember();
        newTeamMember.OpportunityId = o.id;
        newTeamMember.UserId = UserInfo.getUserId();
        
        if (role != 'Admin') {
            if (role.containsIgnoreCase('TEST WORD')) {
                newTeamMember.TeamMemberRole = 'Role 1';
            } else {
                newTeamMember.TeamMemberRole = 'Role 2';
            }
        
            insert newTeamMember;
        }
    }
}
I am going through the premiere online course for Lightning Components right now and saw something I was curious about.  

The particular module that I am watching is showing how tag attributes can by dynamically set using expression syntax.  Nothing ground breaking there but what I found interesting was at instead of using a standard IF statement it used a ternary IF statment.  At first I thought it was just a style preference by the developer who wrote the example, but I am also curious if there is some sort of efficiency gain in the lightning framework by doing so.  

Basically he used:
class="{!(v.expenseSum != v.approvedSum ? 'alert-danger' : 'alert-success')}

Instead of:
class="{! IF(v.expenseSum != v.approvedSum , 'alert-danger' , 'alert-success')}

I totally understand they are the exact same thing, but from an efficiency standpoint is there any benefit to doing it this way? 
Re-factored my code from previous units with base lightning components, but receiving this error.  Here's my new form component.  Any help would be much appreciated.

<aura:component >   
    <aura:attribute name="newItem" type="Camping_Item__c"    default="{ 'sobjectType': 'Camping_Item__c',
                         'Name': '',
                         'Price__c': 0,
                         'Quantity__c': 0,                         
                         'Packed__c': false
                       }"/>
 
    <aura:registerEvent name="addItem" type="c:addItemEvent"/>
    <lightning:layout >
        <lightning:layoutItem padding="around-small" size="6">
<div aria-labelledby="newItemForm">

    <!-- BOXED AREA -->
    <fieldset class="slds-box slds-theme--default slds-container--small">

    <legend id="newItemForm" class="slds-text-heading--small 
      slds-p-vertical--medium">
      Add Camping Item
    </legend>

    <!-- CREATE NEW CAMPING ITEM FORM -->
    <form class="slds-form--stacked">          
        <lightning:input aura:id="itemForm" label="Camping Item Name"
                         name="Name"
                         value="{!v.newItem.Name}"
                         required="true"/> 
        <lightning:input type="number" aura:id="itemForm" label="Quantity"
                         name="Quantity"
                         maxlength="16"
                         min="0"
                         step="1"
                         value="{!v.newItem.Quantity__c}"
                         required="true"/>
        <lightning:input type="number" aura:id="itemForm" label="Price"
                         name="Price"
                         min="0"
                         step=".01"
                         value="{!v.newItem.Price__c}"
                         formatter="currency"
                         messageWhenRangeUnderflow="Enter an amount that's at least .01."/>
        <lightning:input type="checkbox" aura:id="itemForm" label="Packed?"  
                         name="Packed"
                         checked="{!v.newItem.Packed__c}"/>
        <lightning:button label="Create Expense" 
                          class="slds-m-top--medium"
                          variant="brand"
                          onclick="{!c.clickCreateItem}"/>
    </form>
  </fieldset>
  <!-- / BOXED AREA -->

</div>
        </lightning:layoutItem>
    </lightning:layout>
</aura:component>
I understand TestDataFactory classes won't be counted against org limit and i would like to whether code coverage has to be done separately for these classes. 

Looking for help and example if any.
Trying to give users access to Trailhead , but Firewall blocking access.  Is there a range of IP addresses that we should whitelist specifically for Trailhead?  We have already whitelisted the recommended IP ranges for our Salesforce access and all is working fine.  Not sure if we should whitelist a single IP or if there is a range.  Thanks,  Brent.
I have a requirement to add existing Attachments to a visualforce email template.

I want to add Attachments under a specific Case (from "Notes & Attachments") to send it to Contacts.

Any idea if it's possible and how do I do it ?

Thanks!!
Hi,
I was trying to call an method of class 1 in class 2. but i am getting this error while saving class 2.
Error: Compile Error: Constructor is not visible: <IPgap>(constructor)
Ex:
Class 1:
public class IPgap 
{
   public Opportunity  opp{get; set;}
   public IPgap (ApexPages.StandardController controller)
      {
         //Some logic
      }
   private void Info(){
        intrest = new List<SelectOption>();
     }
}

Class 2:
global without sharing class ipHelper {
    //variable declarations
 public void method1() 
    {
        IPgap ipreq = new IPgap();
        string returnValue = ipreq.Info();
    }
}

Anyone can help me.

Thanks
Vivek
Hi,
Can anyone make this html functionality using aura ui components?.
the html funftionality i am luking for is is in this link
http://www.java2s.com/Code/HTMLCSS/CSS-Controls/Expandableleftlistbasedmenu.htm

basically what i want is a expandable menu.
I have a flow that loops through a screen displaying a list of dynamic multi-select checkboxes.  Problem is, when the loop comes back around to display the next screens of options, the checkboxes are retained from the previously submitted screen.  Without adding another "blank" screen, which does at least clear the cached values, is there a way to clear the values programmatically?  I would think turning off the "Previous" button would do this automatically, but it doesn't.
Hi,

I would like to send a message using Messaging.PushNotification to 'Salesforce1 for Android' 'Salesforce1 for iOS'

Thanks in advance for the help!
  • October 24, 2015
  • Like
  • 0
Hi Guys,

Tell Me, What are the Security and Sharing concepts. I want list of security and sharing concepts.


Thanks in advance
Thulasi
Hello,

have a custom object called Bookings in our org.
This is fed off the opportunities and we have a current custom button that is called "modify order".

This button triggers a workflow email as well another workflow to check modify order as true.

Because we have a javascript code that pops up a window, it is not showing any validation rule even though I put this logic check below
Underlined



{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")} 

try { 

// identify the record 
var o = new sforce.SObject("Booking__c"); 
o.id = "{!Booking__c.Id}"; 

// make the field change 
o.Modify_Order__c= "TRUE"; 

// save the change 
var resulto = sforce.connection.update([o]); 

if(resulto[0].success=='true'){ 
alert('Your Order has been Submitted for Modification'); 
location.reload(); 

else { 
var errors = resulto[0].errors; 
var errorMessages = "An error has occurred, please contact your Salesforce Administrator"; 

for ( var i = 0; i < errors.length; i++ ) { 
errorMessages += errors[i].message + '\n'; 


alert( errorMessages ); // display all validation errors 



} catch ( ex ) { 

alert( ex ); // display any javascript exception message 

}
How do I enable Person Accounts in my developer org? I understand the case creation is no longer available and the document indicates that the only way to create Person Accounts is by asking Salesforce to enable it. Thanks in advance.
  • October 23, 2015
  • Like
  • 0
Hi,

I have a apex repeat inside my pageblocktable, and for some reason my header's not showing up inside the repeat.  Any ideas?

Thanks,
 
<apex:page controller="FiscalPivot_Class">
 
    
    <apex:pageblock >
    <apex:pageblocktable value="{!completeRowList}" var="row">
		 <apex:column >
      	  <apex:outputtext >{!row.name}</apex:outputtext>
        </apex:column>
        
        <apex:repeat value="{!row.amountMap}" var="periodYear">
        <apex:column>   
            <apex:facet name="header">{!periodYear}</apex:facet>
            <apex:outputtext value="{0,number,###,###,##0}" ><apex:param value="{!row.amountMap[periodYear]}"/></apex:outputtext> 
            </apex:column>
        </apex:repeat>
        
         <apex:column>
		<apex:facet: name="header">Total</apex:facet:>           
        <apex:outputtext value="{0,number,###,###,##0}" ><apex:param value="{!row.lineTotal}"/></apex:outputtext> 
        </apex:column>
                    
        </apex:pageblocktable>
    </apex:pageblock>
</apex:page>



 
Someone knows a tool for monitoring space occupied in each instance
After the Winter'16 upgrade of my dev org, I have set up some custom metadata types for my application. I found a bug with Checkbox field in Custom Metadata type that if the field name is greater than 19 characters (excluding namespace and __c) then the SOQL always return false value for that field. The UI displays the value correctly but the query returns always false.

If you have started using custom metadata types then please try this in your org and share the results.
I am looking for more details on how I can integrate my web application with our clients Salesforce application and send some activity information into Salesforce. Do the client needs to setup all the relevant custom fields so that I can send values related to each records or can create custom fields on the fly using the REST API. Please advise.
Hello all,

Has anyone found a solution to toggle between the Service Cloud Console and their Communities?  I am hoping SF enables viewing the Global Header when in the SCC, but just in case they don't, is there a potential workaround (besides switching to the Classic View)?
I have a custom VF page with a custom controller in which a User can see reservations that other User have made for specific offices. 
I cannot, however, get the Reservation.createdby.Name to populate in my VF page as I do not know how to create the proper SOQL query. 

Here is my controller code:
 
wrapperDesk objwrapperDesk;
        List<Desk__c> lstDesk = [select id, Name, Desk_Number__c, createdby.Name, (select id, createdby.Name, Start_Date__c, End_Date__c from Reservations__r) from Desk__c where Office__c =: objDesk.Office__c order by Desk_Number__c asc];
        for(Desk__c dsk: lstDesk){
            objwrapperDesk = new wrapperDesk();
            objwrapperDesk.strDeskNumber = dsk.Desk_Number__c;
            objwrapperDesk.objDesk = dsk;
            map<String, Boolean> mapAvailableTemp = new map<String, Boolean>();
            for(Reservation__c rv: dsk.Reservations__r){
                
                for(integer i = 0; i <= rv.Start_Date__c.daysBetween(rv.End_Date__c);i++){               
                    mapAvailableTemp.Put(String.valueOf(rv.Start_Date__c.adddays(i).month() + '/' + rv.Start_Date__c.adddays(i).day() + '/' + rv.Start_Date__c.adddays(i).year()) + dsk.id, true);
                }
            }
            system.debug('#################'+mapAvailableTemp);
            objwrapperDesk.mapAvailable = mapAvailableTemp;
            objwrapperDesk.intMapSize = mapAvailableTemp.size();
            lstwrapperDesk.add(objwrapperDesk);

Here is the place in the VF page:
<apex:repeat value="{!lstwrapperDateRange}" var="dr">
                              
                                <apex:variable value="{!dr.objDate}{!dsk.objDesk.id}" var="mapKey"/>                                        
                                    
                                    <apex:variable value="{!1}" var="rowNum"/>  
                                    <apex:repeat value="{!dsk.mapAvailable}" var="mapAvail">                                        
                                        <apex:outputPanel rendered="{!mapAvail == mapKey}">
                                            <apex:variable var="rowNum" value="{!rowNum + 1}"/>                                                                                                                             
                                            <td class="myTabletd" bgcolor="{!If(mapAvail == mapKey,'#47BBFF', '')}">
                                                <apex:outputLabel value="{!dsk.objDesk.createdBy.Name}"></apex:outputLabel>
                                            </td>       
                                        </apex:outputPanel>                                                                       
                                    </apex:repeat>

This is the line I need changed but I cannot figure out how:
<apex:outputLabel value="{!dsk.objDesk.createdBy.Name}"></apex:outputLabel>
This needs to be the RESERVATION creator not the DESK creator. 

Please help!
 
I have a requirement to add existing Attachments to a visualforce email template.

I want to add Attachments under a specific Case (from "Notes & Attachments") to send it to Contacts.

Any idea if it's possible and how do I do it ?

Thanks!!
I have a flow that loops through a screen displaying a list of dynamic multi-select checkboxes.  Problem is, when the loop comes back around to display the next screens of options, the checkboxes are retained from the previously submitted screen.  Without adding another "blank" screen, which does at least clear the cached values, is there a way to clear the values programmatically?  I would think turning off the "Previous" button would do this automatically, but it doesn't.
I have a wrapper class for a custom object Referral__c but I need to add the parent object so only the child object display. The purpose for the wrapper class is so when looking at the ClientDetails__c object, a user can delete child records with a check box. I have displayed the child records previously with an extention, but I'm not able to duplicate the functionality with this wrapper class. Can you help?

__________________________________________________
public class ApartmentDeleteWrapperCLs{

public ClientDetails__c CID {get; set;}
public Referral__c Ref {get; set;}

public List<ApartmentRecordCls> accWrapperRecordList {get;set;}

public ApartmentDeleteWrapperCLs(){

//Fetch Referrals
List<Referral__c> accList= new List<Referral__c>();
accWrapperRecordList = new List<ApartmentRecordCls>();
accList = [select id, Apartment__r.Complex_Name__c, Apartment__r.Warning_Image__c, Apartment__r.Phone__c, Apartment__r.Year_Built__c, 
Apartment__r.Submarket__r.Name, Apartment__r.Address__c, Apartment__r.City__c, Apartment__r.State__c, Apartment__r.Zip_Code__c,Apartment__r.Commission_Bonus__c,
Unit__r.Bedrooms__c, Unit__r.Bathrooms__c, Unit__r.Layout__c, Unit__r.Square_Feet__c, Unit__r.Rent__c, Unit__r.CR_6M_Final__c, 
Unit__r.CR_6M_Final_Percent__c, Unit__r.CR_12M_Final__c, Unit__r.CR_12M_Final_Percent__c, Unit__r.Status__c,
ClientDetails__r.ID, ClientDetails__r.Referring_Locator__r.ID, ClientDetails__r.First_Name__c  
from Referral__c WHERE ClientDetails__c = :CID];


//For loop to set data
  if(!accList.isEmpty()) {
    for(Referral__c acc: accList){
     ApartmentRecordCls arcls = new ApartmentRecordCls();
     arcls.isSelected =  false;
     arcls.accObj = acc;
     accWrapperRecordList.add(arcls);
    
    } //end of for loop.
  
  } //end of if condition.
 }
  
  /*
   Delete Apartment functionality based on the selected records.
  */
  public PageReference DeleteApartment(){
   List<Referral__c> accToDelete = new List<Referral__c>();
   //To hold the unselected Apartment records.
   List<ApartmentRecordCls> listUnSelectedRecords  = new List<ApartmentRecordCls>();  
    if(accWrapperRecordList !=null && accWrapperRecordList.size()>0) {
      for(ApartmentRecordCls wrapObj :  accWrapperRecordList){
        if(wrapObj.isSelected == true){
          accToDelete.add(wrapObj.accObj);
        }else{
          listUnSelectedRecords.add(wrapObj);
        }
      
      
      }//end of for.
      /*
       checking the delete list size and assign the unselected values to 
       original wrapper list.
      */
      if(accToDelete !=null && accToDelete.size()>0){
       delete accToDelete;
       accWrapperRecordList.clear();
       accWrapperRecordList.addAll(listUnSelectedRecords);
      }
    
    }else{
     ApexPages.Message  myMsg = new ApexPages.Message(ApexPages.Severity.info, 'Records were not there to delete.');
     ApexPages.addMessage(myMsg);
    }
    
    return null;
  }

  

 /* Wrapper class with checkbox and Apartment object. 
  this is also  called as inner class 
  */

 public class ApartmentRecordCls{
  public boolean isSelected {get;set;}
  public Referral__c accObj {get;set;}

 }

}
I am attempting to extract metadata from one org and deploy to another and I receive the message 
profiles/Standard.profile -- Error: Unknown user permission: EditReports
for .profile XML files that contain
<userPermissions>
        <enabled>true</enabled>
        <name>EditReports</name>
    </userPermissions>
I've searched through the Release notes for Summer '13, Winter '14, Spring '14 and Summer '14 and cannot find any reference for a change to this user permission, although I can see that there are new User Permissions like ManageReportsInPubFolders although this looks more like the old EditPublicReports.

Can anyone point me towards documentation or references that describe the current User Permissions by their API names in the metadata API? Or the release in which this was changed?

When someone takes the time/effort to repspond to your question, you should take the time/effort to either mark the question as "Solved", or post a Follow-Up with addtional information.  

 

That way people with a similar question can find the Solution without having to re-post the same question again and again. And the people who reply to your post know that the issue has been resolved and they can stop working on it.