• yvk431
  • SMARTIE
  • 550 Points
  • Member since 2009

  • Chatter
    Feed
  • 20
    Best Answers
  • 6
    Likes Received
  • 0
    Likes Given
  • 59
    Questions
  • 257
    Replies

I have a formula, number field that I would want to use fieldA or fieldB based on the following.

If the case is closed, and a time stamp field is blank, use fieldA, else use fieldB.  I thought the following code would do the trick, but I receive the following syntax error

 Error: Incorect parameter type for function 'AND()'. Expected Boolean, received Number

 

IF(
  AND(
   IsClosed,
  IsBlank(vrfctnStsHstryStmp__c),
   calcClsd__c ,
  calcCustVrfctn__c
 )
)

 

------------------------

This code works fine.

IF(
   IsClosed, ,
     calcClsd__c ,
  calcCustVrfctn__c
 )

What am I missing?

For some reason this query is not working:

 

Select RelatedSobjectId.id, CategoryNodeId.name Id From CategoryData

 

...where RelatedSobjectId is the Solution object, I cannot get data from CategoryNodeId using the dot notation neither.

 

Do you know why ?

Hi,

 

How to display a text filed dynomically when selecting a Picklist option on a VF page. For example picklist values are val1, val2 & val3, i want to display a text field only when selecting val3. I think it could be done by using actionSupport & reRender, but I never worked on actionSupport,  can any one help me how to achieve this throught actionSupport or any other approach ?.

Any help must be highly appreacted.

 

 

Thanks in advance!

  • October 08, 2012
  • Like
  • 0

Basically, my req is like this...

 

                     I have an  object named COURSE__C and it's look-up is there in STUDENT_COURSE__C object. So obviously we will get a related list of  STUDENT_COURSE__C over the detail page of  COURSE__C.

 

                     So here i want to create a button named DELETE ALL in the related list, which enables me to delete all the look-ups of a perticular course...

 

 

If it can be done, can any one guide me towards it...........!

 

 

Thanks in advance...

 

 

Hi developers,

 

I think here goes my last question about visualforce :) by now...

 

Y have my lead edit page as follows:

 

<apex:page standardController="Lead" showHeader="true">
    <apex:sectionHeader title="Edit Fiscal Information" subtitle="{!Lead.Company}"/>  
    <apex:form>
        <apex:pageBlock title="Edit Fiscal Information" id="Edit_Fiscal_Information" mode="Edit">
            <apex:pageMessages />
            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!save}"/>
                <apex:commandButton value="Cancel" action="{!cancel}"/>
            </apex:PageBlockButtons>
                <apex:pageBlockSection title="Basic Information - All fields required" columns="2">
                    <apex:inputField value="{!lead.Street_fiscal__c}" label="Street (Fiscal)*"/>
                    <apex:inputField value="{!lead.City_fiscal__c}" label="City (Fiscal) *"/>
                    <apex:inputField value="{!lead.Post_Code_fiscal__c}" label="Post Code (Fiscal) *"/>
                    <apex:inputField value="{!lead.Country_Fiscal__c}" label="Country (Fiscal) *"/>
              </apex:pageblockSection>

 Now, when I request a field, for example "!lead.Street_fiscal__c and I define the label "Street (Fiscal) *", I would like the label to be shown in blue color because this is a special field that is compulsory for a process and I want my users to detect it somehow...

 

I tried using style, but the style is apply to the contect of the Street_fiscal field, not to the label itself.

 

Can I do that somehow?

 

Thanks a lot.

 

Antonio

Hi,

 

Actually my scenario is that i have two field one is named as customer name which is lookup with account and another is account number which is a formula field after selection customer account number will automatically populated.

 

But, the scenario is that one customer having more than one account in account object so after selection the customer name ,for account name there i want some functionality either multiselect or lookup field so that in that user can select some of the account for that customer.

 

How i can implement this functionality.Please pleasr help me out from this problem.

 

Thanks in advance.

 

I see there is a sort button on the QuoteLineItems.  By default it is for the product name.

I also see on the Quote Layout Page that you can check which buttons show up (Add Line Item, Edit All, Sort).

 

But can I customize the sort.   We want to sort on 2 fields.  

 

I see another post on this forum for changing the Quote Line Item sort order (https://na9.salesforce.com/p/setup/link/CustomResourceLinkList?pageName=Opportunity&type=Opportunity&setupid=OpportunityLinks&retURL=%2Fui%2Fsetup%2FSetup%3Fsetupid%3DOpportunity)

 

It shows adding a global webservice MRsort.    This references OpportunityLineItem and to change the Opportunity_Line_Item__c to Quote_Item_Number__c.   So this sounds like I need to add a custom field to OpportunityLineItem.   But I don't see that object in salesforce?   I have Quotes and QuoteLineItems.   I have Opportunities and OpportunityProducts.    I can add the webservice but I need to reference OpportunityLineItems?

 

How do you get access to OpportunityLineItem to add a custom field?  Our system admin does not know and said that I was an admin too.   Is there some security access that I need to set to see this?

I have the following code below and can get the line items for a quote and display in a table for editing.   But I can't figure out how I can save them.

The current save button only saves the Quote.  I want to save the edited quote line items when save is clicked.  How can I do that?

 

<apex:page standardController="Quote"> 

 
  <apex:form id="EditAllQuoteLine_Form">
 
    <apex:pageBlock title="Edit Quote Line Items for {!Quote.Name}" mode="edit">
        <apex:pageBlockButtons >
            <apex:commandButton action="{!save}"   value="Save"/>
            <apex:commandButton action="{!cancel}" value="Cancel"/>
        </apex:pageBlockButtons>
  
        <apex:dataTable value="{!Quote.QuoteLineItems}" var="lines" id="theTable" rowClasses="odd,even"
                        styleClass="tableClass" cellpadding="3" cellspacing="3">      
            <apex:column headerValue=" Quantity ">
                 <apex:inputField value="{!lines.Quantity}" style="width: 50px;"/>
            </apex:column>
            <apex:column headerValue="  Product  " style="align: center;">
                 <apex:inputField value="{!lines.ProductName__c}" style="width: 150px;"/>
            </apex:column>            
            <apex:column headerValue=" List Price ">
                 <apex:inputField value="{!lines.ListPrice}"/>
            </apex:column>     
            <apex:column headerValue=" Sales Price " style="width: 70px;">
                 <apex:inputField value="{!lines.UnitPrice}" style="width: 50px;"/>
            </apex:column>  
            <apex:column headerValue=" Renew? ">
                 <apex:inputCheckbox value="{!lines.Renew__c}" onclick="renewClicked(this)" />
            </apex:column>
            <apex:column headerValue=" Prorate? ">
                 <apex:inputCheckbox value="{!lines.Prorate__c}" disabled="true"/>
            </apex:column>
            <apex:column headerValue="Begin Date">
                <apex:inputField value="{!lines.BeginDate__c}"  rendered="{!lines.Renew__c}"/>
            </apex:column>
            <apex:column headerValue="End Date">
                <apex:inputField value="{!lines.EndDate__c}" rendered="{!lines.Prorate__c}"/>             
            </apex:column>
            <apex:column headerValue=" Period ">
                 <apex:outputField value="{!lines.Period__c}"/>
            </apex:column>                                           
        </apex:dataTable>
        
    </apex:pageBlock>
  </apex:form>
</apex:page>

The addError() behavior in a before delete trigger results in a message on the Home tab:

 

Validation Errors While Saving Record(s)

There were custom validation error(s) encountered while saving the affected record(s). The first validation error encountered was .Contacts cannot be deleted

 

 

I want it to stay on the same tab as the delete button and display at the top in red like this

 

                              Error: Invalid Data.
Review all error messages below to correct your data.
                      Contacts cannot be deleted

 

Note that addError() in a before insert trigger does put the message in red at the top (when not specifying a field)

 

Here is my simple before delete trigger code:

 

trigger contactDeleteTrigger on Contact (before delete)
{
     for (Contact c: Trigger.old)
     {
         c.addError('Contacts cannot be deleted');
     }
}



Hi All

 

I am trying to write a class where change in child object field will change a field on Parent Object .

I will have to then schedule the same.

 

I am not sure if my logic is right. I am first querying all the Child records. and putting if statement in my database.execute to check for the field change.

Child object : BigMachines__Quote__c looks up to Opportunity

if  BigMachines__Quote__c.status__c = *unison* then Opportunity.stagename = closed won.

I have written following so far. Kindly help .

global class updateOpportunityStage implements Database.Batchable<sObject>,Schedulable{
global string query = 'SELECT id,BigMachines__Status__c from BigMachines__Quote__c ';



global database.querylocator start(Database.BatchableContext BC){


     //List<BigMachines__Quote__c> quoteList= new List<BigMachines__Quote__c>();
//BigMachines__Quote__c bmq = [Select id,BigMachines__Status__c from BigMachines__Quote__c where BigMachines__Status__c = '*unison*'];
    return Database.getQueryLocator(query);    
}
    global void execute(SchedulableContext SC){
        updateOpportunityStage stg = new updateOpportunityStage();
        database.executebatch(stg);
        
    }

global void execute(Database.BatchableContext BC, List<sObject> scope){

     
                List <Opportunity> oppList = new List<Opportunity>() ;
        for(sObject s : scope){
        
        BigMachines__Quote__c quote = (BigMachines__Quote__c)s;
        System.debug('Adil'+quote);
        
        for (List< BigMachines__Quote__c> bmq :[SELECT id,BigMachines__Status__c from BigMachines__Quote__c ]){
        
         if(quote.BigMachines__Status__c.contains ('unison') &&  quote.BigMachines__Is_Primary__c == true ){

        Opportunity opp = [select id, StageName from Opportunity where id=:quote.id];
         opp.stageName = 'Closed Won' ;
        
    }
    update oppList;
    }
    
    }
    }
  global void finish(Database.BatchableContext BC){}  

}

 Thanks in Advance

i create the trigger for convert the records from account obejct to contact object. condition is

 if(a1.Group_Admin_Name__c != null ){

}

 

1.account object  contain Group_Admin_Name__c field. once fils the records in account object that time fills the value in GroupAdminName field. then converted records from account to contact. but records displayed in contact object two times.this is the problem

2.i created update trigger also.once edit the account record then fills the GroupAdminName click on save buttn records will be converted to contact object.this one working properly.

 

Trigger:

======

 

trigger ConvertQualifiedCasetoContact on Account (after insert, after update) {
    
   if(Trigger.isInsert){
      List<Account> acc = new List<Account>();
      List<Contact> con = new List<Contact>();
      List<ID> AID = new List<ID>();
   
   for(Account ac:Trigger.New){
       acc.add(ac);
       AID.add(ac.id);
   }
   for(Account a:acc) {
       Contact c = new Contact();
       if(a.Group_Admin_Name__c != null){
          c.LastName = a.Group_Admin_Name__c;
          c.Email = a.Group_Admin_Email__c;
          c.Phone = a.Group_Admin_Phone__c;
          c.AccountId = a.ID;
          con.add(c);
         }
       }
       insert con;
   }
   
    if(Trigger.isUpdate){
       List<Account> acc = new List<Account>();
       List<Contact> con1 = new List<Contact>();
       set<ID> aid = new set<ID>();
       for(Account ac:Trigger.old){
           acc.add(ac);
           aid.add(ac.id);
       }
       
     for(Account a:acc){
         Account a1 = [Select id,Group_Admin_Name__c,Group_Admin_Email__c,Group_Admin_Phone__c   from Account where id in :aid];
         Contact c = new Contact();
         if(a1.Group_Admin_Name__c != null ){
            c.LastName = a1.Group_Admin_Name__c;
            c.Email = a1.Group_Admin_Email__c;
            c.Phone = a1.Group_Admin_Phone__c;
            c.AccountId = a.ID;
            con1.add(c);
           }
        }
        update con1;
    }
 }

 

pls help me.........

  • January 03, 2012
  • Like
  • 0

i have a status picklist with different statuses for each campaign. while i only want to see the picklist values associated with the campaign member's campaign, I also want to see the current picklist value for each record / campaign member. Currently all of the listed campaign member statuses are set to sent, the default value. How do I change this.

 

Here is the code controlling the picklist values:

 

    public List<SelectOption> getcStatus(){
         List<SelectOption> options = new List<SelectOption>();
             options.add(new SelectOption(campaignmember[0].status, campaignmember[0].status));
             for(CampaignMemberStatus ccm:[select id, Label from CampaignMemberStatus where  Campaignid in 
                 (select campaignid from CampaignMember where Campaign_Name__c =:selectedcval) and Label != :statusupdate]){
                 options.add(new SelectOption(ccm.id, ccm.label));
             }
         return options;
        }

  Here is the complete apex class:

public with sharing class CampaignListOwner13{

    public CampaignListOwner13() {

    }

        List<SelectOption> selectedOwnerList = new List<SelectOption>();
        Map<id, String> mappingval = new Map<id, String>();
        Map<String, String> mappingcval = new Map<String, String>();
        Map<String, String> mappingsval = new Map<String, String>();
        public Map<String, String> localCStatusMap;
        public String selectedval { get;  set;}
        public String selectedcval { get;  set;}
        public String selectedsval { get;  set;}
        public string statusval { get; set;}
        public string statusUpdate   {get; set;}
        public string campaignStatus {get; set;}
 
    public CampaignListOwner13(ApexPages.StandardController controller) {   }
    public String getCampaign() {
        return this.Campaign;
    }
    public String getCampaignStatus() {
        return this.CampaignStatus;
    }    
    public string s;
    public String campaign;
    public transient string               Campaignid{ get; set;}
    private transient CampaignMember[]    members; //the members for that campaign
    public transient String               owner; //owner ID
    public string getOwner() {
        return this.owner;
    }    
    public void setOwner(String s) {
 this.Owner = s; }
  public List<CampaignMember> CampaignMember { get;  set;}
     public List<SelectOption> getselectedOwner(){
         List<SelectOption> optionList = new List<SelectOption>();
            optionList.add(new SelectOption( '1', 'SELECT' ));
            for(User u:[select id,name from user where id in (select ownername__c from campaignmember) order by name]) {
            optionList.add(new SelectOption(u.id, u.name));
            mappingval.put(u.id, u.name);
        }
            return optionList;
        }      
    public List <SelectOption> getcampaignlists(){
system.debug('SFDC TEST ************ OWNER' + Owner);
system.debug('SFDC TEST1 *************' + selectedVal);

            AggregateResult[] groupedResults = [select Campaignid , Campaign_Name__c from campaignmember where 
                        ownername__c=:selectedval group by Campaignid, Campaign_Name__c ];
        List <SelectOption> optionList = new list<SelectOption>();
        optionList.add(new SelectOption( '1', 'SELECT' ));
        system.debug('SFDC TEST2 *************' + selectedVal);
        if(selectedcval!= null){
    for(Aggregateresult ar :groupedResults) {
            optionList.add(new SelectOption(String.valueof( ar.get('Campaign_Name__c')), String.valueof(ar.get('Campaign_Name__c'))));
            String aID = (string)ar.get('Campaign_Name__c');
            mappingcval.put(aID, aID);
            }
        }
        return optionList;
    }
    public List <SelectOption> getstatuslist(){
system.debug('SFDC TEST ************ OWNER' + Owner);
system.debug('SFDC TEST3 *************' + selectedVal);
            AggregateResult[] groupedResults = [select Status from campaignmember where 
                        ownername__c=:selectedval and Campaign_Name__c=:selectedcval group by Status ];
        List <SelectOption> optionList = new list<SelectOption>();
        optionList.add(new SelectOption( '1', 'SELECT' ));
        system.debug('SFDC TEST4 *************' + selectedVal);
        
        system.debug('SFDC TESTold *************' + selectedVal);
        
        if(selectedval!= null){
    for(Aggregateresult ar :groupedResults) {
            optionList.add(new SelectOption(String.valueof( ar.get('Status')), String.valueof(ar.get('Status'))));
            String sID = (string)ar.get('Status');
            mappingsval.put(sID, sID);
            }
        }
        return optionList;
    }
    public List<SelectOption> getcStatus(){
         List<SelectOption> options = new List<SelectOption>();
             options.add(new SelectOption(campaignmember[0].status, campaignmember[0].status));
             for(CampaignMemberStatus ccm:[select id, Label from CampaignMemberStatus where  Campaignid in 
                 (select campaignid from CampaignMember where Campaign_Name__c =:selectedcval) and Label != :statusupdate]){
                 options.add(new SelectOption(ccm.id, ccm.label));
             }
         return options;
        }


    public PageReference campaignRefresh() {       
              system.debug('$$$$$:'+selectedcval);
              system.debug('SFDC TEST5 *************' + selectedVal);
              system.debug(mappingval.get(selectedval));
              system.debug('SFDC TEST6 *************' + selectedVal);
               try {
                 if( selectedval != '1'){
                   
                    CampaignMember = [select Id, owner_Name__c, Campaign_Name__c, ContactId, LeadId, 
                    Status, Lead.Lead_Salutation_Name__c, Country__c, CampaignId, Campaign.Name, Company__c,
                    Lead.Id, Lead.Salutation, Lead.Title, Lead.Name, Lead.Company, Lead.Phone,
                    Lead.Street, Lead.State, Lead.PostalCode, Lead.Country, Lead.City, Lead.Fax, 
                    Lead.Email, Lead.OwnerId, Lead.Owner.FirstName, Lead.Owner.LastName, Lead.Owner.Id,
                    Contact.ID, Contact.AccountId, Contact.Salutation, Contact.Title, Contact.Name,
                    Contact.Phone, Contact.MailingStreet, Contact.MailingState, Contact.MailingPostalCode, 
                    Contact.MailingCountry, Contact.MailingCity, Contact.Fax, Contact.Email, Contact.OwnerId,
                    Contact.Owner.FirstName, Contact.Owner.LastName, Contact.Owner.Id, Contact.Account.name,
                    Log_A_Call_Notes__c, Contact.Contact_Salutation_Name__c, Title__c, Email__c, Phone__c from
                        Campaignmember where owner_Name__c =: mappingval.get(selectedval) limit 99];
                        
                   }
                     
                   if (selectedcval != '1' & selectedval != '1' )
                    {
                      CampaignMember = [select Id, owner_Name__c,Campaign_Name__c , ContactId, LeadId, Status, 
                        Lead.Lead_Salutation_Name__c, Country__c, CampaignId, Campaign.Name, Company__c,
                        Lead.Id, Lead.Salutation, Lead.Title, Lead.Name, Lead.Company, Lead.Phone,
                        Lead.Street, Lead.State, Lead.PostalCode, Lead.Country, Lead.City, Lead.Fax, 
                        Lead.Email, Lead.OwnerId, Lead.Owner.FirstName, Lead.Owner.LastName, Lead.Owner.Id,
                        Contact.ID, Contact.AccountId, Contact.Salutation, Contact.Title, Contact.Name, 
                        Contact.Phone, Contact.MailingStreet, Contact.MailingState, Contact.MailingPostalCode, 
                        Contact.MailingCountry, Contact.MailingCity, Contact.Fax, Contact.Email, Contact.OwnerId,
                        Contact.Owner.FirstName, Contact.Owner.LastName, Contact.Owner.Id, Contact.Account.name,
                        Log_A_Call_Notes__c, Contact.Contact_Salutation_Name__c, Title__c, Email__c, Phone__c from
                        Campaignmember where owner_Name__c =: mappingval.get(selectedval) and
                        Campaign_Name__c =: mappingcval.get(selectedcval) limit 99];  
                    }
                    system.debug('SFDC TEST10 *************' + selectedVal);        
                   if(selectedsval != '1' && selectedcval != '1' && selectedval != '1')
                    {
                    CampaignMember = [select Id, owner_Name__c, Campaign_Name__c, ContactId, LeadId, Status, 
                        Lead.Lead_Salutation_Name__c, Country__c, CampaignId, Campaign.Name,Company__c,
                        Lead.Id, Lead.Salutation, Lead.Title, Lead.Name, Lead.Company, Lead.Phone,
                        Lead.Street, Lead.State, Lead.PostalCode, Lead.Country, Lead.City, Lead.Fax, 
                        Lead.Email, Lead.OwnerId, Lead.Owner.FirstName, Lead.Owner.LastName, Lead.Owner.Id,
                        Contact.ID, Contact.AccountId, Contact.Salutation, Contact.Title, Contact.Name, 
                        Contact.Phone, Contact.MailingStreet, Contact.MailingState, Contact.MailingPostalCode, 
                        Contact.MailingCountry, Contact.MailingCity, Contact.Fax, Contact.Email, Contact.OwnerId,
                        Contact.Owner.FirstName, Contact.Owner.LastName, Contact.Owner.Id, Contact.Account.name,
                        Log_A_Call_Notes__c, Contact.Contact_Salutation_Name__c, Title__c, Email__c, Phone__c from
                       Campaignmember where  status =: mappingsval.get(selectedsval) limit 99];
                       system.debug('SFDC TEST11 *************' + selectedVal);   
                    }    
               }catch( Exception e ){
                ApexPages.addMessages( e );
            }     
             system.debug('##################' + CampaignMember);
             system.debug('SFDC TEST12 *************' + selectedVal);   
             return null;
    }
    
    List<CampaignMember> results;
    
    PageReference pageRef = new PageReference('/apex/AExcel');
    public PageReference campaignExport(){
             results= [select Id, owner_Name__c,Campaign_Name__c , ContactId, LeadId, Status, 
                        Lead.Lead_Salutation_Name__c, Country__c, CampaignId, Campaign.Name, Company__c,
                        Lead.Id, Lead.Salutation, Lead.Title, Lead.Name, Lead.Company, Lead.Phone,
                        Lead.Street, Lead.State, Lead.PostalCode, Lead.Country, Lead.City, Lead.Fax, 
                        Lead.Email, Lead.OwnerId, Lead.Owner.FirstName, Lead.Owner.LastName, Lead.Owner.Id,
                        Contact.ID, Contact.AccountId, Contact.Salutation, Contact.Title, Contact.Name, 
                        Contact.Phone, Contact.MailingStreet, Contact.MailingState, Contact.MailingPostalCode, 
                        Contact.MailingCountry, Contact.MailingCity, Contact.Fax, Contact.Email, Contact.OwnerId,
                        Contact.Owner.FirstName, Contact.Owner.LastName, Contact.Owner.Id, Contact.Account.name,
                        Log_A_Call_Notes__c, Contact.Contact_Salutation_Name__c, Title__c, Email__c, Phone__c from
                        Campaignmember where owner_Name__c =: mappingval.get(selectedval)limit 99];
      return pageref;
    }    
}

 Visualforce Page

<apex:page standardcontroller="CampaignMember" extensions="CampaignListOwner13" showheader="true" sidebar="false">
  <apex:sectionHeader title="Campaign Lead Management" />
  <apex:form id="calls">  
    <apex:pageBlock >

        <apex:outputpanel layout="block">
            <apex:outputText >Owner: </apex:outputText>  
             
        <apex:selectList value="{!selectedval}" size="1">
          <apex:selectOptions value="{!selectedOwner}"/>
          <apex:actionSupport event="onchange" status="counterStatus" action="{!campaignRefresh}" rerender="campPck,calls,calls, 
                  status, callList, owners, goToCampaign"/>
</apex:selectList>
</apex:outputpanel>
        <apex:outputpanel layout="block" id="campPck">

            <apex:outputText >Campaign:</apex:outputText>        
        <apex:selectList value="{!selectedcval}" size="1"> 
          <apex:selectOptions value="{!campaignLists}"/>
            <apex:actionSupport event="onchange" status="counterStatus" action="{!campaignRefresh}" 
                rerender="campPck,calls,calls, status, callList, owners, goToCampaign"/>
</apex:selectList>
<br/>
            <apex:outputText >Status:</apex:outputText>        
        <apex:selectList value="{!selectedsval}" size="1"> 
          <apex:selectOptions value="{!statuslist}"/>
            <apex:actionSupport event="onchange" status="counterStatus" action="{!campaignRefresh}" 
rerender="calls, status, callList, owners, goToCampaign"/>
</apex:selectList>
      </apex:outputpanel>
            <apex:outputPanel layout="block" style="float: right; padding-right: 5px; padding-bottom: 5px">
             <apex:commandButton value="Export to Excel" action="{!campaignExport}"/>
             <apex:commandButton value="Update All" action="{!save}"/>  
            </apex:outputPanel>
        <apex:outputPanel layout="block">

            <apex:outputPanel layout="block" style="clear: both;">
            </apex:outputPanel>
        </apex:outputPanel>
           <apex:actionStatus id="counterStatus">
              <apex:facet name="start">  
                <apex:outputPanel id="processing">
                  <apex:pageMessage title="Processing..." severity="info" strength="2" rendered="true" />
                  
                  <apex:image id="loader" url="{!URLFOR($Resource.CampaignCallDown, '/images/loaderImage.gif')}"/>
                </apex:outputPanel>  

              </apex:facet>

              <apex:facet name="stop">
              
                    <apex:pageBlockTable value="{!CampaignMember}" var="members" id="calls">
                     <apex:column value="{!members.Owner_Name__c}" headerValue="Owner" 
                         rendered="true" />
                     <apex:column value="{!members.Campaignid}" headerValue="Campaign" 
                         rendered="true" />
                     <apex:column value="{!members.Country__c}" headerValue="Country" 
                         rendered="true" />
                     <apex:column value="{!members.leadid}" headerValue="Name" 
                         rendered="true" />
                     <apex:column value="{!members.Title__c}" headerValue="Title" 
                         rendered="true" />
                     <apex:column value="{!members.Country__c}" headerValue="Country" 
                         rendered="true" />
                    <apex:column headerValue="Status">
                           <apex:selectList size="1" value="{!statusupdate}" multiselect="false">
                           <apex:selectOptions value="{!cStatus}"/>
                           </apex:selectList>                    
                    </apex:column>
                     <apex:column headerValue="Notes">
                            <apex:inputTextarea value="{!members.Log_A_Call_Notes__c}" cols="25" rows="1" onFocus="this.rows=3;" onBlur="this.rows=1" />
                            <br />
                        </apex:column> 
                     <apex:column value="{!members.Email__c}" headerValue="E-mail" 
                         rendered="true" />
                     <apex:column value="{!members.Phone__c}" headerValue="Phone" 
                         rendered="true" />
                      

                    </apex:pageBlockTable>
                   </apex:facet>
                  </apex:actionStatus>
 
  </apex:pageBlock>     
</apex:form>
</apex:page>

 Thank you for your assistance

Hi All,

I dont know how to put it, I am given with this crazy idea to build an custom visual force page for the auto selection of the products/services based on comparions of the inputs given on opportunity. Meaning the comparision between the inputs needs to be varied by the users in a timely fashion and apex should not hard code the comparisions , instead it should get the comparision criteria from a different object's records so as to allow the users to change them from time to time.

Before starting on anything, I just wanted to make sure that apex code can handle this kind of scenario. Please let me know.

--yvk
  • October 20, 2015
  • Like
  • 0
Hi All,

I have been asked to customize the login screen of our community portal. As a part of this I need to implement the checkbox feature "Remember Username" as well. Any one knew about this ? could you please explain the work around or the possibilities.

Thanks,
--yvk
  • September 02, 2015
  • Like
  • 0
Hi All,

Need your help in implementing parallel approval process. Let say after submission 4 approvers will be assigned for a single step,  each approval should trigger its own approver again irrespective of the pending approvals. I know this is not possible using out of box approvals, just wondering anyone implemented this already or knew the work around. Please post your ideas/suggestions. 

Thanks,
yvk

Hi All,

 

I have encountered with a typical design decision.

 

We have 2  objects A,B (A parent to B) with  lookup relation for more than 2 years, all of a suddent our client wanted to make some  changes , the main part of which is to make the child parent to its existing parent. so now B becomes parent to A . Did anyone used this kind of reverse relation , if so will it cause any troble on the long run? the main idea is to eliminate the redundancay as we have to maintain the old relationship for the old data. Also many of the functionalities on the individual objects will remain the same.

 

--yvk

  • August 22, 2013
  • Like
  • 0

Hi Guys,

 

We have a custom button on a detail page which is used for custom clone and should be acccessible only for user that are assigned with a specific permission set. When I try to achieve this using

var permissionsetid = sforce.connection.query("select id,label from PermissionSet where Label = " + "\'" + "permissionset name" + "\'");

 

The system throwing 

 

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

{faultcode:'sf:INVALID_TYPE', faultstring:'INVALID_TYPE: sObject type 'PermissionSet' is not supported.', detail:{InvalidSObjectFault:{exceptionCode:'INVALID_TYPE', exceptionMessage:'sObject type 'PermissionSet' is not supported.', row:'-1', column:'-1', }, }, }

 

Can anyone let me know that can we achieve this through script, I already thought of a workaround to redirect user to a page from where I can query permissionsets and validate the logged in user.

 

--yvk

 

  • April 26, 2013
  • Like
  • 0

Hi ,

 

I am trying to implement the custom dependency for a couple of picklists and wanted to have standard for the remaining picklists: I am able to achieve it partially but the major concern was when I hit Save command button, the required validations are not working, i am calling action as well as oncomplete in which I am refreshing the parent page and closing the current page. Every time the page was closing ofcourse the save was not happening so the validation was working but before it gets displayed the page was getting closed.

 

I am able to view validation only when I remove the oncomplete action on command button, tried using immidiate="false" , still no luck. Tried using action function too.

 

I am using standard controller with an extension.

 

<apex:commandButton value="Save" action="{!SaveOppty}" oncomplete="javascript&colon;savepage();" immediate="false" />

<script>

function savepage()
       {
         
           window.opener.location.href="/{!$CurrentPage.parameters.id}";
           self.close();
       }

</script>

 

--yvk

 

 

  • October 08, 2012
  • Like
  • 0

HI,

 

I have a requirement to customize few picklists as there were lot of lovs which exceeded the actual limit . FOr now I am fetching the lovs from the object records by querying and assigining the to the custom select options on VFP. But my problem is there are few other dependant picklist which are conditionally manadatory. So is there a way to make the dependant picklists conditionally mandatory on visual force page.

 

--yvk.

  • October 02, 2012
  • Like
  • 0

Hi,

 

I am sirprised to see this error on my visual force page which is used to customize the Sales Team functionality. The same was working fine for last few months . There was no reference to the currencyIsoCode both in page/controller as well. I guess this has some thing to do with the recent updated to the Sales Team object. But I am unable to find out the exact issue. Did any one came across or knew about this. Please help me out.

 

 

--yvk

  • September 18, 2012
  • Like
  • 0

Hi,

 

I need to work on a requirement for which i need to display help text kind of work around for each and every lov of a picklist.

So when a user clicks on a picklist and hover on the lovs , the corresponding lov description should get displayed as floating window.

 

Did any gone through this kind of implementation ? PLease share your thoughts.

 

I am planning on using custom setting for lov descriptions, as there are 4-5 picklists with dependencies between them , total lovs count greater than 50.

 

--yvk

  • August 03, 2012
  • Like
  • 0

hi friends, i have a requirement to mimic a timeline view written on campaign using scontrol for a custom object. Got a managed package on App Exchange and installed it, using code of the scontrol i tried but unable to proceed. i have to modify the VFP version to very old one let say 17 in order to escape the dtd usage error. If any one came across these kind of conversion please help me pasting hte vfp code ;

 

<apex:page contentType="text/html" title="..." showHeader="false" sidebar="false">
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Campaign - Timeline</title>
<link href="/sCSS/Theme2/default/common.css" type="text/css" media="handheld,print,projection,screen,tty,tv" rel="stylesheet" >
<link href="/sCSS/Theme2/{!$Organization.Id}/{!$User.Id}/dCustom.css" type="text/css" media="handheld,print,projection,screen,tty,tv" rel="stylesheet" >
<apex:includeScript value="{!$SControl.SFL20__Timeline_CSS}"/>
<apex:includeScript value="{!$SControl.SFL20__Timeline_JS}"/>
<script type="text/javascript" src="/soap/ajax/8.0/connection.js"></script>
<script type="text/javascript" src="/js/functions.js"></script>
<script type="text/javascript">

var theTimeLine;
var eventSource;
var baseURL = window.location.protocol + '//' + window.location.hostname;
var user_lang;
var currentYear;

function isSupported(str) {
var reg = new RegExp(/en|de|fr|es|it|se/);
return reg.test(str);
}

//function getLocalText(str) {
// return textMap[user_lang][str];
//}

function createBands() {
eventSource = new Timeline.DefaultEventSource();
Timeline.Platform.serverLocale = (isSupported(user_lang)?user_lang:"en");
Timeline.Platform.clientLocale = (isSupported(user_lang)?user_lang:"en");

var theme = Timeline.ClassicTheme.create();
// theme.event.label.width = 250;

var bandInfos = [
Timeline.createBandInfo({
showEventText: true,
eventSource: eventSource,
date: Date(),
width: "60%",
intervalUnit: Timeline.DateTime.WEEK,
intervalPixels: 70, theme: theme
}),
Timeline.createBandInfo({
showEventText: false,
eventSource: eventSource,
date: Date(),
width: "30%",
intervalUnit: Timeline.DateTime.MONTH,
intervalPixels: 100, theme: theme
}),
Timeline.createBandInfo({
showEventText: false,
trackHeight: 0.6,
trackGap: 0.2,
eventSource: eventSource,
date: Date(),
width: "10%",
intervalUnit: Timeline.DateTime.YEAR,
intervalPixels: 200
})
];
bandInfos[0].highlight = false;
bandInfos[1].syncWith = 0;
bandInfos[1].highlight = true;
bandInfos[1].eventPainter.setLayout(bandInfos[0].eventPainter.getLayout());
bandInfos[2].syncWith = 1;
bandInfos[2].highlight = true;
bandInfos[2].eventPainter.setLayout(bandInfos[1].eventPainter.getLayout());
theTimeLine = Timeline.create(document.getElementById("campaign-timeline"), bandInfos);
}

function initPage() {

var user = sforce.connection.getUserInfo();
user_lang = user.userLanguage.substring(0,2);
//sforce.debug.log(user);

var today = new Date();
currentYear = today.getFullYear();

createBands();

sforce.connection.query( "SELECT Id, Start_Date__c, End_Date__c from Unit_Event__c", layoutCampaigns );
}

function layoutCampaigns(qr) {
loadJSON ( map ( qr.getArray('records'), function(rec,idx,ary) {

return {
start: rec.getDate('StartDate'),
end: (rec.getDate('EndDate') == null?rec.getDate('Start_Date__c'):rec.getDate('EndDate')),
isDuration: true,
title: rec.Name +' ('+ rec.Type +')',
link: "/" + rec.Id,
target: "_top",
description: "Owner: " + rec.Owner.Name + "<br>" + (rec.Description == null?"":rec.Description + "<br>") + "Responses: " + rec.NumberOfResponses + "<br>Opportunities: " + rec.NumberOfOpportunities,
image: "/img/icon/campaigns16.gif",
icon: "/img/icon/campaigns16.gif",
color: "#cc9933",
textColor: "#000000" }
} ) );
}

// some helper functions
// take an array of events, load them into a data object and pass to loadJSON
function loadJSON (events) {
if (!events || events.length <1) return;
var data = {};
data.events = events;
eventSource.loadJSON(data,baseURL); // eventSource is part of the Timeline API
}
// call a function on each member of the array, return an array
// of the results of the callbacks
function map(anArray, callback){
var outArr = [];
for(var i=0,l=anArray.length; i<l; i++){
var topush = callback(anArray[i], i, anArray);
if (topush != null) {
outArr.push( topush );
}
}
return outArr;
}

var resizeTimerID = null;
function onResize() {
if (resizeTimerID == null) {
resizeTimerID = window.setTimeout( function() { resizeTimerID = null; theTimeLine.layout();}, 500 );
}
}

function refreshTimeline(str) {

theTimeLine.dispose();
createBands();
switch (str) {
case "this_year_on":
document.getElementById("timelineHeadline").innerHTML = "All Campaigns From This Year On";
sforce.connection.query( "SELECT Id, Start_Date__c, End_Date__c from Unit_Event__c",  layoutCampaigns );
break;
case "last_year_on":
document.getElementById("timelineHeadline").innerHTML = "All Campaigns From Last Year On";
sforce.connection.query( "SELECT Id, Start_Date__c, End_Date__c from Unit_Event__c",  layoutCampaigns );
break;
case "this_year":
document.getElementById("timelineHeadline").innerHTML = "All Campaigns During This Year";
sforce.connection.query( "SELECT Id, Start_Date__c, End_Date__c from Unit_Event__c",  layoutCampaigns );
break;
case "last_year":
document.getElementById("timelineHeadline").innerHTML = "All Campaigns During Last Year";
sforce.connection.query( "SELECT Id, Start_Date__c, End_Date__c from Unit_Event__c",  layoutCampaigns );
break;
case "all":
document.getElementById("timelineHeadline").innerHTML = "All Campaigns";
sforce.connection.query( "SELECT Id, Start_Date__c, End_Date__c from Unit_Event__c",  layoutCampaigns );
break;
default:
document.getElementById("timelineHeadline").innerHTML = "All Campaigns From This Year On";
sforce.connection.query( "SELECT Id, Start_Date__c, End_Date__c from Unit_Event__c",  layoutCampaigns );
}
}
</script>
</head>
<body class="custom customTab3 overviewPage" onload="javascript&colon;initPage();" onresize="javascript&colon;onResize();" >
<div class="bodyDiv"> <a name="skiplink"><img src="/s.gif" height='1' width='1' alt="Content Starts Here" class="skiplink"></a>
<div id="divErrorMsg"></div>
<div class="bPageTitle">
<div class="ptBody secondaryPalette">
<div class="content"><img src="/s.gif" alt="Campaign Timeline Overview" class="pageTitleIcon" title="Campaign Timeline Overview">
<h1 class="pageType">Campaign Timeline<span class="titleSeparatingColon">:</span></h1>
<h2 class="pageDescription"> Overview</h2>
<div class="blank">&nbsp;</div>
</div>
<div class="links"><a href="javascript&colon;openPopupFocusEscapePounds('/servlet/servlet.Integration?lid=01N50000000D45F&enc=UTF-8&ic=1', 'Help', 700, 600, 'width=700,height=600,resizable=yes,toolbar=no,status=no,scrollbars=yes,menubar=yes,directories=no,location=no,dependant=no', false, false);" title="Help for this Page (New Window)"><span class="helpLink">Help for this Page</span><img src="/s.gif" alt="" class="helpImage"></a></div>
</div>
<div class="ptBreadcrumb">&nbsp;</div>
</div>
<div class="filterOverview">
<form action="" id="filter_element" name="filter_element" method="get">
<div class="bFilterView"><span class="bFilter">
<h2>View:</h2>
<span class="fBody">
<!--<select title="Show:" onchange="javascript&colon;refreshTimeline(this.value);" id="fcf" name="fcf">
<option value="all_campaigns" selected="selected">All Campaigns</option>
<option value="all_active">All Active Campaigns</option>
<option value="my_active">My Active Campaigns</option>
<option value="all_planned">All Planned Campaigns</option>
<option value="my_planned">My Planned Campaigns</option>
</select> -->
<select title="Show:" onchange="javascript&colon;refreshTimeline(this.value);" id="fcf" name="fcf">
<option value="this_year_on" selected="selected">All Campaigns From This Year On</option>
<option value="last_year_on">All Campaigns From Last Year On</option>
<option value="this_year">All Campaigns During This Year</option>
<option value="last_year">All Campaigns During Last Year</option>
<option value="all">All Campaigns</option>
</select>
<input value=" Go! " class="btn" title="Go!" onclick="javascript&colon;refreshTimeline(this.form.fcf.value);" name="go" type="button">
</span>
</span></div>
</form>
</div>
<div class="bRelatedList">
<div class="bNext">
<div class="withFilter">
<div class="clearingBox"></div>
</div>
</div>
<div class="hotListElement">
<div class="bPageBlock secondaryPalette">
<div class="pbHeader">
<form action="" id="hotlist" name="hotlist" method="get">
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="pbTitle"><img src="/s.gif" alt="" title="" class="minWidth" height="1" width="1">
<h3><div id="timelineHeadline">All Campaigns From This Year On</div></h3></td>
<td class="pbButton"><input value=" New Campaign " class="btn" name="new" onclick="javascript&colon;window.top.location='/701/e?retURL=%2F701%2Fo';" title="Create New Campaign" type="button" /></td>
<td class="pbHelp">&nbsp;</td>
</tr>
</tbody>
</table>
</form>
</div>
<div class="pbBody">
<div id="campaign-timeline" style="height:450px; border: 0px"></div>
</div>
<div class="pbFooter secondaryPalette">
<div class="bg"></div>
</div>
</div>
</div>
<div class="listElementBottomNav"></div>
</div>
<!-- End page content -->
</div>
</body>
</html>
</apex:page>

 

--yvk

Hi All,

 

I had a weird issue , please help me out.

 

We are using custom settings for auto numbering few fields on opportunity, we cant use the auto number field as the users wants to trip the number some times and values is used in some other id calculation, so we had to go for this approach and we just update the field with the custom setting value in a before insert event and increment the custom setting value accordingly. This was working fine since yesterday as a user reported that they found 2 records with the same auto number , to my surprise both were created by diff.  users with a second delay so their context will be different,   if they created exactly at the same time then its fine but even with a second delay how the duplication happened ?

 

I just wanted to know that my approach is correct or is there any better way to achieve this ?

 

--yvk

Hi All,

 

I am not sure whether its a limitation or system bug,

 

we have so amny rollup summary fields on Opportunity as it have so many childs. 

 

Ex, custom Forecast, Competitor, Lineitemscount 

 

In an opportunity trigger , i have couple of custom validations which i want to exluded if any othe child records get inserted.

I am doing this in an after update event, for lineitem its working fine, but for custom objects when ever a child records get inserted the validation are not getting excluded. I have veriifed the old, new values of the rollup summary fields both consists of the same values.

 

Tried to query the rollup directly from the database, tried to query the child records , still no use.

 

 

Please help me on  resolving this issue.

 

 

--yvk

 

 

 

  • April 24, 2012
  • Like
  • 0

Hi, please respond if any one came across this functionality,

 

we happened to disable, enable the create pdf button on the quote based on a status field. How to proceed with this.

 

I found 2 option to override the standard with a visual force page or using a custom button.

 

In both the case i ran out of option on to fins the quote template id and use it in the creation of the pdf. 

 

Any ideas on this

  • April 05, 2012
  • Like
  • 0

Hi 

 

I dont know this is the correct to ask this question , but i've already posted about this in vfp board but it didnt got any response. I hope some from this board will respond.

 

I am facing a wierd issue, i am using jQuery blockUI ,unblockUI for button click and picklist actions. 

It was working fine since an year, to my sirprise its throwing script errors for a few profiles since last week. 

 

For other profiles still its working fine . I verified the VFP,controller permissions. Compared the other possible areas like fls, CRED but I didnt able to figure it out. I am getting 'Error:' Type Error: jq.blockUI is not a method or property' and the navigation stops just there . 

 

 

I am using the below script for block and unblock

 <script type="text/javascript">       
        var jq = jQuery.noConflict();
        function ShowProcessingImg() 
        {
            try 
            {
                jq.blockUI({ message: '<h1>Please wait</h1>', css: { 
                    border: 'none', 
                    padding: '15px', 
                    backgroundColor: '#000', 
                    '-webkit-border-radius': '10px', 
                    '-moz-border-radius': '10px', 
                    opacity: .5, 
                    color: '#fff' 
                } }); 
                
            } 
            catch(ex)
            {
                alert(ex);
            }
        }
        function HideProcessingImg()
        {
            try
            {
                jq.unblockUI(); 
            }
            catch(ex)
            {
                alert(ex);
            }
        }    
    </script>

 

Using the below jQuery versions

jQuery JavaScript Library v1.4.1

jQuery blockUI plugin  Version 2.31 (06-JAN-2010) (malsup.com)

 

Let me know how to fix this or atleast where i have to look at.

 

Thanks

yvk

  • March 09, 2012
  • Like
  • 0

HI guys,

 

I am facing a wierd issue, i am using jQuery blockUI ,unblockUI for button click and picklist actions. 

It was working fine since an year, to my sirprise its throwing script errors for a few profiles since last week. 

 

For other profiles still its working fine . I verified the VFP,controller permissions. Compared the other possible areas like fls, CRED but I didnt able to figure it out. I am getting 'Error: Object doesn't support this property or method'  script error and the navigation stops just there . 

 

 

I am using the below script for block and unblock

$.blockUI({ message: '<h1>Please wait </h1>' });   

$.unblockUI();

 

Using the below jQuery versions

jquery-1.4.2.min.js

jquery-ui-1.8.1.custom.min.js

 

Let me know how to fix this or atleast where i have to look at.

 

Thanks

yvk

 

  • February 27, 2012
  • Like
  • 0

Hi all,

 

I have a lookup field inside a repeater on a visual force page . I need to make it a read only field .

 

Can any oe tell me how i can achieve this using javascrpt

 

I tried using the script tag 

<script>

document.getElementById('page:form:pbs:fieldnm').disabled = true.

</script>

 

But as since it was inside a repeater the id of the field is generated as 'page:form:pbs:firs:0:fieldnm'

so how to make readonly for all the items in the list .

 

Also , the lookup field consists of somany ids such as _lkid , _lkold which id we need to conisder. Please help me out

  • October 20, 2011
  • Like
  • 0

Can I have an Workflow rule Email Notification on Opportunity Line Item.

 

I tried to create one , but I didnt able to find the Line Item fields in the Field Type values.

 

Can any one let me know.

  • August 14, 2011
  • Like
  • 0

We have an approval process which needs to be approved by 2 unanimous approvers. We also have a field update which will get updated only if both of the unanimous approver approve the record.

 

Before approving the recording we need to check for certain  fields and do not allow bolank values for them.

 

We have an update event trigger on the object ,  this trigger was only getting fired after the second aprover approver but no for the first approver's approval. THis is quite understandable as the field update triggers only after the second approver's approval.

 

My question is how to fire the trigger for the first approval or there is any kind of work around for this scenario.

Please clarify my doubt:

 

I wanted to use few picklists of an Object as filter criteria, but I want to have the LOV's to be populated based on the Record Type that was assigned to the profile logged in. Does the standard controller support this kind of functionality or we need to have custom picklists.

Hi,

 

I just got into a requirement where i need to pull lov of a field based on the record type , so that i do not need to change the code , if in future more lov's are added to the record type. I know the record type and dependencies will induce into VFP by default, but as per my requirement the standard controller object and the one for which i wanted to retrieve the lovs are different.

 

Let me know if there is any way to do this using global describe or any thing.

I am going through the SLDS trail as follows:
Trailhead > Develop for Lightning Experience > Lightning Design System > Use Images, Icons, and Avatars
https://trailhead.salesforce.com/trails/lex_dev/modules/lightning_design_system/units/lightning-design-system5

In the Page Header section, a box is supposed to display an avatar alongside the header text "Accounts / My Accounts".  What I get is a missing image indicator and the brower console gives me a 404 error.

The code in question looks like this:

<img src="{!URLFOR($Asset.SLDS, '/assets/images/avatar1.jpg')}" alt="" />

(along with appropriate spans and divs)   Looking into the Visualforce documentation, I see that the path to assets should be without the leading slash, so the code should look like this:

<img src="{!URLFOR($Asset.SLDS, 'assets/images/avatar1.jpg')}" alt="" />
but that doesn't work, either.

Question:  how do you reference Salesforce assets in this context?

My full code is below.  (This whole module is very difficult to use because the code samples appear all on one (long) line without line breaks, making them very difficult to copy/paste.)
 

<apex:page showHeader="false" standardStylesheets="false" sidebar="false" 
           applyHtmlTag="false" applyBodyTag="false" docType="html-5.0"> 
    <html xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" lang="en"> 
        <head> 
            <meta charset="utf-8" /> 
            <meta http-equiv="x-ua-compatible" content="ie=edge" /> 
            <title>Salesforce Lightning Design System Trailhead Module</title> 
            <meta name="viewport" content="width=device-width, initial-scale=1" /> 
            <!-- Import the Design System style sheet --> 
            <apex:slds /> 
        </head> 
        <apex:remoteObjects > 
            <apex:remoteObjectModel name="Account" fields="Id,Name,LastModifiedDate"/> 
        </apex:remoteObjects> 
        <body>            
            <!-- REQUIRED SLDS WRAPPER --> 
            <div class="slds-scope"> 
                <!-- MASTHEAD --> 
                <p class="slds-text-heading--label slds-m-bottom--small"> 
                    Salesforce Lightning Design System Trailhead Module 
                </p> 
                <!-- / MASTHEAD --> 
                <!-- PAGE HEADER --> 
                <div class="slds-page-header" role="banner"> 
                    <div class="slds-grid"> 
                        <div class="slds-col slds-has-flexi-truncate"> 
                            <!-- HEADING AREA --> 
                            <div class="slds-media slds-no-space slds-grow"> 
                                <div class="slds-media__figure"> 
                                    <span class="slds-avatar slds-avatar--medium"> 
                                        <img src="{!URLFOR($Asset.SLDS, 'assets/images/avatar1.jpg')}" 
                                             alt="" />
                                    </span> 
                                </div> 
                                <div class="slds-media__body"> 
                                    <p class="slds-text-title--caps slds-line-height--reset">
                                        Accounts
                                    </p> 
                                    <h1 class="slds-page-header__title slds-m-right--small slds-align-middle slds-truncate" 
                                        title="My Accounts">
                                        My Accounts
                                    </h1> 
                                </div> 
                            </div> 
                            <!-- / HEADING AREA -->
                        </div> 
                        <div class="slds-col slds-no-flex slds-grid slds-align-top"> 
                            <button class="slds-button slds-button--neutral">
                                New Account
                            </button> 
                        </div> 
                    </div> 
                    <div class="slds-grid"> 
                        <div class="slds-col slds-align-bottom slds-p-top--small"> 
                            <p class="slds-text-body--small page-header__info">
                                COUNT items
                            </p> 
                        </div> 
                    </div> 
                </div> 
                <!-- / PAGE HEADER -->                
                <!-- PRIMARY CONTENT WRAPPER --> 
                <div class="myapp"> 
                    <!-- CREATE NEW ACCOUNT --> 
                    <div aria-labelledby="newaccountform"> 
                        <!-- CREATE NEW ACCOUNT FORM --> 
                        <form class="slds-form--stacked" id="add-account-form"> 
                            <!-- BOXED AREA --> 
                            <fieldset class="slds-box slds-theme--default slds-container--small"> 
                                <legend id="newaccountform" class="slds-text-heading--medium slds-p-vertical--medium">
                                    Add a new account
                                </legend> 
                                <div class="slds-form-element"> 
                                    <label class="slds-form-element__label" for="account-name">
                                        Name
                                    </label> 
                                    <div class="slds-form-element__control"> 
                                        <input id="account-name" class="slds-input" type="text" 
                                               placeholder="New account"/> 
                                    </div> 
                                </div> 
                                <button class="slds-button slds-button--brand slds-m-top--medium" type="submit">
                                    Create Account
                                </button> 
                            </fieldset> 
                            <!-- / BOXED AREA --> 
                        </form> 
                        <!-- CREATE NEW ACCOUNT FORM --> 
                    </div> 
                    <!-- / CREATE NEW ACCOUNT -->
                    <!-- ACCOUNT LIST TABLE --> 
                    <div id="account-list" class="slds-p-vertical--medium">
                        
                    </div> 
                    <!-- / ACCOUNT LIST TABLE --> 
                </div> 
                <!-- / PRIMARY CONTENT WRAPPER -->
                
                <!-- FOOTER --> 
                <footer role="contentinfo" class="slds-p-around--large"> 
                    <!-- LAYOUT GRID --> 
                    <div class="slds-grid slds-grid--align-spread"> 
                        <p class="slds-col">Salesforce Lightning Design System Example</p> 
                        <p class="slds-col">&copy; Your Name Here</p> 
                    </div> 
                    <!-- / LAYOUT GRID --> 
                </footer> 
                <!-- / FOOTER -->            
            </div> 
            <!-- / REQUIRED SLDS WRAPPER --> 
            <!-- JAVASCRIPT --> 
            <script> 
            (function() { 
                var account = new SObjectModel.Account(); 
                var outputDiv = document.getElementById('account-list'); 
                var updateOutputDiv = function() { 
                    account.retrieve( { 
                        orderby: [{ LastModifiedDate: 'DESC'}, 
                                  { Name: 'ASC'}
                                 ]//, 
                        //limit: 10 
                    }, function(error, records) { 
                        if (error) { 
                            alert(error.message); 
                        } else { 
                            // create data table 
                            var dataTable = document.createElement('table'); 
                            dataTable.className = 'slds-table slds-table--bordered slds-table--cell-buffer slds-no-row-hover'; 
                            // add header row 
                            var tableHeader = dataTable.createTHead(); 
                            var tableHeaderRow = tableHeader.insertRow(); 
                            var tableHeaderRowCell1 = tableHeaderRow.insertCell(0); 
                            tableHeaderRowCell1.appendChild(document.createTextNode('Account name')); 
                            tableHeaderRowCell1.setAttribute('scope', 'col'); 
                            tableHeaderRowCell1.setAttribute('class', 'slds-text-heading--label'); 
                            var tableHeaderRowCell2 = tableHeaderRow.insertCell(1); 
                            tableHeaderRowCell2.appendChild(document.createTextNode('Account ID')); 
                            tableHeaderRowCell2.setAttribute('scope', 'col'); 
                            tableHeaderRowCell2.setAttribute('class', 'slds-text-heading--label'); 
                            var tableHeaderRowCell3 = tableHeaderRow.insertCell(2); 
                            tableHeaderRowCell3.appendChild(document.createTextNode('Last Mod')); 
                            tableHeaderRowCell3.setAttribute('scope', 'col'); 
                            tableHeaderRowCell3.setAttribute('class', 'slds-text-heading--label'); 
                            // build table body 
                            var tableBody = dataTable.appendChild(document.createElement('tbody')); 
                            var dataRow, dataRowCell1, dataRowCell2, dataRowCell3, recordName, recordId; 
                            records.forEach(function(record) { 
                                dataRow = tableBody.insertRow(); 
                                dataRowCell1 = dataRow.insertCell(0); 
                                recordName = document.createTextNode(record.get('Name')); 
                                dataRowCell1.appendChild(recordName); 
                                dataRowCell2 = dataRow.insertCell(1); 
                                recordId = document.createTextNode(record.get('Id')); 
                                dataRowCell2.appendChild(recordId); 
                                dataRowCell3 = dataRow.insertCell(2); 
                                lastMod = document.createTextNode(record.get('LastModifiedDate')); 
                                dataRowCell3.appendChild(lastMod); 
                            }); 
                            if (outputDiv.firstChild) { 
                                // replace table if it already exists 
                                // see later in tutorial 
                                outputDiv.replaceChild(dataTable, outputDiv.firstChild); 
                            } else { 
                                outputDiv.appendChild(dataTable); 
                            } 
                        } 
                    } ); 
                } 
                updateOutputDiv(); 
            })(); 
            var accountForm = document.getElementById('add-account-form'); 
            var accountNameField = document.getElementById('account-name'); 
            var createAccount = function() { 
                var account = new SObjectModel.Account(); 
                account.create({ Name: accountNameField.value }, 
                               function(error, records) { 
                                   if (error) { 
                                       alert(error.message); 
                                   } else { 
                                       updateOutputDiv(); 
                                       accountNameField.value = ''; 
                                   } 
                               }); 
            } 
            accountForm.addEventListener('submit', 
                                         function(e) { 
                                             e.preventDefault(); 
                                             createAccount(); 
                                         }
                                        );
            </script> 
            <!-- / JAVASCRIPT -->
        </body> 
    </html> 
</apex:page>
I'm trying to go through the Field Service trail an when in the module "Enable Field Service and Create Service Resources" I'm not able to find the "Service Resource" in the App Launcher after activating field service and setting my user.

Tried it on a colleagues Trailhead playground and it worked for him.

Anyone who can help understand why my trailhead playground doesn't allow me to access Service Resource?

Thanks!
Hi All,

I dont know how to put it, I am given with this crazy idea to build an custom visual force page for the auto selection of the products/services based on comparions of the inputs given on opportunity. Meaning the comparision between the inputs needs to be varied by the users in a timely fashion and apex should not hard code the comparisions , instead it should get the comparision criteria from a different object's records so as to allow the users to change them from time to time.

Before starting on anything, I just wanted to make sure that apex code can handle this kind of scenario. Please let me know.

--yvk
  • October 20, 2015
  • Like
  • 0
Hello everyone,

Can you set a standard object as a junction object using Apex code? 

I do understand that this is not possible to achieve this through Point and Click, also there are hidden standard objects(not available on the UI) that are junction objects viz. AccountContactRole.

Thanks in advance.
We have two object say A and B. 
A has a lookup on B. 
A has two text field Type and year.
B has one text field Type and year
I want to populate the lookup field of A by matching Type and Year field of A with type and Year field of B. Trigger code should be bulkified. Need help, its urgent. Thank you
How can I make a field required only if a certain item is selected in a seperate picklist field on the same custom object?
I am not sure what is incorrect in this trigger. I am getting Error: Compile Error: unexpected token: 'for' at line 4 column 1

Scenario:
- After creating a new Opportunity
- Object Implementation should populate a list of 12 Records when save is clicked. 
trigger IMP on Opportunity (after insert) { 
 List <implementation__c> ImpToInsert = new List <implementation__c> 

 for (Opportunity o : Trigger.new) {
  implementation__c rec = new implementation__c (Opportunity__c = o.id); 
  ImpToInsert.add(rec);
}

database.saveResult[] sr = database.insert(impToInsert,false);  

for(integer x=0;x<sr.size();x++){
  if(sr[x].isSuccess() == false)
      system.debug(logginglevel.error,sr[x].getErrors()[0].getMessage());
 }
}
hi, 
 Actually i dont know what to do here to achive my logic.

my required condition is ,  there is a course in COURSE__C object, we need 2 values to perfoam reqiored operation,  

1) Total_no_of_seats__C  (i am giving it as 60)   no problem at here.
2)Total_students_booked_seats_upto_now( i need this) 

because i need to write some validation rule at student_registration_for_new couse....  please help

validation rule at student__C object is

User-added image
 
Hi All

I have one urgent query, described below:
I have one custom object "Communication" with two record types 'Inbound' & 'Outbound'. I created one custom button on Inbound layout called 'Reply'.
Functianality on Reply button is:

functionality to Reply to a Communication is a custom 'Reply' button that has code to clone the original Communication record (thus preserving the original), change the Record Type to Outbound and open the new record in Edit view.

Just similar to mailing pattern to reply, the cloning record will contain the Subject, Recipient email, Message type, Reply content(these are the fields) to auto populate from Inbound record type record and in editable mode. and have below section in which the clone of original mail will come.

Please help me in solving this problem.

Regards
Manav 


 
How can I add Summary Report without chart in a page layout?
As of now I am trying to create one VF page which I will add as inline VF page in layout, but the below code is not showing any results, its just showing white screen.

Thanks
<apex:page showHeader="false" sidebar="false">
  <apex:OutputPanel id="MissingAttRpt" >
        <apex:iframe src="/00Og000000hMj0h?isdtp=lt" scrolling="true"  height="1588px"  width="100%"/>   
  </apex:OutputPanel>
</apex:page>

 

How to make apex:inputfile as required?

i have used the following code,

<apex:inputFile value="{!objAttachment1.body}" filename="{!objAttachment1.name}" required="true">
</apex:inputFile>

It dint workout. Any help on how to achieve this?

Thanks.

 

I am not sure if my subject is clear, but hopefully this helps.

I am working on a Site with a Product search feature for different divisions (division__C)

I want each division search page to only search for products of that division.

I have a search feature working, just need help tweaking it.  I have tried some things on my own with no luck, so I am hoping I can get some help.

1. If I change the class to say
WHERE Division__C = Office/School AND Area__C...

it says Authorization Required on search (Guest has field access)
I have a search feature working, just need help tweaking it.

2. If I change class to say
...OR Case_Quantity__c like \'%'+searchstring+'%\' AND Division__c like \'%'+Office/School+'%\''

it says Error    Error: Compile Error: Variable does not exist: Office at line 15 column 521

_____________

Working code:

public with sharing class prodsearchschool {

    private String sortOrder = 'Name';
    public list <Product2> Prod {get;set;} 
    public String searchstring {get;set;}
    public String searchquery {get;set;}
    public String sortField {get;set;}
    public String lastClicked {get;set;}
    public String sortDir {get;set;}

    public prodsearchschool() {}
     
         
    public PageReference search(){
        searchquery='select Area__C, ProductCode, Name, Color__C, Overall_Length__C, H__C, W__C, L__C, Case_Quantity__c from Product2 WHERE Area__C like \'%'+searchstring+'%\' OR ProductCode like \'%'+searchstring+'%\' OR Name like \'%'+searchstring+'%\' OR Color__C like \'%'+searchstring+'%\' OR Overall_Length__C like \'%'+searchstring+'%\' OR H__C like \'%'+searchstring+'%\' OR L__C like \'%'+searchstring+'%\' OR W__C like \'%'+searchstring+'%\' OR Case_Quantity__c like \'%'+searchstring+'%\'';  
        Prod = database.query(searchquery);
        return null;
    } 

    public void clear(){ 
        prod.clear(); 
    }

    public PageReference sortThis() {  
        if(lastClicked == null){
            sortDir = 'ASC';
        }
        else{
            if(lastClicked == sortField){
                sortDir = 'DESC';
            }
            else{
                sortDir = 'ASC';
            }
        }
        lastClicked = sortField;
       prod = Database.query(searchquery + ' order by ' + sortField + ' ' + sortDir);
       return null;
    } 
}
Hi All,

I could see Save and Cancel buttons in my VFP. But Save button is not highlighted and it isn't working. I used the same code as above. Please help.
Belowe code i used for this.

https://gist.github.com/Karanraj/6bd1ffc13252b0a22ae0
Hi all,

I was wondering if anyone could help me embed some of my dashboard components into a visualforce page. After every week the dashboard needs to display different informatrion on different records and the only way to do this is to embed them in a visualforce page. I am new to this and am not sure how I would achiecve this.

If somebody could give me some help and a bit of code that would be much appreciated. 

Thanks
Hi all,

Am building a community with the customer community plus license. Client is not new to salesforce.com. They are using it already and they have built few standard reports (tabular, summary, matrix) using standard reports and dashboards. Now, since we are building the community, client needs to see the already generated report continuously inside the community (VF pages). 

I was seeing the documents to display the already generated standard reports in community using the visualforce page, but i could not find the correct documentation which says it is possible and how. 

Is there any documentation or example for displaying the standard tabular/summary/matrix reports in community visualforce pages? Please advise. 

Thanks
 
After Winter release we encountered an issue for our .Net integration related to Soap API schema WSDL.
It is a known issue with the XML serialization class from .NET Framework all versions. The XMLSerializer code generation component cannot handle the XSD definitions that have only one element and the occurrence of the element is unbounded.
This is the case with the newly introduced classes ListViewRecord and ListViewRecordColumn from Salesforce API 32.0.
We had to manually modify the schema and altered the constructors for those 2 classes mentioned above by adding an extra dummy attribute.
This way the XMLSerializer code generator will use the proper XmlSerialization attributes for the constructor.

There should be a way to update WSDL from Salesforce to support .Net integration without manually update

Thank you! 

Can we call web services through trigger?

the above error i am getting wen i am executing thi program..... plz help me

 

 

 

 

public with sharing class ChatterUnitTests {

/*
* Test the ChatterActivity trigger which inserts chatter feed posts whenever a task is inserted on the parent object
*/
public static testMethod void testChatterActivity() {
//create the test account

Account a = new Account(name='Test Account');
insert a;

//create a task on that account
Task t = new Task(whatId=a.id);
t.Subject = 'This is a test activity for chatter';
t.ActivityDate = System.today();
t.Status = 'In Progress';
t.Description = 'Hello, this will be chattered';

insert t;

//Make sure Account has the feed enabled. If it does, make sure the chatter feed post is there
Schema.DescribeSObjectResult r = Account.SObjectType.getDescribe();
if (r.isFeedEnabled()) {
List<AccountFeed> posts = [SELECT Id, Type FROM AccountFeed WHERE ParentId = :a.id];
System.assertEquals(1, posts.size());
}
}
}

In the User's Guide there is a sample http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_test.htm?CSHID=apex_methods_system_test.htm#TestLoadDataExampleSection

of how to use the Test.loadData method to load a csv file with Accounts.

 

I cannot see any documentation nor samples showing how to load records with references (lookup or master-detail) to parent records - e.g. if I want to load Contacts, which refer to Accounts.

 

Anyone who knows. I suppose I am not going to "invent" record IDs????

Hi Boards,

I have some data populated in richtext Area fields in sandbox.

I would like to migrate them to production.

 

RichTextArea contains embedded images, I would like them to be exported them as is.

I took the export using DataLoader and the csv file shows the path of the image instead of the image data. How do I accomplish the export  ?

 

Any insights will be appreciated.

 

Thanks,

  • August 10, 2011
  • Like
  • 0