• SAHG-SFDC
  • NEWBIE
  • 256 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 7
    Likes Received
  • 2
    Likes Given
  • 84
    Questions
  • 147
    Replies
Visualforce not seen on community
Hi,

I have a ViusualForce page which I want to see in the community
I am a system Admin and cannot see this page
 
Hi,

I am trying to use REGEX in Apex for achieving to format a number with commas

Number stored as -->11111
Should look like --> 11,111

There is no scenario to use decimal, so need positive ineteger REGEX , I tried various combinations and always get the error while saving
 
string strHeader = String.valueOf(tiers.StartValue__c.intvalue());
string StrHeaderValue;

// First Option
//StrHeaderValue =strHeader.split('/'(?=(?:\d{3})+(?:'\.'|$))/g).join(',');

//Second Option
//StrHeaderValue =strHeader.split(('//')(?=(?:\d{3})+(?:('//.')|$))/g).join(',');

//Third Option
StrHeaderValue=strHeader.replace('/(\d)(?=(\d\d\d)+(?!\d))/g', '$1,');

//Fourth Option
//StrHeaderValue = strHeader.replace('//'('\\'d{3})(?=\d)'//'g, '$1,');

so.put(field, String.valueOf(tiers.StartValue__c.intvalue() + '+'));
so.put(field, StrHeaderValue );

Currently trying the option3 , It shows an error on saving "Invalid string Literal" or the '/' character is not allowed

How should be use / character?
Can we display VF page data on the standard page? 

I have a VF page where there is a field (ServiceDate) and I need to display that in the standard page

Any ideas?
<apex:page standardController="Opportunity" Extensions="OptyProduct" >
    <head>
        <apex:includescript value="//code.jquery.com/jquery-1.11.1.min.js" / > 
        <apex:includescript value="//cdn.datatables.net/1.10.4/js/jquery.dataTables.min.js" /> 
      
        <apex:stylesheet value="//cdn.datatables.net/1.10.4/css/jquery.dataTables.css" />
        <script>
            j$ = jQuery.noConflict();
            j$(document).ready( function () {
                var contactTable = j$('[id$="contacttable"]').DataTable({
                "lengthMenu": [[5], []],
                    "bLengthChange": false,
                    "bFilter": false,
                    "bInfo": false,
                    "bAutoWidth": false,
                    order: [[2, 'asc']], 
                     "aLengthMenu": [[5], [5]],      
                   order: [[2, 'asc']],
                    initComplete: function() {
                        var api = this.api();
                        var select = j$('[id$=accountSelect]');
                        api.column(0).data().unique().sort().each( function ( d, j ) {
                            select.append( '<option value="'+d+'">'+d+'</option>' )
                        } );   
                    }
                });
                  
            });
        </script>
    </head>
    <body> 
    <apex:form >

HI I am using the above Javascript and pagination works fine, However, When I try to edit on the resulting columns , I can edit the first page
When I navigate to  second page inline edit seems like lock

Any ideas?
I have a cancel method in Apex controller which saves even if the user clicks cancel

 public PageReference cancelSave() {
           
            return null; 

I  need the user to stay on the same page when cancel is clicked (Cannot use standard cancel)
HI,

I am working on a scenario where there is an inline visualforce page on a standard page layout, There is a command button EDIT on the Visualforce page

When the user clicks edit can we redirect them to the same page (This is just to show them the page in full screen) and once saved come back to the previous screen with the edited data
Hi,

I want to display the output link if the checkbox (Custom checkbox-  Display__c on product2) is checked

<td> <apex:outputLink value="/{!p.id}" target="_top">{!p.product2.name} </apex:outputLink> </td>

Any thought?
Hi,

Any one has ideas on how to save the date when a particular field was clicked (This is the Formula field, called "Create" it takes to the create page" , There is a static resource looks like a button) , Use case is to get the date the user clicked create

We will store this in another field on the same object

Advance thanks for looking into this
Hi Users,

I am looking for displaying the Apex command button only if the list that I have has atleast one value Amny suggestions?
 
<script>
                                    function load()
                                    {
                                        window.open("/oppitm/multilineitem.jsp?oppId={!Opportunity.Id}&retURL={!Opportunity.Id}", "_parent");
                                    }
                                </script>
                            <apex:commandButton value="Edit All" oncomplete="load();"/>
This list is created in the Apex Class 
Public List<OpportunityLineItem> ProdList{get;set;}

Advance thanks for seeing the post
HI Users,

I have a trigger code which works as expected, I want to move this code into an apex class and call that in the trigger 
set < id > Checkids = new set < id > ();
        set < id > Uncheckids = new set < id > ();
        if (trigger.isinsert || trigger.isupdate) {
            for (Proposal__Proposal__c p: trigger.new) {
                if (p.Proposal__Primary__c == true && p.Proposal__Approval_Stage__c == 'Accepted') {
                    Checkids.add(p.Proposal__Opportunity__c);
                }
                if (p.Proposal__Primary__c == true && p.Proposal__Approval_Stage__c != 'Accepted') {
                    Uncheckids.add(p.Proposal__Opportunity__c);
                }
                if (p.Proposal__Primary__c == false && p.Proposal__Approval_Stage__c == 'Accepted') {
                    Uncheckids.add(p.Proposal__Opportunity__c);
                }
            }
        }
        list < opportunity > opptoupdate = new list < opportunity > ();
        for (opportunity o: [select id, Has_Primary_Accepted_Quote_Proposal__c from opportunity where id in : Checkids and Has_Primary_Accepted_Quote_Proposal__c = false]) {
            o.Has_Primary_Accepted_Quote_Proposal__c = true;
            opptoupdate.add(o);
        }
        for (opportunity o: [select id, Has_Primary_Accepted_Quote_Proposal__c from opportunity where id in : Uncheckids and Has_Primary_Accepted_Quote_Proposal__c = true]) {
            o.Has_Primary_Accepted_Quote_Proposal__c = false;
            opptoupdate.add(o);
        }
        if (opptoupdate.size() > 0) {
            update opptoupdate;
        }

 
HI ,

I have a VF page which saves the data on save , but when I refresh the page it displays previosuly stored data

My VF page is inline page on Oppty standard page , using standard {!save} functionality , If I use custom save then I get an error
" System.LimitException: Too many DML statements: 1 "

Any help will be appreciated
I m trying to use Inline edit for one field in VF page (This is inline VF page on standard page)

I tried using inlineedit , It does not work

Any suggestions?
<td>
                        <apex:outputText value="{0, date, MM'/'d'/'yyyy}" >
                                                <apex:param value="{!p.ServiceDate}"/>
                        </apex:outputText>
                        </td>

 
Hi , I am trying to acheive a functionality where I want to redirect the user to a particular page, I was able to do that using a link, I want to do it with a button
<apex:outputLink value="/oppitm/multilineitem.jsp?oppId={!Opportunity.id}&retURL={!Opportunity.id}" target="_top" style="color:blue ;" >Edit All</apex:outputLink>
Any suggestions?
I am trying to send the user to the Oppty products page for a particular oppty ,  This is taking the user to the individual oppty product , How to send the user to list of oppty products?
 
<td>
                          <apex:outputLink value="/{!p.id}/e?retURL=/{!Opportunity.id}"
                             target="_top" style="color:blue ;" >Edit All</apex:outputLink> 
                        </td>
Advance thanks :)
 
HI , I have a trigger for which I am trying to write a test class

Business Scenario if the stage changes then chk/unchk the box and the stage should be checked for the Primary record
set < id > ids2 = new set < id > ();
 set < id > Checkids = new set < id > ();
        set < id > Uncheckids = new set < id > ();
        if (trigger.isinsert || trigger.isupdate) {
            for (Proposal__Proposal__c p: trigger.new) {
                if (p.Proposal__Primary__c == true && p.Proposal__Approval_Stage__c == 'Accepted') {
                    Checkids.add(p.Proposal__Opportunity__c);
                }
                if (p.Proposal__Primary__c == true && p.Proposal__Approval_Stage__c != 'Accepted') {
                    Uncheckids.add(p.Proposal__Opportunity__c);
                }
                if (p.Proposal__Primary__c == false && p.Proposal__Approval_Stage__c == 'Accepted') {
                    Uncheckids.add(p.Proposal__Opportunity__c);
                }
            }
        }
        list < opportunity > opptoupdate = new list < opportunity > ();
        for (opportunity o: [select id, Has_Primary_Accepted_Quote_Proposal__c from opportunity where id in : Checkids and Has_Primary_Accepted_Quote_Proposal__c = false]) {
            o.Has_Primary_Accepted_Quote_Proposal__c = true;
            opptoupdate.add(o);
        }
        for (opportunity o: [select id, Has_Primary_Accepted_Quote_Proposal__c from opportunity where id in : Uncheckids and Has_Primary_Accepted_Quote_Proposal__c = true]) {
            o.Has_Primary_Accepted_Quote_Proposal__c = false;
            opptoupdate.add(o);
        }
        if (opptoupdate.size() > 0) {
            update opptoupdate;
        }
} else {
        if (trigger.isdelete) {

            for (Proposal__Proposal__c p: trigger.old) {
                if (p.Proposal__Primary__c == true ) {
                    ids2.add(p.Proposal__Opportunity__c);
                }
            }
        }
HI, I am trying to check a chk box if there is a child record present , if no then unchk this chk box (look up relation to the custom object from Opportunity)
list<id> ids = new list<id>();
    if(trigger.isinsert || trigger.isupdate){
        
        
       for(Apttus_Proposal__Proposal__c p : trigger.new){
            ids.add(p.Apttus_Proposal__Opportunity__c);
        }
        list<opportunity> opp = [select id,Has_Quote_Proposal__c from opportunity where id in :ids];
        list<opportunity> oppttyupdate = new list<opportunity>(); 
        for(opportunity o : opp){
            o.Has_Quote_Proposal__c=true;
            oppttyupdate.add(o);
        }
        update oppttyupdate;
    }
    
    
    if(trigger.isdelete){
        
        list <id> ids3 = new list<id>();
        for(Apttus_Proposal__Proposal__c p : trigger.old){
            ids3.add(p.Apttus_Proposal__Opportunity__c);
        }
      
      
        list<opportunity> opp = [select id,Has_Quote_Proposal__c,(select id,name from XXXXX0000001yUfDEAU__r) from opportunity where id in :ids3];
        list<opportunity> oppttyoupdate = new list<opportunity>(); 
        for(opportunity o : opp){
            
            if(o.XXXXXXX0000001yUfDEAU__r.size()<1){
                o.Has_Quote_Proposal__c = false;
                oppttyoupdate.add(o);
            }
        }
        update oppttyoupdate;              
            }
                                     }
                             
                     }
Advance thanks 
public with sharing class OptyProduct {
Public List<OpportunityLineItem> ProdList{get;set;}
    public OptyProduct(ApexPages.StandardController controller) {
        ProdList = new List<OpportunityLineItem>();
        ProdList  =[SELECT Quantity,UnitPrice,TotalPrice,Sales_Price__c,Price_Type__c, Invoice_Frequency__c, Monthly_Minimum__c,product2.Name,
        ServiceDate FROM OpportunityLineItem where Opportunity.Id=:ApexPages.currentPage().getParameters().get('id')];
    }
}
HI,

I have this class for which I need test class , what are the steps I should follow to get good coverage

Advance thanks
 
Hi I have the below code, I want to refer it in static resource , Can some one guide the steps?

Do I open the code copy in a document and refer that document?
<apex:includescript value="//code.jquery.com/jquery-1.11.1.min.js" / >
        <apex:includescript value="//cdn.datatables.net/1.10.4/js/jquery.dataTables.min.js" />
        <apex:stylesheet value="//cdn.datatables.net/1.10.4/css/jquery.dataTables.css" />

Advance thanks
HI,

I am trying to check the chkbox on oppty if their are atleast one child record (Lookup relationship to custom object) , If all records attached to Oppty are deleted, this box should be unchecked.

Any suggestions?
HI,

I am working on a requirement where below are the two criterias , I created two checkboxes on opportunity , Proposals and opportunity do not share master detail relationship,

So workflows might not work, Any suggestions?

field on Opportunity (checkbox): "Has Primary Accepted Proposal"
Logic:  If Proposal that is Primary is changed to Approval Stage = "Accepted", then check this box.  If the Primary proposal is deleted from the opportunity or the status of the primary is changed from Accepted to something else, uncheck this box.

Field on Opportunity (checkbox):   "Has Proposal"
Logic:  If Opportunity has at least one Proposal attached, the box should be checked.  If all Proposals attached to Opp are deleted, this box should be unchecked.  
Hi,

We are developing a system which generates quotes and the sales rep can send them to their clients, We are also selling our products to this company apart from selling the system

The requirement here is the sales rep should be able to upload the third party products in to the system and we should not be able to see them (Even though we are admins as we might look at competitions products)

In short the question is can we avoid admins to see this data?
I am trying to map the zip codes to these , After I create a custom object, how should the table structure be?
I have the data in Excel 
Zip Code to Agency

-          Agency to Regional Sales Manager (RSM)

-          Agency to Commercial Sales Manager (CSM)

-          Vertical to Strategic Account Manager (SAM)
HI,

I am working on a requirement where if the lead is assigned then the partner users should get an email
So far I created a template and send emails to partner (This goes to every one in the queue as the email is assigned to the queue members)

I want to send email to each one seperately  (So that they don't see each others email addresses) how do I accomplish this?
How do I show the campaign name in the opportunity record under lead information fields, Other fields that I wanted I mapped them and they are visible

Here, I want the campaign name to be in the lead information section on the opportunity page when the lead is converted

Any suggestions here

So far These are the steps done

Step 1: Create a custom field on the lead --> Campaign_Name__c
Step 2: Create an Apex class to populate this^ field with Campaign Name
public class  CampmemTriggerhelper{

public static void CampmemTrigger(list<CampaignMember> lstcmp){

          set<Id> leadIds=new set<Id>();
       list<Lead> lstleads=new list<Lead>();
       map<Id,string> mapLeadIdByCampaign=new map<Id,string>();

       for(CampaignMember c:[Select Id,LeadId,Campaign.Name from  CampaignMember where ID IN:lstcmp]){
                  leadIds.add(c.LeadId);
                  mapLeadIdByCampaign.put(c.LeadId,c.Campaign.Name);
       }

       for(Lead l:[Select Id,Campaign_Name__c from Lead where Id in :leadIds]){
       if(l.Campaign_Name__c==null){
                 if(mapLeadIdByCampaign.get(l.id)!=null){
               l.Campaign_Name__c=mapLeadIdByCampaign.get(l.id);
                 }
            lstleads.add(l);
           }
  }

         update lstleads;
 }

}


Step 3: Create an Apex Trigger on Campaigns to call that^ class
 
trigger CampmemTrigger on CampaignMember(after insert){
      CampmemTriggerhelper.CampmemTrigger(Trigger.new);


}

Step 4: Now that you have the Campaign Name field on Lead populating Campaign Name, use this field to map the field on Opportunity.

I am not sure of which object should we have the trigger on? and if the value is on the field I can map it to newly created field on opportunity but where should the trigger be
Hi community users,

I wanted to see if any one is using Adobe Experience Manager with salesforce, If so for what?

Regards,
SG
Hi,

We are currently using Aem with Salesforce, but right now there are many layers to connect it with salesforce, so we are trying to create a custom connector to connect it directly 
One way we can as Aem has out of the box connector, I need suggestions to do it the other way

Right now we are using Aem for knowledge articles only (Where user can see related products information)
Since , we would be connecting it, I wanted to figure out other use cases and leverage the connector

So, I need help in figuring out the use cases for connecting this (We are a products selling organization)

Answers are highly appreciated
Hi Team,

I am looking for a way to do partner lead management, Where the leads comes in and then routed to the partners and they cannot see each others leads

Is having a community/portal  for them an option?
How do we set up partner users?
Can I have a queue and keep routing the leads if they meet the criteria?and would this affect the current lead assignment rules?
How would the access be? Considering we don't want them to see anytihng apart from there leads

I am looking for options to acheive this and it has to be scalable

Answers are highly appreciated
Visualforce not seen on community
Hi,

I have a ViusualForce page which I want to see in the community
I am a system Admin and cannot see this page
 
Can we display VF page data on the standard page? 

I have a VF page where there is a field (ServiceDate) and I need to display that in the standard page

Any ideas?
Hi,

I want to display the output link if the checkbox (Custom checkbox-  Display__c on product2) is checked

<td> <apex:outputLink value="/{!p.id}" target="_top">{!p.product2.name} </apex:outputLink> </td>

Any thought?
Hi,

Any one has ideas on how to save the date when a particular field was clicked (This is the Formula field, called "Create" it takes to the create page" , There is a static resource looks like a button) , Use case is to get the date the user clicked create

We will store this in another field on the same object

Advance thanks for looking into this
Hi Users,

I am looking for displaying the Apex command button only if the list that I have has atleast one value Amny suggestions?
 
<script>
                                    function load()
                                    {
                                        window.open("/oppitm/multilineitem.jsp?oppId={!Opportunity.Id}&retURL={!Opportunity.Id}", "_parent");
                                    }
                                </script>
                            <apex:commandButton value="Edit All" oncomplete="load();"/>
This list is created in the Apex Class 
Public List<OpportunityLineItem> ProdList{get;set;}

Advance thanks for seeing the post
Hi , I am trying to acheive a functionality where I want to redirect the user to a particular page, I was able to do that using a link, I want to do it with a button
<apex:outputLink value="/oppitm/multilineitem.jsp?oppId={!Opportunity.id}&retURL={!Opportunity.id}" target="_top" style="color:blue ;" >Edit All</apex:outputLink>
Any suggestions?
I'm trying to create a VF page which needs to have a 4 column section, I have tried HTML code and regular VF code but no help, can anyone of you help me?

VF Code:
            <apex:pageBlockSection title="Fee Based Wealth Management Production - Annual"  >
            
            <apex:pageBlockSectionItem dataStyle="width:10%" labelStyle="width:23%" >
            <apex:outputLabel style="font-weight:bold">Field1</apex:outputLabel>
            <apex:inputField value="{!COntact.Field1__c}" style="width:80px"/>
            </apex:pageBlockSectionItem>
            
            <apex:pageBlockSectionItem dataStyle="width:10%" labelStyle="width:23%" >
            <apex:outputLabel style="font-weight:bold">Field2</apex:outputLabel>
            <apex:inputField value="{!Contact.Field2__c}" style="width:80px"/>
            </apex:pageBlockSectionItem>
            
            <apex:pageBlockSectionItem dataStyle="width:20%" labelStyle="width:23%" >
            <apex:outputLabel style="font-weight:bold">Field3</apex:outputLabel>
            <apex:inputField value="{!BAQ__c.Field3__c}" style="width:80px"/>
            </apex:pageBlockSectionItem>
            
            <apex:pageBlockSectionItem dataStyle="width:20%" labelStyle="width:23%" >
            <apex:outputLabel style="font-weight:bold">Field4</apex:outputLabel>
            <apex:inputField value="{!Contact.Field4__c}" style="width:80px"/>
            </apex:pageBlockSectionItem>  
           </apex:pageBlockSection>

HTML Code:
<table style="width:1000px;">
<tr>
     <td style="text-align:right"><apex:outputlabel value="Field1" style="margin-left:-10px;width:200px;"></apex:outputlabel></td>
     <td> <span style="margin-left:20px"> </span> <apex:inputField value="{!Contact.Field1__c}" label="" style="width:160px" />
     </td>
              
     <td style="text-align:right"> <apex:outputlabel value="Field2" style="width:200px;"> </apex:outputlabel></td>
     <td><span style="margin-left:20px"></span> <apex:inputField value="{!Contact.Field2__c}" label="" style="width:160px"/>
     </td> 
      

     <td style="text-align:right"><apex:outputlabel value="Field3" style="width:200px;"></apex:outputlabel></td>
     <td> <span style="margin-left:20px"> </span> <apex:inputField value="{!Contact.Field3__c}" label="" style="width:160px" />
     </td>
              
     <td style="text-align:right"> <apex:outputlabel value="Field4" style="width:200px;"> </apex:outputlabel></td>
     <td><span style="margin-left:20px"></span> <apex:inputField value="{!Contact.Field4__c}" label="" style="width:160px"/>
     </td> 
      
</tr>
</table>
HI, I am trying to check a chk box if there is a child record present , if no then unchk this chk box (look up relation to the custom object from Opportunity)
list<id> ids = new list<id>();
    if(trigger.isinsert || trigger.isupdate){
        
        
       for(Apttus_Proposal__Proposal__c p : trigger.new){
            ids.add(p.Apttus_Proposal__Opportunity__c);
        }
        list<opportunity> opp = [select id,Has_Quote_Proposal__c from opportunity where id in :ids];
        list<opportunity> oppttyupdate = new list<opportunity>(); 
        for(opportunity o : opp){
            o.Has_Quote_Proposal__c=true;
            oppttyupdate.add(o);
        }
        update oppttyupdate;
    }
    
    
    if(trigger.isdelete){
        
        list <id> ids3 = new list<id>();
        for(Apttus_Proposal__Proposal__c p : trigger.old){
            ids3.add(p.Apttus_Proposal__Opportunity__c);
        }
      
      
        list<opportunity> opp = [select id,Has_Quote_Proposal__c,(select id,name from XXXXX0000001yUfDEAU__r) from opportunity where id in :ids3];
        list<opportunity> oppttyoupdate = new list<opportunity>(); 
        for(opportunity o : opp){
            
            if(o.XXXXXXX0000001yUfDEAU__r.size()<1){
                o.Has_Quote_Proposal__c = false;
                oppttyoupdate.add(o);
            }
        }
        update oppttyoupdate;              
            }
                                     }
                             
                     }
Advance thanks 

Hi

 

I am using pagination to show 500 records with 75 records/page in visualforce page. I have to make some fields inline edit and for that when i am ptting  mode="inlineEdit" in pageblock tag then it makes the entire 500 records with all fields inline edit and also the changes are not getting reflected.

 

Any help will be greatful.

 

Thanks

Pravin...

  • September 04, 2012
  • Like
  • 0

Hi all,

 

I am trying to make a field which displays this:

 

48 x 180 (8,640)

 

But I'm getting this (no separators):

 

48 x 180 (8640)

 

Here's the code I'm using:

 

TEXT(Lot__r.Unit_Count__c) & " x " & TEXT(Lot__r.kg_unit__c) &" (" & TEXT((Lot__r.Unit_Count__c * Lot__r.kg_unit__c)) & ")"

 

Is there a simple way to insert comma separators in TEXT numbers - or perhaps a better way to do this? I am stumped and think the only way must be to write some combination of RIGHT and TRIM statements - or something else? This must have come up before, right?

 

It's easy in APEX:

 

<apex:outputText value="{0, number, ###,###,###,###}"><apex:param value="{!Quote.Total_Price__c}"/></apex:outputText>

 

...but does not work in formula fields.

 

What am I missing? Thanks much for any help.

 

Alex

 

 

 

I have a VF page that I'm embedding in a standard page layout. I'd like to pass a parameter into the VF page. The VF page's controller will look at the parameter and the current record, then decide what to display on the embedded page.

 

I have the VF page and controller written. But how can I get the standard page layout editor to pass a parameter in to the VF page? Is that even possible? If not, do you have any other suggestions?

 

Thanks!

  • May 08, 2010
  • Like
  • 0
Just finished all of the Trails, Modules and Projects that are available up to this point using 3 different Dev Orgs. (2/3/2016)

Keep them coming. More Trails/Modules/Projects on development would be great. (Lightining,Apex,Visual Force, Javascript, Integration and using the Developer Console)

Thanks for providing these valuable resources !