• Emmanuel Cruz B
  • NEWBIE
  • 140 Points
  • Member since 2014
  • Certified Salesforce Developer
  • Sunnova Energy Corporation


  • Chatter
    Feed
  • 5
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 20
    Replies
SELECT Contact.AccountId
FROM CampaignMembers
WHERE
Contact.AccountId NOT IN (SELECT Contact.AccountId FROM CampaignMember WHERE CampaignId = '7011A00000142mwQAA' AND Contact.Client_Options__c = 'Kick Me') AND
Contact.AccountId IN (Select Contact.AccountId FROM Contact WHERE Id IN (Select ContactId FROM CampaignMember WHERE CampaignId = '7011A00000142mwQAA')
ORDER BY Owner.Name ASC

I am trying to get a list of Accounts who have contacts that are members of a campaign (ID is in code) but don't have a contact that is a member of the same campaign with a contact.textfield (Client_Options__c) set to 'Kick Me'.

I'm running in to the "The inner and outer selects should not be on the same object type" error and can't figure out a way around this.  This is a query that is run on demand so either a revised query or something I could drop in to Execute Anonymouse would be fantastic!  I appreciate any guidance here!
Hi all,

I have a vf page where i have 2 selectlist.
1.Shows all object
2.shows the field of selected object.
i want to search a given string in selected object selected field how can i achieve these any suggestion plz.
Apex class: 
public class objectController
{


   public Map <String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe();

   public String selectedObject {get; set;}

   public String selectedField {get; set;}
   
   public String newValue {get; set;}
   
   public String searchValue{get;set;}

   Public objectController()
   {   
   
   
       selectedObject = 'account';
   }

   public List<SelectOption> getObjectNames() 
   {
       List<SelectOption> objNames = new List<SelectOption>();
       List<String> entities = new List<String>(schemaMap.keySet());
       entities.sort();
       for(String name : entities)
       {
           objNames.add(new SelectOption(name,name));
       }
       return objNames;
    }

    public List<SelectOption> getObjectFields() 
    {
           Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe();
           Schema.SObjectType ObjectSchema = schemaMap.get(selectedObject);
           Map<String, Schema.SObjectField> fieldMap = ObjectSchema.getDescribe().fields.getMap();
           List<SelectOption> fieldNames = new List<SelectOption>();
           for (String fieldName: fieldMap.keySet()) 
           {  
               fieldNames.add(new SelectOption(fieldName,fieldName));
             //fieldMap.get(fieldName).getDescribe().getLabel();//It provides to get the object fields label.
           }
           return fieldNames;
     }     
     
     
    public PageReference submit() {
        String temp = selectedObject + '  ' + selectedField;
        DetailTest__c omc = new DetailTest__c();
        omc.Obj_field__c= temp;
        omc.New_Value__c= newValue ;
        
        insert omc;
    
        return null;
    } 
    
    public void search(){
    
       /*  String queryStr='select '+ id + 'from ' + selectedObject;

List<Sobject> results=Database.query(queryStr);
        */
    }
    
}
Visualforce page:
<apex:page showHeader="false" standardStylesheets="false" sidebar="false" applyHtmlTag="false" applyBodyTag="false" docType="html-5.0" controller="objectController">    
<apex:form >
<html xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">    

<head>
    <apex:stylesheet value="{!URLFOR($Resource.SLDS103, 'assets/styles/salesforce-lightning-design-system-vf.css')}" />
</head> 
 
  <div class="slds">
  <form class="slds-form--inline"> 
  <div class="slds-form-element">
    <div class="slds-form-element__control">
        <label class="slds-form-element__label slds-m-left--xx-large" for="select-01">Select Object</label>
            <apex:actionRegion >      
                           <apex:selectList value="{!selectedObject}" size="1">
                                    <apex:selectOptions value="{!ObjectNames}"/>
                                    <apex:actionSupport event="onchange" rerender="myFields"/>
                            </apex:selectList>
          </apex:actionRegion>
          
        <label class="slds-form-element__label slds-m-left--xx-large" for="select-01">Select Field</label>
  
        <apex:actionRegion >  
            <apex:outputPanel id="myFields">  
                           <apex:selectList value="{!selectedField}" size="1">
                                <apex:selectOptions value="{!ObjectFields}"/>
                            </apex:selectList>
           </apex:outputPanel>                  
        </apex:actionRegion>   
           
            <label class="slds-form-element__label slds-m-left--xx-large" for="text-input-01">Input Value</label>
                  <apex:inputText label="New Value" value="{!newValue }"/>
    
           
         
       </div>
         <label class="slds-form-element__label slds-m-left--xx-large" for="text-input-01">Search Value</label>
                <apex:inputText label="New Value" value="{!SearchValue }"/>  
           
  </div>
  <div class="slds-button slds-m-left--xx-large">
  
  <apex:commandButton value="Submit" action="{!submit}"/>
  
  </div>
  </form>
 </div>
 </html>
 </apex:form>
</apex:page>


 
Hello Friends!

I created a javascript button that is supposed to create a case and fill in certain fields. All fields fill in EXCEPT for the subject field (see highlighted below).

I checked field level and view accessibility, all seems to be fine. What am I missing? Subject is a standard field does that have anything to do with it?

Thanks!!

Opportunity Custom Button or Link: Request Sell2Lease Offer ~ Salesforce - Unlimited Editionwindow.location ="/500/e"
+ "?retURL=%2F500%2Fo"
+ "&def_account_id={!Account.Id}"
+ "&nooverride=1"
+ "&RecordType=012m00000004mnb"
+ "&ent=Case"
+ "&Subject='Sell2Lease Offer Request'"

+ "&00Nm00000014qnb={!Account.Lease_Customer_or_Prospect__c }"
+ "&00Nm00000014qtZ={!Opportunity.Type}"
+ "&00Nm00000014qtj={!Opportunity.Lease_Type__c}"
+ "&00Nm00000014wre={!Account.Main_Lease_Contact__c}"
Hi,

I am showing a image on VF page and then putting some text on the image.
I want if user upload small image then image get stretched into the defined width and height, without croping.
if large image is uploaded then it shrink and set as the defined width and height. 

My images are getting cropped.
Below is my css.
<div class=" darken " style="
                 background-image: URL(image url);
                 background-repeat: no-repeat !important; 
                 background-position: top Center!important;
                 background-size: 640px 240px, auto !important;
                 position:absolute !important
                 position: absolute;
                 width: 100%;
                 overflow: hidden;
                ">
                
                                TEXT ON IMAGE
                </div>



 

Hi all,
I have an issue, I think ut is simple but I could not do it, I hope you could help me,
Here is the issue, 
I made a vf page to display the value fields of a list custom setting "csObject__c" and editing its fields.

I want to make only one record which name="param" where i will modify its fields from the vf page, it's like in the beginning I put only the name 'param' in custom settings, then I can modify the other fields, the important it should be one only record which is Name='param'

<apex:page standardController="csObject__c" recordSetVar="CSparam" extensions="Ctrl">

<apex:form >

<apex:pageBlock >

<apex:pageBlockButtons >
 <apex:commandButton value="Save" action="{!save}" "/>
</apex:pageBlockButtons>


<apex:pageBlockSection  >
<apex:pageBlockTable value="{!CSparam}" var="a" > 
  <apex:column headerValue="Field 1 ">
  <apex:inputField value="{!a.Field1__c}" />
  </apex:column>
  </apex:pageBlockTable>
  </apex:pageBlockSection>

//here I have other field of the custom setting

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

And for the save button I  want to override it to redirect to another vf page:

public with sharing class Ctrl {

    public Ctrl (ApexPages.StandardSetController controller) {

    }
    
    public PageReference  save() {
       csObject__c  cs = csObject__c.getValues('param');
       update cs;
       PageReference pageRef = new PageReference('/apex/VF');
       return pageRef;
   }

    
}

But it doesn't work I still have the old values of the cs fields...

If anyone could help me with this, it would be great...

Thanks!

I'm trying to put a Chatter feed on a custom VF page. I thought I could to the following:

<apex:page >
<chatter:feedWithFollowers entityId="{!$CurrentPage.Id}" />
</apex:page>

But there's no Id associated with the page. Any tips? Thanks.
SELECT Contact.AccountId
FROM CampaignMembers
WHERE
Contact.AccountId NOT IN (SELECT Contact.AccountId FROM CampaignMember WHERE CampaignId = '7011A00000142mwQAA' AND Contact.Client_Options__c = 'Kick Me') AND
Contact.AccountId IN (Select Contact.AccountId FROM Contact WHERE Id IN (Select ContactId FROM CampaignMember WHERE CampaignId = '7011A00000142mwQAA')
ORDER BY Owner.Name ASC

I am trying to get a list of Accounts who have contacts that are members of a campaign (ID is in code) but don't have a contact that is a member of the same campaign with a contact.textfield (Client_Options__c) set to 'Kick Me'.

I'm running in to the "The inner and outer selects should not be on the same object type" error and can't figure out a way around this.  This is a query that is run on demand so either a revised query or something I could drop in to Execute Anonymouse would be fantastic!  I appreciate any guidance here!
Hi,

I have below statement in one of my apex class. I found first 3 words in the object fields but I'm unable to find Sort_Order__c. Can anyone please tell me if this is keyword, if so what it does. If not please let me know where can I find this variable in salesforce setup .

PriceBookEntry.Product2.Product_Family__r.Sort_Order__c

Arun
Hi all,

I have a vf page where i have 2 selectlist.
1.Shows all object
2.shows the field of selected object.
i want to search a given string in selected object selected field how can i achieve these any suggestion plz.
Apex class: 
public class objectController
{


   public Map <String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe();

   public String selectedObject {get; set;}

   public String selectedField {get; set;}
   
   public String newValue {get; set;}
   
   public String searchValue{get;set;}

   Public objectController()
   {   
   
   
       selectedObject = 'account';
   }

   public List<SelectOption> getObjectNames() 
   {
       List<SelectOption> objNames = new List<SelectOption>();
       List<String> entities = new List<String>(schemaMap.keySet());
       entities.sort();
       for(String name : entities)
       {
           objNames.add(new SelectOption(name,name));
       }
       return objNames;
    }

    public List<SelectOption> getObjectFields() 
    {
           Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe();
           Schema.SObjectType ObjectSchema = schemaMap.get(selectedObject);
           Map<String, Schema.SObjectField> fieldMap = ObjectSchema.getDescribe().fields.getMap();
           List<SelectOption> fieldNames = new List<SelectOption>();
           for (String fieldName: fieldMap.keySet()) 
           {  
               fieldNames.add(new SelectOption(fieldName,fieldName));
             //fieldMap.get(fieldName).getDescribe().getLabel();//It provides to get the object fields label.
           }
           return fieldNames;
     }     
     
     
    public PageReference submit() {
        String temp = selectedObject + '  ' + selectedField;
        DetailTest__c omc = new DetailTest__c();
        omc.Obj_field__c= temp;
        omc.New_Value__c= newValue ;
        
        insert omc;
    
        return null;
    } 
    
    public void search(){
    
       /*  String queryStr='select '+ id + 'from ' + selectedObject;

List<Sobject> results=Database.query(queryStr);
        */
    }
    
}
Visualforce page:
<apex:page showHeader="false" standardStylesheets="false" sidebar="false" applyHtmlTag="false" applyBodyTag="false" docType="html-5.0" controller="objectController">    
<apex:form >
<html xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">    

<head>
    <apex:stylesheet value="{!URLFOR($Resource.SLDS103, 'assets/styles/salesforce-lightning-design-system-vf.css')}" />
</head> 
 
  <div class="slds">
  <form class="slds-form--inline"> 
  <div class="slds-form-element">
    <div class="slds-form-element__control">
        <label class="slds-form-element__label slds-m-left--xx-large" for="select-01">Select Object</label>
            <apex:actionRegion >      
                           <apex:selectList value="{!selectedObject}" size="1">
                                    <apex:selectOptions value="{!ObjectNames}"/>
                                    <apex:actionSupport event="onchange" rerender="myFields"/>
                            </apex:selectList>
          </apex:actionRegion>
          
        <label class="slds-form-element__label slds-m-left--xx-large" for="select-01">Select Field</label>
  
        <apex:actionRegion >  
            <apex:outputPanel id="myFields">  
                           <apex:selectList value="{!selectedField}" size="1">
                                <apex:selectOptions value="{!ObjectFields}"/>
                            </apex:selectList>
           </apex:outputPanel>                  
        </apex:actionRegion>   
           
            <label class="slds-form-element__label slds-m-left--xx-large" for="text-input-01">Input Value</label>
                  <apex:inputText label="New Value" value="{!newValue }"/>
    
           
         
       </div>
         <label class="slds-form-element__label slds-m-left--xx-large" for="text-input-01">Search Value</label>
                <apex:inputText label="New Value" value="{!SearchValue }"/>  
           
  </div>
  <div class="slds-button slds-m-left--xx-large">
  
  <apex:commandButton value="Submit" action="{!submit}"/>
  
  </div>
  </form>
 </div>
 </html>
 </apex:form>
</apex:page>


 
I need help on creating an apex trigger that maps one custom object currency field to another custom object currency field.

IF  (ObjectA.CustomFieldA != NULL)
Then  (ObjectB.CustomFieldB = ObjectA.CustomFieldA)
Else (ObjectB.CustomFieldB = 0.00)
 
Please any help is welcome,Hi I would like to create a Record with the values captured/selected from radio button  once apex:Selectcheckbox is checked in Visualforce.Thank in Advance.


User-added image
Hello Friends!

I created a javascript button that is supposed to create a case and fill in certain fields. All fields fill in EXCEPT for the subject field (see highlighted below).

I checked field level and view accessibility, all seems to be fine. What am I missing? Subject is a standard field does that have anything to do with it?

Thanks!!

Opportunity Custom Button or Link: Request Sell2Lease Offer ~ Salesforce - Unlimited Editionwindow.location ="/500/e"
+ "?retURL=%2F500%2Fo"
+ "&def_account_id={!Account.Id}"
+ "&nooverride=1"
+ "&RecordType=012m00000004mnb"
+ "&ent=Case"
+ "&Subject='Sell2Lease Offer Request'"

+ "&00Nm00000014qnb={!Account.Lease_Customer_or_Prospect__c }"
+ "&00Nm00000014qtZ={!Opportunity.Type}"
+ "&00Nm00000014qtj={!Opportunity.Lease_Type__c}"
+ "&00Nm00000014wre={!Account.Main_Lease_Contact__c}"
I have below code that displays accout detail in a block and different account related lists records in tabs. under those related list tabs I want to show records with specific record type. E.g we have 3 Opportunity record types- Record Type License, Record Type Delegate and Record Type Membership, so opportunity tab on VF page should only display 2 Record Types- License and Membership.

Does anyone know how to filter out unwanted record type from lists? Please can someone help?

Below is my code:

<apex:page standardController="Account" sidebar="false">
<apex:tabPanel >  
        <apex:tab label="Open Tasks" labelWidth="100">
            <apex:relatedList list="OpenActivities"/>
        </apex:tab>
        <apex:tab label="VPP's & PP's" labelWidth="100">
            <apex:relatedList list="Value_Pillars__r"/>
                </apex:tab>
        <apex:tab label="Event Registration" labelWidth="120">
            <apex:relatedList list="ActivityHistories"/>
        </apex:tab>
</apex:tabPanel> 
<apex:tabPanel >  
    <apex:tab label="Key Contacts" labelWidth="100">
        <apex:relatedList list="AccountContactRoles"/>
    </apex:tab>
    <apex:tab label="Opportunities">
        <apex:relatedList list="Opportunities"/>
    </apex:tab>
</apex:tabPanel> 
       
</apex:page>

Many thanks,
Swapnil
Hi,

I need some color text to dynamic picklist values.Picklist values are similar to Url or links.
Eg: 1.BUY/Site Section/Page/Ad Unit/Targeting/Device 
      2.RENT/Site Section/Page/Ad Unit/Targeting/Device 
I need diffent color for each text before slash like as below
BUY/Site Section/Page/Ad Unit/Targeting/Device 
GREY/BROWN/BLUE/ORANGE/GREEN/RED
 
Hi,

I am showing a image on VF page and then putting some text on the image.
I want if user upload small image then image get stretched into the defined width and height, without croping.
if large image is uploaded then it shrink and set as the defined width and height. 

My images are getting cropped.
Below is my css.
<div class=" darken " style="
                 background-image: URL(image url);
                 background-repeat: no-repeat !important; 
                 background-position: top Center!important;
                 background-size: 640px 240px, auto !important;
                 position:absolute !important
                 position: absolute;
                 width: 100%;
                 overflow: hidden;
                ">
                
                                TEXT ON IMAGE
                </div>



 

Hi all,
I have an issue, I think ut is simple but I could not do it, I hope you could help me,
Here is the issue, 
I made a vf page to display the value fields of a list custom setting "csObject__c" and editing its fields.

I want to make only one record which name="param" where i will modify its fields from the vf page, it's like in the beginning I put only the name 'param' in custom settings, then I can modify the other fields, the important it should be one only record which is Name='param'

<apex:page standardController="csObject__c" recordSetVar="CSparam" extensions="Ctrl">

<apex:form >

<apex:pageBlock >

<apex:pageBlockButtons >
 <apex:commandButton value="Save" action="{!save}" "/>
</apex:pageBlockButtons>


<apex:pageBlockSection  >
<apex:pageBlockTable value="{!CSparam}" var="a" > 
  <apex:column headerValue="Field 1 ">
  <apex:inputField value="{!a.Field1__c}" />
  </apex:column>
  </apex:pageBlockTable>
  </apex:pageBlockSection>

//here I have other field of the custom setting

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

And for the save button I  want to override it to redirect to another vf page:

public with sharing class Ctrl {

    public Ctrl (ApexPages.StandardSetController controller) {

    }
    
    public PageReference  save() {
       csObject__c  cs = csObject__c.getValues('param');
       update cs;
       PageReference pageRef = new PageReference('/apex/VF');
       return pageRef;
   }

    
}

But it doesn't work I still have the old values of the cs fields...

If anyone could help me with this, it would be great...

Thanks!

Hi,
I created a related list of Opportuinity Approval History, purely to remove the Submit for approval button.

Now this sits in the detail of the opportnuity page but when someone clicks on the Recall/Approve/Reject links it opens the page within the visualforce and not in a new window.
Does anyone know how I can open these links in a new tab or page
Thanks

Code:
<apex:page StandardController="Opportunity">
      <apex:relatedList list="ProcessSteps" ></apex:relatedList>
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script> 
<script>

 $(document).ready(function() {  
 $("input[name='piSubmit']").hide();
        }); 
 </script>
</apex:page>