• William López
  • NEWBIE
  • 365 Points
  • Member since 2015
  • Senior Software Developer
  • Deloitte


  • Chatter
    Feed
  • 12
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 55
    Replies
How to move Relationships from Full Sandbox to Production ?
Using some examples I have come up with the following Visualforce page on our accounts.  I have a few issue with it that I need some help on.
  1. The page is cut off at the bottom when added to the Account Details page.
  2. Clicking the Save button in the page does save the inputField changes but it tries to display the entire Salesforce.com window in the Apex page.
  3. Is there a way to only display this based on a checkbox being checked?
<apex:page standardController="Account" showHeader="true">
    <!-- Define Tab panel .css styles -->
    <style>
    .activeTab {background-color: #236FBD; color:white; background-image:none}
    .inactiveTab { background-color: lightgrey; color:black; background-image:none}
    </style>
            
    <!-- Create Tab panel -->
    <apex:tabPanel switchType="client" selectedTab="name1" id="AccountTabPanel"
        tabClass="activeTab" inactiveTabClass="inactiveTab">
        <apex:tab label="Contact Penetration" name="name1" id="tabOne">
               <apex:pageBlock >
                  <apex:pageBlockSection columns="3">
                    <apex:outputField value="{!account.Architect_Contacts__c}"/>
                    <apex:outputField value="{!account.Design_Contacts__c}"/>
                    <apex:outputField value="{!account.Total_Contacts__c}"/>
                    <apex:outputField value="{!account.Architects_Engaged_6_Months__c}"/>
                    <apex:outputField value="{!account.Designers_Engaged_6_Months__c}"/>
                    <apex:outputField value="{!account.Total_Engaged_6_Months__c}"/>
                    <apex:outputField value="{!account.Architect_Penetration__c}"/>
                    <apex:outputField value="{!account.Design_Penetration__c}"/>
                    <apex:outputField value="{!account.Total_Penetration__c}"/>
                 </apex:pageBlockSection>
              </apex:pageBlock>
        </apex:tab>
        <apex:tab label="Specification Share of Wallet" name="name2" id="tabTwo">
            <apex:form >
               <apex:pageBlock >
               <apex:pageBlockButtons >
               <apex:commandButton action="{!save}" value="Save" immediate="true"/>
               </apex:pageBlockButtons>
                  <apex:pageBlockSection columns="2">
                    <apex:inputField value="{!account.Total_Annual_Specifications_Number__c}"/>
                    <apex:inputField value="{!account.Total_Annual_Specifications_Sales__c}"/>
                    <apex:inputField value="{!account.Koroseal_Specs_TTM_Number__c}"/>
                    <apex:inputField value="{!account.Koroseal_Specs_TTM_Sales__c}"/>
                    <apex:outputField value="{!account.Share_of_Wallet_Number__c}"/>
                    <apex:outputField value="{!account.Share_of_Wallet_Sales__c}"/>
                 </apex:pageBlockSection>
              </apex:pageBlock>
           </apex:form>
        </apex:tab>
        <apex:tab label="Specification Win Rate" name="name3" id="tabThree">
            <apex:form >
               <apex:pageBlock >
               <apex:pageBlockButtons >
               <apex:commandButton action="{!save}" value="Save" immediate="true"/>
               </apex:pageBlockButtons>
                  <apex:pageBlockSection columns="1">
                    <apex:outputField value="{!account.Koroseal_Specs_TTM__c}"/>
                    <apex:inputField value="{!account.Specifications_Won__c}"/>
                    <apex:inputField value="{!account.Specifications_Lost__c}"/>
                    <apex:outputField value="{!account.Specification_Win_Rate__c}"/>
                 </apex:pageBlockSection>
              </apex:pageBlock>
           </apex:form>
        </apex:tab>
    </apex:tabPanel>
</apex:page>
Thanks in advance!
 
I'd like to see all of the open opporutnities on a custom home page along with the standard dashboard. How can I accomplish this? 

Thanks
I have a class which automatically creates portal user. I also have a trigger on user which has a callout on any updates on user. I need to bypass this user trigger whenever the user is created through this automated process and trigger should happen normally whenever a user edit happens other than auto creation process. how can i achieve this? Static variable a good option?
Hi,

I have a custom object called customObj__c. I need to create a visualforce page that looks like this:

First Name : <textbox input>
Last Name : <textbox input>
Email: <textbox input>
<submitButton Here>

When the Submit button is pressed, i need to simply create a new customObj__c record using the values entered in the form (first name, last name, email). How to do I accomplish this? I am confused as to how I can use a class to save the new record on Submit button click.
  • March 13, 2015
  • Like
  • 0
Hi all,
I'm trying to rerender a visualforce dynamic component in my visualforce page on the onclick button event: I tried with a remote action on a button tag element (I'd like to avoid the form element on Vf page for view state problems) and it didn't work; so I tried with an apex button element, too, but no luck: can anyone help me? thanks

This is the code:

- Controller:
public class provaController{
    public boolean var{get; set;}    
    public integer count;
    
    public provaController(){
        var = false;
        count = 0;
    }
    
    public void add(){
        var = true;
    }
    
    public Component.Apex.OutputText getThePanel() { 
        system.debug('****panel');
        count++;       
        String stringaFinale = '<p>first call</p>';                 
        if(count>1) stringaFinale = stringaFinale +  '<p>second call</p>';
        
        Component.Apex.OutputText outTextGlobal = new Component.Apex.OutputText();
        outTextGlobal.value = stringaFinale;
        outTextGlobal.escape = false;

        stringaFinale = null;
        return outTextGlobal;
    }
         
    @RemoteAction
    global static void click() {
        system.debug('****remote');
    }
}

- Vf page:
<apex:page controller="provaController" id="idController" >   
    <div  id="provaDiv" >
        <apex:dynamicComponent componentValue="{!thePanel}" invokeAfterAction="true"/>   
    </div>
    
    <apex:form >
        <apex:commandButton action="{!add}" value="button" id="theButton" reRender="idController,provaDiv"/>
    </apex:form>  
</apex:page>
I have a field that must equal two other fields.  How to enforce my users are adding currency correctly?

Example:

Upgrading field = $80
Renewing field = $20

Totals field = $100
Hely yall,
We have a custom VF QuoteLineItem page that automatically calculates Total price based on Discount and Unit Price entered. Is there a way to lock down the UnitPrice  field so that it's only editable by certain profiles? It's an editable apex:inputField. I've tried using an outputField, which displays the UnitPrice but can no longer calculate the Total price. Here's a screenshot and code snippet.User-added image
<apex:inputField value="{!item.Item.UnitPrice}" rendered="{!IF(($Profile.Name =='System Administrator'), true , false)}"/>


 
I have created a custom object Allocation with fields Product name,Account(lookup),contact(master detail),balances(currency), cost bases(currency). I have added Allocation related list to contact page. This works fine.

Users would like to see related list on account page which totals all the balances,cost basis  by product for that account  for eg ..
PRODUT NAME  |      BALANCE |   COST BASIS

What additional object/relationship I have to create to achive this ?  Thanks for help/advise.



 
  • February 05, 2015
  • Like
  • 0
Apex noob here. I'm trying to clone an Opportunity and all Contact Roles on any insert or update on a closed won opportunity greater than $500. So, if the opportunity or contact roles are updated, added or deleted, I'd like the clone to inherit those new or updated roles. Is this even possible? I know you can't actually run a trigger on the OpportunityContactRole object - which would be the easiest - but I was wondering if I could effectively look for changes in that related list from the Opportunity object trigger and then run the clone logic there.

One thought I had was rather than trying to do it this way was to essentially add a button/checkbox to the opportunity and instruct users to check the box on the records they wanted cloned as this will be for prospecting in the next FY.

My question is - is that first one even possible? Is it possible to compare the related list size or look for changes in any efficient way. Like would I effectively have to loop through the contact roles before the insert/update and after the insert/update and compare all the fields on the contact role?
I am recieving the following error when saving a lead record - Error: Invalid Data. 
Review all error messages below to correct your data.
Apex trigger Lead caused an unexpected exception, contact your administrator: Lead: execution of BeforeInsert caused by: line 7, column 4: trigger body is invalid and failed recompilation: Method does not exist or incorrect signature: LeadTriggerHandler.TriggerBeforeInsert(List)

I cant seem to find the source of the issue - any ideas?

The Date and Double fields are not getting updated.  Is there something I'm doing wrong?  Sting fields update as expected.

wsdl definitions:

                <element name="SRA_CloseDate__c" nillable="true" minOccurs="0" type="xsd:date"/>
                <element name="SRA_CreateDate__c" nillable="true" minOccurs="0" type="xsd:date"/>
                <element name="SRA_Notes__c" nillable="true" minOccurs="0" type="xsd:string"/>
                <element name="SRA_Probability__c" nillable="true" minOccurs="0" type="xsd:double"/>
                <element name="SRA_SaleAmount__c" nillable="true" minOccurs="0" type="xsd:double"/>
                <element name="SRA_Status__c" nillable="true" minOccurs="0" type="xsd:string"/>
                <element name="SRA_Units__c" nillable="true" minOccurs="0" type="xsd:double"/>
                <element name="SRA_Worksheet__c" nillable="true" minOccurs="0" type="xsd:string"/>

VB.Net Code:

                ' Only need one opportunity in the array
                Dim objOppx(1) As SFWebReference.Opportunity                            ' Create Array
                Dim updateOppx As New SFWebReference.Opportunity               ' Create Opportunity object

                ' Set Opportunity Values
                updateOppx.Id = OpportunityID
                updateOppx.SRA_Worksheet__c = SRADocument          ' String
                updateOppx.SRA_Status__c = Status                               ' String
                updateOppx.SRA_Probability__c = 10                              ' Double
                updateOppx.SRA_Units__c = 1                                        ' Double
                updateOppx.SRA_SaleAmount__c =100                         ' Double
                updateOppx.SRA_Notes__c = Notes                               ' String
                updateOppx.SRA_CreateDate__c = DateTime.Parse("10/14/2011 11:46 AM")                ' Date
                updateOppx.SRA_CloseDate__c = DateTime.Parse("10/14/2011 11:46 AM")                  ' Date

                objOppx(0) = updateOppx                       
 
                ' Update the Opportuinty
                Dim sr() As SFWebReference.SaveResult
                sr = SfService.update(objOppx)                ' Update all array objects
Hello, I am creating a community (Salesforce Tabs + Visualforce) and when I try to create a new Sharing Sets I got an error of "Insufficient Privileges", this issue happens only on sandbox. There is something that need to be configured ?
Developer Console Log on Record editHello I am trying to see the debug log when a update an opportunity so I can debug what a trigger does.

This is a developer edition ORG.

I have enabled the Debug Logs for my user:

User-added image

And I have my developer console open, but I dont get any debug line when I edit my Opportunity record.

User-added image

I don't know if I am doing something wrong here I need to anable something else.

Thanks,

Bill
Gurus, 
I have test class for a batch insert and it shows 0 code coverage. I am not sure what I am doing wrong.
Below is the class:
global class batchPPBInsert implements Database.Batchable<sObject>,Database.Stateful
{
  global Integer sizePPB = 0;
    global Database.QueryLocator start(Database.BatchableContext BCPPBI)
    {
        string operation;
        operation='Insert';
        String query = 'SELECT Currency_Code__c,Currency_Number__c,Dealer_Price__c,IsDeleted,Item__c,Name,OwnerId,Price_Scheme_Location__c,Territory__c FROM Pelco_Price_Book_Stage__c';
        query=query +' WHERE Operation_Type__c = \'' + String.escapeSingleQuotes(operation) + '\'';
        return Database.getQueryLocator(query);
    }
   
    global void execute(Database.BatchableContext BCPPBI, List<Pelco_Price_Book_Stage__c> scope)
    {
        List<Pelco_Price_Book__c> lstPPB = new List <Pelco_Price_Book__c>(); 
        for(Pelco_Price_Book_Stage__c PPBStg : scope)
         {
           Pelco_Price_Book__c PPB = new Pelco_Price_Book__c();
           PPB.Currency_Code__c=PPBStg.Currency_Code__c;
           PPB.Currency_Number__c=PPBStg.Currency_Number__c;
           PPB.Dealer_Price__c=PPBStg.Dealer_Price__c;
           //PPB.IsDeleted=PPBStg.IsDeleted;
           PPB.Item__c=PPBStg.Item__c;
           PPB.Name=PPBStg.Name;
           PPB.Price_Scheme_Location__c=PPBStg.Price_Scheme_Location__c;            
           PPB.Territory__c=PPBStg.Territory__c;
           lstPPB.add(PPB);  
           
         }
        sizePPB += scope.size(); 
        system.debug('SizePPB='+SizePPB);
        insert(lstPPB);
        delete(scope);
    }   
    global void finish(Database.BatchableContext BCPPBI)
    {
        String email;
        //email='gaurav.agnihotri@schneider-electric.com';
        AsyncApexJob a = [SELECT Id, Status, NumberOfErrors, JobItemsProcessed,TotalJobItems, CreatedBy.Email FROM AsyncApexJob WHERE Id =:BCPPBI.getJobId()];
        //SizePPB= [SELECT Count() from Pelco_Price_Book_Stage__c WHERE Operation_Type__c = 'Insert'];
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
		mail.setToAddresses(new String[] {'gaurav.agnihotri@schneider-electric.com','nhombal@pelco.com','dfisher@schneider-electric.com','ron.adolph@schneider-electric.com'});
		mail.setReplyTo('gaurav.agnihotri@schneider-electric.com');
		mail.setSenderDisplayName('Batch Processing');
		mail.setSubject('Batch Process Completed for insert on Pelco Price book');
        if (a.Status == 'Completed')
		mail.setPlainTextBody('The batch Apex job processed ' + a.TotalJobItems +' batches of batch size '+ SizePPB+ ' with '+a.NumberOfErrors + ' failures.');		
        if (a.Status == 'Failed')
        mail.setPlainTextBody('The batch Apex job processed ' + a.TotalJobItems +' batches of batch size '+ SizePPB+ ' with '+a.NumberOfErrors + ' failures. Failure Message: '+a.ExtendedStatus);

        Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
    }
}

 the test class:
@istest
private class TestbatchPPBInsert {
    static testMethod void batchPPBMethod1(){
        /************************/
        //Insert Pelco Price Book
        /************************/
            Pelco_Price_Book_Stage__c PPB= new Pelco_Price_Book_Stage__c();
            PPB.Currency_Code__c='CAD';
            PPB.Currency_Number__c='1';
            PPB.Dealer_Price__c=276.3;
            //PPB.Id='a03g0000008K0KGAA0';
            PPB.Item__c='EH16-2PMTS';
            PPB.Name='a03g0000008K0KG';
            //PPB.Operation_Date_and_Time__c=2015-08-21T19:51:21.000Z;
            PPB.Operation_Type__c='Insert';
            PPB.Price_Scheme_Location__c='E7';
            PPB.Territory__c=17;
            insert PPB;
          system.debug('PPBId='+PPB.id);
        batchPPBInsert b3= new batchPPBInsert();
		database.executeBatch(b3);
    }
}

Not sure what I am doing wrong

-Gaurva
 
How to move Relationships from Full Sandbox to Production ?
Hello, I am creating a community (Salesforce Tabs + Visualforce) and when I try to create a new Sharing Sets I got an error of "Insufficient Privileges", this issue happens only on sandbox. There is something that need to be configured ?
I am setting up a community. I have been able to enable it for internal users.

I created a Partner Accpunt, and added a Contact within the account and enabled the Manage External Account option. The contact didn't receive any welcome email (the internal account did). Using the external account email I've attempted to use the "Forgot your password" option, but still don't get an email.

I know Salesforce is sending emails, because I used the "Request Update" option for that contact and it worked.

Can someone help me figure out what I'm missing?
(The community is fgcommtest.force.com/ufc)
Using some examples I have come up with the following Visualforce page on our accounts.  I have a few issue with it that I need some help on.
  1. The page is cut off at the bottom when added to the Account Details page.
  2. Clicking the Save button in the page does save the inputField changes but it tries to display the entire Salesforce.com window in the Apex page.
  3. Is there a way to only display this based on a checkbox being checked?
<apex:page standardController="Account" showHeader="true">
    <!-- Define Tab panel .css styles -->
    <style>
    .activeTab {background-color: #236FBD; color:white; background-image:none}
    .inactiveTab { background-color: lightgrey; color:black; background-image:none}
    </style>
            
    <!-- Create Tab panel -->
    <apex:tabPanel switchType="client" selectedTab="name1" id="AccountTabPanel"
        tabClass="activeTab" inactiveTabClass="inactiveTab">
        <apex:tab label="Contact Penetration" name="name1" id="tabOne">
               <apex:pageBlock >
                  <apex:pageBlockSection columns="3">
                    <apex:outputField value="{!account.Architect_Contacts__c}"/>
                    <apex:outputField value="{!account.Design_Contacts__c}"/>
                    <apex:outputField value="{!account.Total_Contacts__c}"/>
                    <apex:outputField value="{!account.Architects_Engaged_6_Months__c}"/>
                    <apex:outputField value="{!account.Designers_Engaged_6_Months__c}"/>
                    <apex:outputField value="{!account.Total_Engaged_6_Months__c}"/>
                    <apex:outputField value="{!account.Architect_Penetration__c}"/>
                    <apex:outputField value="{!account.Design_Penetration__c}"/>
                    <apex:outputField value="{!account.Total_Penetration__c}"/>
                 </apex:pageBlockSection>
              </apex:pageBlock>
        </apex:tab>
        <apex:tab label="Specification Share of Wallet" name="name2" id="tabTwo">
            <apex:form >
               <apex:pageBlock >
               <apex:pageBlockButtons >
               <apex:commandButton action="{!save}" value="Save" immediate="true"/>
               </apex:pageBlockButtons>
                  <apex:pageBlockSection columns="2">
                    <apex:inputField value="{!account.Total_Annual_Specifications_Number__c}"/>
                    <apex:inputField value="{!account.Total_Annual_Specifications_Sales__c}"/>
                    <apex:inputField value="{!account.Koroseal_Specs_TTM_Number__c}"/>
                    <apex:inputField value="{!account.Koroseal_Specs_TTM_Sales__c}"/>
                    <apex:outputField value="{!account.Share_of_Wallet_Number__c}"/>
                    <apex:outputField value="{!account.Share_of_Wallet_Sales__c}"/>
                 </apex:pageBlockSection>
              </apex:pageBlock>
           </apex:form>
        </apex:tab>
        <apex:tab label="Specification Win Rate" name="name3" id="tabThree">
            <apex:form >
               <apex:pageBlock >
               <apex:pageBlockButtons >
               <apex:commandButton action="{!save}" value="Save" immediate="true"/>
               </apex:pageBlockButtons>
                  <apex:pageBlockSection columns="1">
                    <apex:outputField value="{!account.Koroseal_Specs_TTM__c}"/>
                    <apex:inputField value="{!account.Specifications_Won__c}"/>
                    <apex:inputField value="{!account.Specifications_Lost__c}"/>
                    <apex:outputField value="{!account.Specification_Win_Rate__c}"/>
                 </apex:pageBlockSection>
              </apex:pageBlock>
           </apex:form>
        </apex:tab>
    </apex:tabPanel>
</apex:page>
Thanks in advance!
 

I am writing some code that will automatically convert leads in certain situations. Additionally, the code searches for contacts with the same email address, and associates the converted lead with the existing Contact and the Contact's related Account. If there is no matching Contact, it searches for an Account where a custom field called Domain__c matches the value of Domain__c on the Lead being converted. If that's found, the Lead is converted to a new Contact on an existing Account. Otherwise, it creates a new Contact and Account.

Here is the error I am receiving. So far, Salesforce support has not been helpful in pointing me in the right direction.

Error:Apex trigger leadTrigger caused an unexpected exception, contact your administrator: leadTrigger: execution of AfterUpdate caused by: System.DmlException: ConvertLead failed. First exception on row 0; first error: UNKNOWN_EXCEPTION, An unexpected error occurred. Please include this ErrorId if you contact support: 711698393-71813 (759071441): []: Class.LeadConverter.convertLead: line 143, column 1

I wrote this as a static method for now, but I'll be updating to make the code more generic to handle multiple different cases once I get this version working. Here's my trigger:

trigger leadTrigger on Lead (before insert, before update, after insert, after update) {
    //before insert 
    if(Trigger.isBefore && Trigger.isInsert){
        
    } 
    //before update 
    if(Trigger.isBefore && Trigger.isUpdate){
        
    }
    //after insert
    if(Trigger.isAfter && Trigger.isInsert){
        LeadConverter.convertLead(Trigger.new);
    }
    //after update
    if(Trigger.isAfter && Trigger.isUpdate){ 
        LeadConverter.convertLead(Trigger.new);
    }
}


And here is my Class:

public class LeadConverter {

	public static void convertLead(List<Lead> leads){
		Set<String> domains = new Set<String>();
		Set<String> emailAddresses = new Set<String>();
		List<Lead> leadsToConvert = new List<Lead>();
		List<Database.LeadConvert> leadConverts = new List<Database.LeadConvert>();
		
		LeadStatus convertStatus = [SELECT MasterLabel FROM LeadStatus WHERE IsConverted = true LIMIT 1];
		
		for (Lead l: leads){
			if(l.LeadSource == 'SSL Distro' && l.Domain__c != null
			 && l.Email != null && !l.isConverted){
				if(l.Domain__c != null){ domains.add(l.Domain__C); }
				if(l.Email != null){ emailAddresses.add(l.Email); }
				leadsToConvert.add(l);
			}//end if statement on Lead Source	
		}//end leads for loop
        
        List<Account> exstingAccounts = [SELECT Id, Name, Domain__c FROM Account WHERE Domain__c IN :domains];
        List<Contact> exstingContacts = [SELECT Id, AccountID, FirstName, LastName, Email, Email_ID__c 
        								FROM Contact WHERE Email_ID__c IN : emailAddresses];
        								
        Map<String, Contact> emailContactIdMap = new Map<String, Contact>();	
        Map<String, Account> domainAccountIdMap = new Map<String, Account>();	
        	
        for (Contact c: exstingContacts){ emailContactIdMap.put(c.Email_ID__c, c); }						
		for (Account a: exstingAccounts){ domainAccountIdMap.put(a.Domain__c, a); }
		
		for (Lead l: leadsToConvert){
			Database.LeadConvert lc = new Database.LeadConvert();
			if (emailContactIdMap.get(l.Email) != null && !l.isConverted){
				if(emailContactIdMap.get(l.Email).AccountId != null){
					lc.setContactId(emailContactIdMap.get(l.Email).Id);
					lc.setAccountId(emailContactIdMap.get(l.Email).AccountId);
				}	
			} else if (domainAccountIdMap.get(l.Domain__c) != null && !l.isConverted){
				lc.setAccountId(domainAccountIdMap.get(l.Domain__c).Id);
			}
			lc.setLeadId(l.Id);
			lc.setDoNotCreateOpportunity(true);
			lc.setConvertedStatus(convertStatus.MasterLabel); 
			
			leadConverts.add(lc);
		}//end leads to convert for loop
		
		System.debug('The list of items to convert has a size of: ' + leadConverts.size() );
		
			if(!leadConverts.isEmpty()){
				List<Database.LeadConvertResult> lcr = Database.convertLead(leadConverts);
			}
		
	}
}

Does anyone have any insight? I've never encountered such a generic exception before, and not even sure where to start with this.
I'd like to see all of the open opporutnities on a custom home page along with the standard dashboard. How can I accomplish this? 

Thanks
I have a class which automatically creates portal user. I also have a trigger on user which has a callout on any updates on user. I need to bypass this user trigger whenever the user is created through this automated process and trigger should happen normally whenever a user edit happens other than auto creation process. how can i achieve this? Static variable a good option?
I'm very new to salesforce. I'm working on a visualforce email template that will provide contacts with certain information. I'm trying include a line a variable text.
For example, how can I display "Face Amount: {!relatedTo.Face_Amount__c}" only if there is a value contained in {!relatedTo.Face_Amount__c}?
It is possible to have an extension for a custom controller? If yes can anyone share me the some basic code for how to call that both controller and extension in apex class ?
Hi,

I have a custom object called customObj__c. I need to create a visualforce page that looks like this:

First Name : <textbox input>
Last Name : <textbox input>
Email: <textbox input>
<submitButton Here>

When the Submit button is pressed, i need to simply create a new customObj__c record using the values entered in the form (first name, last name, email). How to do I accomplish this? I am confused as to how I can use a class to save the new record on Submit button click.
  • March 13, 2015
  • Like
  • 0
Hello All,

I am getting this error, Can any help on this ?

  for(Contact cc : [select id,name,LastName,Email from Contact]){
            ContactLastNameEmailMap.put(cc.LastName+'-'+cc.Email,cc);
        }
      
        for (eo3__Composite_Project__c CompositeProj : newCompositeProject){
            SiteIdSet.add(CompositeProj.eo3__Site_External_Id__c);
        }
       
        List<eo3__eoSite__c> siteList=new List<eo3__eoSite__c >();
        siteList=Database.query('Select id,name,eo3__Account__c,eo3__External_ID__c  from eo3__eoSite__c Where eo3__External_ID__c in:SiteIdSet');
        for(eo3__eoSite__c ss : siteList){
            siteMap.put(ss.eo3__External_ID__c,ss);
        }
        // Checking for duplicat contact, if exist then we will assign it to Primary project contact else we will create it and then assign it.
        for (eo3__Composite_Project__c CompositeProj : newCompositeProject){  
               
                if(ContactLastNameEmailMap!=null && ContactLastNameEmailMap.Get(CompositeProj.eo3__Contact_Last_Name__c+'-'+CompositeProj.eo3__Contact_Email_Address__c)!=null){
                   //If Contact already exists with inserted/updated Last name and Email that assiging that contact as Primary Project Contact
                    CompositeProj.Primary_Project_Contact__c=ContactLastNameEmailMap.Get(CompositeProj.eo3__Contact_Last_Name__c+'-'+CompositeProj.eo3__Contact_Email_Address__c).ID;
                }


Thanks,
  • March 13, 2015
  • Like
  • 0
i want to email our internal users (200+) with a link to a custom object, but single email doesnt send to enough people and mass email cant set an object id to a custom object. is there a way to bulk email but set the html body, or something..?? or do i have to batch execute the single email process?

i have tried both sending single email; which works for 10 emails, and ive tried mass email but the custom object id doesnt come through.
i want to develop a function to upload bulk CSV data into profuct as below screenshot.
User-added image
how to write the VF page and APEX code and how to deal with the csv file. i have no idea about the code develope.....
Hi all,
I'm trying to rerender a visualforce dynamic component in my visualforce page on the onclick button event: I tried with a remote action on a button tag element (I'd like to avoid the form element on Vf page for view state problems) and it didn't work; so I tried with an apex button element, too, but no luck: can anyone help me? thanks

This is the code:

- Controller:
public class provaController{
    public boolean var{get; set;}    
    public integer count;
    
    public provaController(){
        var = false;
        count = 0;
    }
    
    public void add(){
        var = true;
    }
    
    public Component.Apex.OutputText getThePanel() { 
        system.debug('****panel');
        count++;       
        String stringaFinale = '<p>first call</p>';                 
        if(count>1) stringaFinale = stringaFinale +  '<p>second call</p>';
        
        Component.Apex.OutputText outTextGlobal = new Component.Apex.OutputText();
        outTextGlobal.value = stringaFinale;
        outTextGlobal.escape = false;

        stringaFinale = null;
        return outTextGlobal;
    }
         
    @RemoteAction
    global static void click() {
        system.debug('****remote');
    }
}

- Vf page:
<apex:page controller="provaController" id="idController" >   
    <div  id="provaDiv" >
        <apex:dynamicComponent componentValue="{!thePanel}" invokeAfterAction="true"/>   
    </div>
    
    <apex:form >
        <apex:commandButton action="{!add}" value="button" id="theButton" reRender="idController,provaDiv"/>
    </apex:form>  
</apex:page>
I have a field that must equal two other fields.  How to enforce my users are adding currency correctly?

Example:

Upgrading field = $80
Renewing field = $20

Totals field = $100
Hely yall,
We have a custom VF QuoteLineItem page that automatically calculates Total price based on Discount and Unit Price entered. Is there a way to lock down the UnitPrice  field so that it's only editable by certain profiles? It's an editable apex:inputField. I've tried using an outputField, which displays the UnitPrice but can no longer calculate the Total price. Here's a screenshot and code snippet.User-added image
<apex:inputField value="{!item.Item.UnitPrice}" rendered="{!IF(($Profile.Name =='System Administrator'), true , false)}"/>


 
Hello,
I created a VF page to display a dashboard on the home page (instead of just the first row). This just stopped working. Now the page load, the sidebar and tabs accross the top have disappeared making it impossible to navigate to another page. Any idea how to fix this issue? Thanks! 
<apex:page >
  <iframe src="/01ZA0000000xYZ1?isdtp=vw" frameborder="0" height="900" width="4000"/>
</apex:page>