• Dharmesh
  • NEWBIE
  • 120 Points
  • Member since 2010

  • Chatter
    Feed
  • 4
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 58
    Replies

Helllooo.

 

Wondering if someone could help me with issue I having with this trigger I am attempting to write.

 

The gist of the what I am trying to do is this:  I have a Contract ID field in salesforce on my Opportunity and on a custom object called Recon_Detail__c.  Each Recon_Detail is basically like a line item for one Contract.  My plan for this trigger is to aggregate the sum of all of the Recon_Details of one Contract ID and then write the value on the Total_Amount__c field on the Opportunity.

 

So for example, Recon_Detail 1 has a contract ID of 123123 and amount of $100, Recon Detail 2 has a contract ID of 123123 and amount of 125, Recon Detail 3 has a contract ID of 123124 and amount of $123.

 

When the Opportunity with the Contract ID of 123123 updates, then the Total Amount field should populate with the amount of $225.

 

I'm getting this error in my code: Illegal assignment from LIST<AggregateResult> to LIST<Recon_Detail__c> at line 19 column 1 (line marked in red below)

 

trigger UpdateOppReconDetail on Opportunity (before update) {

//Create a placeholder list of Contract Id's from the opportunity called oppids and
//placeholder map for contract id and total amount from recon detail called rdmap

List<string> oppids = new List<string>();
Map<string,string> rdmap = new Map<string,string>();

    //add the Opportunity contract ids that have blank Total_Amount__c field on Opportunity to the oppids list

    for(Opportunity o : Trigger.new) {
        if(o.Total_Amount__c == null){
            oppids.add(o.Contract_ID__c);
        }
    }

//Get the Contract Id and Amount of all Recon Details that are in the OppId List

List<Recon_Detail__c> rds = [SELECT Contract_ID__c, SUM(Amount__c)sum
                             FROM Recon_Detail__c
                             where Contract_ID__c IN :oppids
                             GROUP BY Contract_ID__c];

    //Create the map that will be used to update; placing Contract ID, then Amount
    
    for(Recon_Detail__c rd : rds) {
        rdmap.put(rd.Contract_ID__c, String.Valueof(rd.get('sum')));
    }

    //If the Recon_Detail__c is blank/null, then get the opportunity id (key) from the map and place it's Amount (value) in that field
    
    for(Opportunity o : Trigger.new) {
           o.Total_Amount__c = rdmap.get(o.Contract_ID__c);
    }

}

 

 

 

I am writing an apex button to invoke a class and am recieving the following error:

 

A problem with the OnClick JavaScript for this button or link was encountered:

{faultcode:'soapenv:Client', faultstring:'No operation available for request {http://soap.sforce.com/schemas/package/ProductDescription}SplitDescription, please check the WSDL for the service.', }

 

The apex class and the javascript have the same class.

Button:

// Include and initialize the AJAX toolkit library
{!REQUIRESCRIPT("/soap/ajax/26.0/connection.js")};
{!REQUIRESCRIPT("/soap/ajax/26.0/apex.js")};
var idList = {!GETRECORDIDS($ObjectType.QuoteLineItem)};
var retURL = window.location.toString();
var proceed = true;
if(idList.length == 0){
alert('Please select at least 1 record.');
proceed = false;
}
if(idList.length != 0){
var myvar = sforce.apex.execute("ProductDescription","SplitDescription",{QuotteLinetem_id:idList})
window.alert(myvar);

}

 Class un version 26.0

Global class ProductDescription {
    

    List<String> xarray = new List<String>();
    QuoteLineItem qli {get; set;}
    id idlist;
    
    public ProductDescription(ApexPages.StandardController c) {
        qli = [select id from Quotelineitem where id =: ApexPages.currentpage().getParameters().get('qli')];
        system.debug('###########qli:'+qli);
    }

   Public pageReference SplitDescription(){
   
   List<QuoteLineItem> cqli = [select id, pricebookentryid, PricebookEntry.Product2.Description
                                   from QuoteLineItem where id =:idList];

   For(Quotelineitem qli : cqli){
     xarray = qli.PricebookEntry.Product2.Description.split('\n');   
        system.debug(xarray);
   }
    Product_Description_Line__c[] split = new Product_Description_Line__c[0];
    For(String sa : xarray){
           split.add(New Product_Description_Line__c(quote__c = cqli[0].quoteid,
                    Quote_Line_Item__c = cqli[0].id,
                    Description_Line__c = sa
                    ));

   insert split;

  }
  return null;
  }
}

 What am I doing wrong and how do I solve the error?

 

Thank you

Hello,

 

I have an orderposition that is referenced in a quotationposition. I now want to reference fields in the according orderposition.

In my VF page I tried to reference the following:

...

       <apex:dataTable value="{!KV_Positionen}" var="KP" id="Table" styleClass="my_table">
            <apex:facet name="header"></apex:facet>
            <apex:column >
                <apex:facet name="header">Anzahl</apex:facet>
                <apex:Outputtext value="{!KP.Auftragspositionen__c.GenAnzVerp__c}"/>
            </apex:column>

...

 

Auftragspositionen__c (orderposition) is a lookup in KV_Positionen (quotationposition).

 

My controller looks like:

...

                        KV_Positionen = [select name, KVA__c, Artikel__c, Auftragsposition__c, Verkaufspreis__c,
                                                        MWSt_1__c, MWSt_2__c, KK_Preis__c, gesetzl_zuzahlung__c, wirtschaftl_zuzahlung__c
                                                        from KVA_Position__c where Auftragsposition__c = :Apos.Id];

...

public KVA_Position__c[] getKV_Positionen()
{
                system.debug ('KV_pos: ' + KV_Positionen);
                return KV_Positionen;
}

 

I always get the error

Invalid field Auftragspositionen__c for SObject KVA_Position__c

 

If I try it with Auftragspositionen__r I get also an error.

 

Thanks in advance

Harry

Hi All,

 

I'm very brand new to apex coding and need a little help creating a trigger that will update a picklist field (Occupied_Status__c) from one custom object (Inspection_Checklist__c) to another custom object (Property_Evaluation__c) only when another field is TRUE in the original object that is being updated (Inspection_Checklist__c.Inspection_Complete__c = TRUE).

 

Below is the code I've created so far, I might be completely off, but any help would be appreciated. Thanks in advance! 

 

Right now I'm getting the following error in line 6: Save error: unexpected token: ':'

 

 

trigger OccupancyStatus on Inspection_Checklist__c (after update) {
	
	List<Property_Evaluation__c> eval =
	    [SELECT j.Occupied_Status__c
	     FROM Inspection_Checklist__c j
	     WHERE j.Inspection_Checklist__c.Inspection_Complete__c = TRUE : Trigger.new
	      FOR UPDATE];
	      
	for (Property_Evaluation__c li: eval){
		li.Occupied_Status__c=li.Inspection_Checklist__r.Occupied_Status__c;
	}
    update eval;
}

 

 

 

 

Helllooo.

 

Wondering if someone could help me with issue I having with this trigger I am attempting to write.

 

The gist of the what I am trying to do is this:  I have a Contract ID field in salesforce on my Opportunity and on a custom object called Recon_Detail__c.  Each Recon_Detail is basically like a line item for one Contract.  My plan for this trigger is to aggregate the sum of all of the Recon_Details of one Contract ID and then write the value on the Total_Amount__c field on the Opportunity.

 

So for example, Recon_Detail 1 has a contract ID of 123123 and amount of $100, Recon Detail 2 has a contract ID of 123123 and amount of 125, Recon Detail 3 has a contract ID of 123124 and amount of $123.

 

When the Opportunity with the Contract ID of 123123 updates, then the Total Amount field should populate with the amount of $225.

 

I'm getting this error in my code: Illegal assignment from LIST<AggregateResult> to LIST<Recon_Detail__c> at line 19 column 1 (line marked in red below)

 

trigger UpdateOppReconDetail on Opportunity (before update) {

//Create a placeholder list of Contract Id's from the opportunity called oppids and
//placeholder map for contract id and total amount from recon detail called rdmap

List<string> oppids = new List<string>();
Map<string,string> rdmap = new Map<string,string>();

    //add the Opportunity contract ids that have blank Total_Amount__c field on Opportunity to the oppids list

    for(Opportunity o : Trigger.new) {
        if(o.Total_Amount__c == null){
            oppids.add(o.Contract_ID__c);
        }
    }

//Get the Contract Id and Amount of all Recon Details that are in the OppId List

List<Recon_Detail__c> rds = [SELECT Contract_ID__c, SUM(Amount__c)sum
                             FROM Recon_Detail__c
                             where Contract_ID__c IN :oppids
                             GROUP BY Contract_ID__c];

    //Create the map that will be used to update; placing Contract ID, then Amount
    
    for(Recon_Detail__c rd : rds) {
        rdmap.put(rd.Contract_ID__c, String.Valueof(rd.get('sum')));
    }

    //If the Recon_Detail__c is blank/null, then get the opportunity id (key) from the map and place it's Amount (value) in that field
    
    for(Opportunity o : Trigger.new) {
           o.Total_Amount__c = rdmap.get(o.Contract_ID__c);
    }

}

 

 

 

I am writing an apex button to invoke a class and am recieving the following error:

 

A problem with the OnClick JavaScript for this button or link was encountered:

{faultcode:'soapenv:Client', faultstring:'No operation available for request {http://soap.sforce.com/schemas/package/ProductDescription}SplitDescription, please check the WSDL for the service.', }

 

The apex class and the javascript have the same class.

Button:

// Include and initialize the AJAX toolkit library
{!REQUIRESCRIPT("/soap/ajax/26.0/connection.js")};
{!REQUIRESCRIPT("/soap/ajax/26.0/apex.js")};
var idList = {!GETRECORDIDS($ObjectType.QuoteLineItem)};
var retURL = window.location.toString();
var proceed = true;
if(idList.length == 0){
alert('Please select at least 1 record.');
proceed = false;
}
if(idList.length != 0){
var myvar = sforce.apex.execute("ProductDescription","SplitDescription",{QuotteLinetem_id:idList})
window.alert(myvar);

}

 Class un version 26.0

Global class ProductDescription {
    

    List<String> xarray = new List<String>();
    QuoteLineItem qli {get; set;}
    id idlist;
    
    public ProductDescription(ApexPages.StandardController c) {
        qli = [select id from Quotelineitem where id =: ApexPages.currentpage().getParameters().get('qli')];
        system.debug('###########qli:'+qli);
    }

   Public pageReference SplitDescription(){
   
   List<QuoteLineItem> cqli = [select id, pricebookentryid, PricebookEntry.Product2.Description
                                   from QuoteLineItem where id =:idList];

   For(Quotelineitem qli : cqli){
     xarray = qli.PricebookEntry.Product2.Description.split('\n');   
        system.debug(xarray);
   }
    Product_Description_Line__c[] split = new Product_Description_Line__c[0];
    For(String sa : xarray){
           split.add(New Product_Description_Line__c(quote__c = cqli[0].quoteid,
                    Quote_Line_Item__c = cqli[0].id,
                    Description_Line__c = sa
                    ));

   insert split;

  }
  return null;
  }
}

 What am I doing wrong and how do I solve the error?

 

Thank you

Trying to do soe simple data querying and show to visualforce page.

Here is the VisualForce page:

 

 

<apex:page controller="MyController" > 
  <apex:pageBlock title="Accounts">

<apex:outputPanel >
    <apex:dataTable value="{!myAccounts}" var="aAccount" width="100%" >
     <apex:column >
      <apex:facet name="header"><b>Id</b></apex:facet>

      {!aAccount.Id}
     </apex:column>
     
 <apex:column >
      <apex:facet name="header"><b>Name</b></apex:facet>

      {!aAccount.Name}
     </apex:column>
   </apex:dataTable>                
</apex:outputPanel>




  </apex:pageBlock> 
</apex:page>

 

 

here is the custom controller 'MyController'

 

 

public class MyController {

      public List<Account> getMyAccounts(){
          return [select Id, Name from Account];
      }

     

      
}

 The column headers show up but the data is not coming in. I do have records, so not sure why this isn't working?

 

I want to pass the ID of the Contact from my VisualForce Email Template up to the Controller, via the Custom Component, so that the Controller can query Events for just this Contact.  However, I seem to be getting stuck at Component to Controller.

 

Per the VF Developer's Guide, under "Custom Component Controllers", step 3 says, "In the <apex:attribute> tag in your component definition, use the assignTo attribute to bind the attribute to the class variable you just defined."  However, I am finding this never sets the value in the Controller - just within the Component.  Is the Guide wrong or do I have an error?

 

Here is a snippet of the Component code:

 

<apex:component controller="EmailApptController" access="global">

    <apex:attribute name="ToID" type="ID" description="the account ID" assignTo="{!contactID}"/>
    <apex:attribute name="Something" type="String" description="something to assign" assignTo="{!something}"/>

 

 

And the relevant Controller:

 

public class EmailApptController {
	public List<Event> appts {get; set;}
	public String message {get; set;}
	public ID contactID {get; set;}
	public String something {get; set;}
	
	public EmailApptController() {
		datetime yaynow = datetime.now();
		appts = [SELECT WhoId, WhatId, OwnerId, Subject, StartDateTime, Result__c, Confirmation_Status__c, Location_Map_URL__c, Location__c, Location_Address__c, Location_City_State_Zip__c, Location_Directions__c, Location_Directions_2__c
					FROM Event
					WHERE WhoId = :contactID
					AND StartDateTime >= :yaynow
					AND Result__c != 'Cancelled'
					AND Result__c != 'Rescheduled'];
					
		if (appts.isEmpty()){
        	message = 'There are no pending appointments for this client: ' + contactID + ' and something is: '+ something;
        }
	}
	
}

 

 

contactID and 'something' always return null from the controller, but when I access them in the Component they are fine.

 

I have found this post in the wiki re Controller Component Communication, but it's way over my head and seems overkill if all I want to do is grab this one ID.  Any thoughts?

 

 

  • February 15, 2011
  • Like
  • 1

I am trying to loop through a list of team members on an opportunity and am having troubles. Here's the piece that isn't working how I need it to:

 

        for (Opportunity opp : tNewMap.values()) {

 

//This code section works, but obviously really bad for bulk loads

                List<OpportunityTeamMember> oppMembers = [SELECT UserId FROM OpportunityTeamMember WHERE OpportunityId =: opp.Id];      
                for (OpportunityTeamMember otm : oppMembers) {

 

 

//This doesn't work and I'm not sure why
                for (OpportunityTeamMember otm : opp.OpportunityTeamMembers) {

 

 

Any advice?

  • February 07, 2011
  • Like
  • 0

Hi,

 

I want to sort Map.In Map i have Account type of key and class.

eg. public Map<Account,Total>totalMap;

 

i want to sort in basis of my class data my class looks like-: 

Public class Total

{

private sum{get;set}

 

}

 

i want only 5 records in Assending order.

 

Please help!!!!

 

  • February 05, 2011
  • Like
  • 0

Is it possible to write a trigger on OpportunityTeamMember object?

 

-Thanks

  • January 15, 2011
  • Like
  • 0

Hey all,

 

Say I have a map of Ids, and lists. Like so

 

Map<Id, List<Id>> CampaignAccountIdMap = new Map<Id, List<Id>>();

 

Then I want to populate map with data from a query.

 

         for (Respondent__c r :[select Id,
                                                   Respondent__r.AccountID,
                                                  Master_Campaign__c
                                                  From Respondent__c
                                                  Where Master_Campaign__c in :CampaignIds])
        {
            CampaignAccountIdMap.put(r.Master_Campaign__c,r.Respondent__r.AccountID);
        }   

 

Normally to add something to a list it would be listname.add(value)

but a list contained within the map doesn't really have a name? How would I populate my CampaignAccountIdMap with the id's of the campaign, and a list of account IDs?

HI Every one,

 

   I am creating account and contact for a user with a trigger. After creating an account, I am getting that account Id and creating contact for that user. Here I am using Maps to do this (ContactRec.accountid=Map_Account_To_Id.get(c.Organization_Name__c);). This is working well.

 

But the problem is, when I click on contact Name to view, its redirecting to accounts page. I am unable to view the contact.

 

How to avoid this. Please help me.

 

Thanks

Hello,

I need a simple trigger that will populate a lookup field on my Account object called Grouping__c (looks up to custom Client_Group__c object).

 

When an account is created or updated and the Grouping__c lookup field is not populated, I need the trigger to automatically populate it with a specific Client_Group__c record, named UNGROUPED.

 

I cannot figure out how to write the trigger without referencing the specific record id for the UNGROUPED record.

 

Here is what I have started (which is totally wrong), but I've tried it several ways with no luck.

 

Can someone help me re-write this please?  I know it can't be that hard to write, but I'm going in circles with it.

 

trigger AutoCltGroup on Account (before insert, before update) {
  LIST<Client_Groups__c> CGs = [Select ID From Client_Groups__c
          Where Name='UNGROUPED']; 
 
  for (Account a : Trigger.new) {
    if(a.Client_Group__c==null){
      a.Client_Group__c = 'a0F70000005bzBa';    --this is what I want to avoid (hardcoding the id into the trigger)
    }
  }
}

I can call System.schedule() to schedule a job.

 

Is there any way to query the job list and delete jobs programmactically from Apex?

 

Hi

 

I am facing problem in updating a field from TMS__Time__c  to Sales_Order_Item__c

 

I had written this code,but this is not working.

trigger updatesalesorderitem on TMS__Time__c (before insert, before update)
{List<Sales_Order_Item__c> updateList = new List<Sales_Order_Item__c>();
for(TMS__Time__c co : Trigger.new){
Sales_Order_Item__c sa = [SELECT Comments__c FROM Sales_Order_Item__c WHERE Id = :co.TMS__Comments__c];

if(sa.Comments__c == null || sa.Comments__c ==''){
sa.Comments__c = co.TMS__Comments__c;

updateList.add(sa);
}
}
if (updateList.size() > 0) update updateList;
}

 As this code worked for to update field.But i am facing problem in SOQL query .Plz check and update me.

 

Thanks

 

Nasir

 

  • December 21, 2010
  • Like
  • 0

Hi,

 

I am trying to use the addFields() method of the standardcontroller, But I am unable to use it as it is give a compilation error:

ErrorError: Compile Error: Method not yet implemented at line 6 column 17

 

I got the reference from the Apex developer guide. 

 

 

 

public TestAddFieldsMethod(ApexPages.StandardController controller)
            {
                List<String> fields = new List<String>{'Name'};
                controller.addFields(fields);
            }
Is this method exists or not?
Regards,
Bhawani

 

  • December 21, 2010
  • Like
  • 0

01/2010 - Customer 1Customer 1Hello... sorry but i dont know if this is the best Board to post my question.

 

Well... actually i need to create a table getting datas from a map...

 

 

private List<MovimentoMes__c> movimentosClientes = [Select m.Vendedor__r.Name, m.Cliente__r.cliente__c, m.Cliente__r.campoLivreAlt__c ,											 m.Cliente__r.municipio__c , m.Cliente__r.uf__c ,m.Mes_de_Referencia__c, m.Valor__c									    From MovimentoMes__c m];
	
	public void mapClienteValorMeses(){
		
		clienteFaturamentoMes = new Map<String,Map<String,Double>>();
	
		for(MovimentoMes__c movimento: movimentosClientes){
			
			cliente = movimento.Cliente__r.cliente__c;
			mesDeReferencia = movimento.Mes_de_Referencia__c;
			valorMesReferencia = movimento.Valor__c;
			
			if(clienteFaturamentoMes.containsKey(cliente)){
				
				faturamentoMes = clienteFaturamentoMes.get(cliente);
				
				if(faturamentoMes.containsKey(mesDeReferencia)){
					totalMes = faturamentoMes.get(mesDeReferencia);
					totalMes += valorMesReferencia;
					faturamentoMes.put(mesDeReferencia,totalMes);
				}else{					
					faturamentoMes.put(mesDeReferencia,valorMesReferencia);					
				}
		
			
			} else {
				
				faturamentoMes = new Map<String,Double>();
				faturamentoMes.put(mesDeReferencia,valorMesReferencia);	
				
				clienteFaturamentoMes.put(cliente,faturamentoMes);
			}
		}
		
	}

Explaining the code above.

My external map receive a customer (String) as Key, and an Map(String,Double) as Value, and the Internal Map Receive a Month of Purchase(String) as Key and a Value of Purchase(Double) as Value.

 

So where is my problem....

 

Considering 12 month (Not exactly all months of the same year)... some customers bought something on month 01, 02, 03, and another bought something on month, 04,06,08...

 

I know exactly the12 month period, where it begin and where it end...

 

What i need to do is something like it:

 

A table where the first column is the name of the customer...the first row is the header with all the month period... 

But i said before some customers doesnt buy all months... and this data will not exist at Map... so if one customer doesnt buy one month... at table this need to appear with 0, how i can do it?

 

Well sorry about my english =)

 

Very thanks for everything!


Hello,

 

I am new at this so please bare with me but I am trying to create an Apex class with a query in a custom object.

 

The custom Object is called "SIM"

 

 

I basically want to use a For loop to sum a field for all records under this object that have the same two fields

 

The two fields are called:

 

"Account" which is a masterdetail relationship lookup field to the Standard Account Object

"Item" which is a masterdetail relationship lookup field to a Custom Object called "INV"

 

However to do this I need to first retrieve the account ID or name.  I tried somehting like this:

 

String accountId = SIM__c.Account__c.getId();

and I got this error:

 

ErrorError: Compile Error: Method does not exist or incorrect signature: [Schema.SObjectField].getId()

Any Ideas?

 

I think the code would be different for the two since one is Master/detail lokup to a standard object and the other to a custom object.  I need help for both of them.

 

Thanks in advance!!

 

 

I just tried to deploy a trigger to production and it failed because of another simple trigger I have.  The error message I received was:

Failure Message: "System.LimitException: Too many SOQL queries: 21", Failure Stack Trace: "Trigger.AutoCltGroup: line 2, column 32"

 

The trigger that is causing the error message is really simple, it just populates a lookup field on account if it's null.  I've posted the trigger code below and the line giving the error  is in red.  How can I rewrite it so that I don't get the error messsage?  Please help!!

 

trigger AutoCltGroup on Account (before insert, before update) { 
  LIST<Client_Groups__c> CGs = [Select ID From Client_Groups__c
          Where Name='UNGROUPED'];  

  
  for (Account a : Trigger.new) { 
    if(a.Client_Group__c==null){
      a.Client_Group__c = 'a0F70000005bzBa'; 
    }
  }
}

Firstly, this question requires a bit of introduction so please bear with me.

 

The high level is that I am connecting to a outside web service which will return some XML to my apex controller. The format will look something like this:

 

 <Wrapper>
	<reportTable name='table_id' title='Report Title'>
      <row>
        <Element1><![CDATA[Activewear_2010_Campaigns]]></Element1>
        <Element2><![CDATA[577373]]></Element2>
        <Element3><![CDATA[4129]]></Element3>
        <Element4 dataFormat='2' dataSuffix='%'><![CDATA[0.7151]]></Element4>
        <Element5><![CDATA[2010-04-04]]></Element5>
        <Element6><![CDATA[2010-05-03]]></Element6>
      </row>
    </reportTable>
	...
</Wrapper>

 

Now currently I am using the XMLdom utility class to map this data into a custom object "report" which contains a list of "row" objects.

 

From there I need to display the report in a table output to VisualForce. Something like this I think will work:

 

<table>
  <apex:repeat value="{!reportTables}" var="table">
      <apex:repeat value="{!table.rows}" var="row">
      <tr>
      	<apex:repeat value="{!row.ColumnValue}" var="column">
      		<apex:repeat value="{!column}" var="value">
      			<td>
      			<apex:outputText value="{!value}" />
      			</td>
      		</apex:repeat>
      	</apex:repeat>
       </tr>
      </apex:repeat>
   </apex:repeat>
</table>

 

Now you may be wondering why I don't use something easier to work with like apex:pageBlockTable - the reason is I need to be able to handle a data coming back that contains different number of columns. So far I haven't been able to figure out a way to have apex:pageBlockTable handle my XML without explicitly knowning each column in advance.

 

Questions are:

1) Does this seem like a good approach to the problem?

2) Is there a simpler/better way to consume the XML besides writing my own custom objects to map VF to?

 

Open to any and all suggestions. I really hope there is a better way than building the HTML table myself, as then I also have to deal with styling and alignment etc. Thanks.

 

 

 

Hello, I have a situation where I need to display information from a Child record to a Parent, which Formula Fields can't do, and the only thing I found is that a custom SControl can be made, but I know sControls are no longer supported an an Apex Trigger needs to be used instead....

Only problem is I have no idea what an Apex Trigger is or how to do this. Is it possible someone can help???

 

Here is what I'm looking to do:

-> Display values from two fields of a Contact's record - "Lead Source" picklist and "Addition Lead Sources" multi-picklist - as a text field in the contact's Account record. I'd like to include values from all Contacts associated with that Account in one field in the Account record, but only shows unique values once (no duplicate values).

For example....

(Contact 1) John Doe / (Account) Microsoft:
(Picklist) Lead Source = "Google"
(Multi-picklist) Additional Lead Source = "Webinar", "Email"

(Contact 2) Jane Smith / (Account) Microsoft:
(Picklist) Lead Source = "Referral"
(Multi-picklist) Additional Lead Source = "Google", "Email"

In Microsoft's Account record:
(Text Field) Lead Source: "Google, Webinar, Email, Referral"

 

 

If anyone could provide some guidence it would be extremely helpful! Thanks :)

Hello, I'm trying to only display certain information based on a certain criteria. For instance, in the following code, only the information within the outputfield should should if there is a value in the Hotel__c field. However, I can't seem to make that work. Can you offer any advice?

 

<outPutfield rendered="{!IF(ISBLANK(Travel_Service__c.Hotel__c), false, true)}">
     <tr>
         <td  colspan="5">HTL - {!Travel_Service__c.Hotel__c} - {!Travel_Service__c.Hotel_Confirmation_Number__c}</td>
         <td align="right" style="border-left:1px solid black;">
             <apex:outputText value="${0, number,###,##0.00}">
                 <apex:param value="{!Travel_Service__c.Hotel_Total_Cost__c}"/>
             </apex:outputtext>
         </td>
     </tr>
     <tr colspan="6" class="separator">
         <td  colspan="5"></td>
         <td style="border-left:1px solid black;"></td>
     </tr>

</outputField>

 

Edit: I have looked around the boards and found a few solutions, but none work. The closest one being as follows:

 

<outputfield rendered="{!NOT(ISBLANK(Travel_Service__c.Hotel__c))}">
     <tr>
         <td  colspan="5">HTL - {!Travel_Service__c.Hotel__c} - {!Travel_Service__c.Hotel_Confirmation_Number__c}</td>
         <td align="right" style="border-left:1px solid black;">
             <apex:outputText value="${0, number,###,##0.00}">
                 <apex:param value="{!Travel_Service__c.Hotel_Total_Cost__c}"/>
             </apex:outputtext>
         </td>
     </tr>
     <tr colspan="6" class="separator">
         <td  colspan="5"></td>
         <td style="border-left:1px solid black;"></td>
     </tr>
</outputfield>

 

Progress: I can make it so that fields are hidden when they don't have a value, but not when they do have a value, I get a 'value for outputfield is not a dynamic binding'. Any idea what that means? The new code is:

 

     <apex:outputfield rendered="{!NOT(ISBLANK(Travel_Service__c.Auto_Provider__c))}">
     <tr>
         <td  colspan="5">AUTO - {!Travel_Service__c.Auto_Provider__c} - {!Travel_Service__c.Auto_Conf__c}</td>
         <td align="right" style="border-left:1px solid black;">
             <apex:outputText value="${0, number,###,##0.00}">
                 <apex:param value="{!Travel_Service__c.Auto_Total_Cost__c}"/>
             </apex:outputtext>
         </td>
     </tr>
     <tr colspan="6" class="separator">
         <td  colspan="5"></td>
         <td style="border-left:1px solid black;"></td>
     </tr>
     </apex:outputField>

  • November 02, 2010
  • Like
  • 0

Hi,

 

If you have to take an interview of any salesforce position, what all question could you ask ?

 

Salesforce Developer - Skills -Apex , Force.com API , AppExchange, S-Control .

 

 

Please feel free to ask any questions ?

 

Thanks

Message Edited by ronir on 02-04-2009 11:51 AM
Message Edited by ronir on 02-04-2009 11:55 AM
  • February 04, 2009
  • Like
  • 0