• Lakshman
  • SMARTIE
  • 627 Points
  • Member since 2010

  • Chatter
    Feed
  • 22
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 52
    Questions
  • 363
    Replies
HI,

Could anyone tell me how to get each control to be on a separate line?
I thought it was doing this by default, but my outputLabels and inputCheckboxes aren't.
Clone Invoice To and Clone Project Contacts should be on separate lines with either the corresponding checkbox next to them or direclty underneath 

User-added image


This section is within a PageBlock > PageBlockSection and then I have two PageBlockSectionItems. I've put it within an ouputPanel because of the restriction of only having 2 child components.

Many thanks for any help.

<apex:pageBlockSectionItem labelStyle="width:2%" dataStyle="width:10%" dataTitle="Select field to clone">
                        <apex:outputPanel>
                            <apex:outputLabel value="Opportunity to Clone" for="selectedOpp"/>
                            <apex:inputText id="selectedOpp" value="{!selectedOpportunity.Name}" disabled="true" />
                            
                            <apex:outputLabel value="Opportunity name" for="oppName"/>
                            <apex:inputText id="oppName" />
                            
                            <apex:outputLabel value="Stage" for="oppStage"/>
                            <apex:inputField id="oppStage" value="{!selectedOpportunity.StageName}"/>
                                          
                            <apex:outputLabel value="Close Date" for="oppCloseDate"/>
                            <apex:inputField id="oppCloseDate" value="{!selectedOpportunity.CloseDate}"/>
                            
                            <apex:outputLabel value="Live Date" for="oppLiveDate"/>
                            <apex:inputfield id="oppLiveDate" value="{!selectedOpportunity.Expected_Live__c}"/>
                                                   
                            <apex:outputLabel value="Clone Invoice To: " for="invoiceToSelected" />
                            <apex:inputCheckbox id="invoiceToSelected" title="Clone Invoice To" selected="true" />
                            
                            <apex:outputLabel value="Clone Project Contacts: " for="projectContactsSelected"/>
                            <apex:inputCheckbox id="projectContactsSelected" title="Clone Project Contacts" selected="true" />
                            
                            <!--<apex:outputLabel value="Invoice To count: " for="oppInvoiceTo"></apex:outputLabel>
                            <apex:inputField id="oppInvoiceTo" value="{!selectedOpportunity.Invoice_To_Count__c}" />-->
                                                
                            <!--<apex:outputLabel value="Purchase Order Attachment" for="purchaseOrderSelected"></apex:outputLabel>
                            <apex:inputCheckbox id="purchaseOrderSelected" label="Purchase Order Attachment" title="Clone Purchase Order Attachment" selected="true" />
                            <apex:inputText id="oppPurchaseOrderAtt" disabled="true" />-->

                            <!--<apex:outputLabel value="Number of contacts: " for="oppProjectContacts"></apex:outputLabel>
                            <apex:inputField id="oppProjectContacts" value="{!selectedOpportunity.Invoice_To_Count__c}" />-->                                            
                        </apex:outputPanel>
                        
                    </apex:pageBlockSectionItem>
Hi,

This is really wierd.  I have an action that triggers a summary email to be sent when triggered.  The first time I click the action button the email gets sent but is blank.  The second time I click it the email is sent but has data in it.  I can't think what could possibly cause behavior like that.

This is the section
try {
        PageReference displayPage = page.BottlingSummaryEmail_page;
        Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
        String[] toAddresses = new String[] {}; 
		toAddresses.add(userEmail);

        Blob body;
        string htmlBody;
        try {
            // returns the output of the page as a blob
            body = displayPage.getContent();
            system.debug('body should be fine');
            // need to pass unit test -- current bug    
            } catch (VisualforceException e) {
                system.debug('in the catch block');
                 body = Blob.valueOf('Some Text');
            }
        htmlBody = body.toString();
        email.setHtmlBody(htmlBody);
        email.setToAddresses(toAddresses);  
     	email.setSubject('Bottling Summary for '); // + dateString);            
        Messaging.SendEmailResult [] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});
        } catch (exception e) { system.debug ('TastingRecap_class *** error in the send email and error = ' + e);}

of code where I send the summary email (I can provide the rest if needed)


and here is the visualforce page I call for the tempalte
 
<apex:repeat value="{!botLotMap}" var="shift">
        
   <h1>  Bottling Summary for Shift {!shift} </h1>
        <table width="100%">
            
      
       <th>Shift</th><th>Change Over</th><th>Operation</th> <th>Client</th><th>Brand</th><th>Cases</th><th>Cases per Hour</th><th>Notes</th>
        <apex:repeat value="{!botLotMap[shift]}" var="v" >
       
            <tr>
            <td><apex:outputtext value="{!botLotMap[shift][v].Bottling_Shift__r.Bottling_Shift__c}" /></td>
            <td><apex:outputtext value="{!botLotMap[shift][v].Type_of_Changeover__c}"  />  </td>
            <td><apex:outputtext value="{!botLotMap[shift][v].Labeled_Bottled__c}"/></td>
            <td><apex:outputtext value="{!botLotMap[shift][v].Client_Lookup__r.name}" /></td>
            <td><apex:outputtext value="{!botLotMap[shift][v].Brand__c}"/></td>
            <td><apex:outputtext value="{!botLotMap[shift][v].Actual_Bottled__c}"/> </td>           
            <td><apex:outputtext value="{!botLotMap[shift][v].Cases_Per_Hour__c}"/></td>
            <td><apex:outputtext value="{!botLotMap[shift][v].Notes__c}"/></td>
            </tr>

            
        </apex:repeat>  
            <tr><td colspan="4">Total</td><td>{!totalCasesBottled[shift]}</td><td></td><td></td><td></td></tr>
        </table>
    </apex:repeat>
  
    
</apex:page>

Thanks,
 
how to create a report / anyother way for how many users are logging with purticular profile(say system administrator ) in a peroid of month /3 months. i want have data like (for example  #logins/day with  purticular profile in my org).
I have three fields on a custom object:
  1. Enrollment Status(Picklist)
  2. Enrollment Status Reason(Picklist)
  3. Opt Out Date(Date)
and two workflow rules that run on them. The first one sets the Enrollment Status to a value of "Not Enrolled" when the Enrollment Status Reason is changed to equal one of its corresponding reasons. The second one populates the Opt Out Date with today's date when the Enrollment Status field is changed to a value of "Not Enrolled". This works perfectly in the sandbox, but in production, the Opt Out Date only fills in when another random field changes value. The Enrollment Status is filled with "Not Enrolled" regardless. The workflows are identical in the sandbox and in production. I have looked over the debug logs, and it looks like the first rule evaluates to true, and the second rule evaluates to false imediately after. But in the logs where the date was filled in correctly, it looks like the second workflow was evaluated twice. Not sure why this is. I don't want to combine the workflows, because we also want to be able to modify the Opt Out Date manually, and it gets overcomplicated quickly when they're combined. Any help on this would be much appreciated. 

I am getting the error:Constructor not defined when testing batchable class-----test class line

apex test class:

@isTest
public class  testSendeMailinBatch {

Public static testMethod void m3(){  
    Database.QueryLocator QL;
        Database.BatchableContext BC;
        List<SEOX3_Client__c> CL = new List<SEOX3_Client__c>();
        SendeMailinBatch smb=new SendeMailinBatch();----Error: Compile Error: Constructor not defined: [SendeMailinBatch].<Constructor>() at line
        Database.QueryLocatorIterator QIT =  QL.iterator();
              QL = smb.start(bc);
         smb.execute(BC,CL);
        smb.finish(BC);
        }

}

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

Batch apex class:

global class SendeMailinBatch implements Database.Batchable<sObject>,Database.Stateful  
{  
 public list <SEOX3_Client__c> lstcl;
 public string mbody;
 public string msubject;
 public string mfromadd;
 public string mccadd;
 
global SendeMailinBatch(list<SEOX3_Client__c> l1, string body, string fromadd, string ccadd, string subject)  
       {  
             mbody = body;
             msubject = subject;
             mfromadd = fromadd;
             mccadd = ccadd;
             lstcl = l1;
             system.debug('***ccemailcalled*****'+mccadd);
     
      
       }
global Database.QueryLocator start(Database.BatchableContext BC)  
   {  
       
      String query = 'SELECT id,e_mail__c, Sales_Rep_E_Mail__c,CC__c,SUBJECT__c,body2__c FROM SEOX3_Client__c where id in :lstcl';
      return Database.getQueryLocator(query);
     
   }
  global void execute(Database.BatchableContext BC, List<sObject> scope)  
   {  
       for(Sobject s : scope)  
         {
            SEOX3_Client__c CM = (SEOX3_Client__c)s ;  
            string[] c2 = new String[] {mccadd};
            if(mccadd!=NULL && mccadd.trim() != '')
                     {
                        c2=mccadd.split(',', 0);
     
                      }
              else
                      {
                          c2=NULL;
                      }
                        
                   String[] toAddresses = new String[] {cm.E_Mail__c};
                   Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
                   mail.setToAddresses(toAddresses);        
                   mail.setSubject(msubject);
                   mail.setCcAddresses(c2);
                   mail.setPlainTextBody(mbody);
                   Messaging.sendEmail(new Messaging.SingleEmailMessage[] {mail });
          }
                    
         
      }  
    
 
  global void finish(Database.BatchableContext BC)  
       {  
      
       }  
}

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

  • October 06, 2013
  • Like
  • 0

Hi,

i want to add an IF conditon to do not include some data in Visualforce Email Template

    <apex:repeat var="cx" value="{!relatedTo.Airline_Conf_s__r}">     
          {!IF(!cx.Include_in_Confirmation__c == true}
{
          <tr>        
              <td  style="text-align:left;float:left;" width="195">
                   <apex:outputText value="{!cx.Airlines_Url__c}" escape="false" />
              </td>
             <td width="195" style="text-align:left;float:left;">{!cx.Conf__c}</td>
         </tr>
}
    </apex:repeat>

Is this posiible?

Thanks

Hi,

 

When a new Opportunity is created, I need to notify sales team once they are added to the opportunity.

We cannot write trigger on Opportunity Team Member(i.e., sales team).

Can we do this through workflow rules?

Please provide your suggestions.

 

Thanks,

JBabu.

  • May 07, 2012
  • Like
  • 0

How  we can override  the message provided by the required validation in Page Layout for Required field?

Hi, 

 

I am displaying the products related list as a pdf through visual force page based on the opportunity id. the products lists are displayed with action column with edit and del command links. And product names havinf command link. I am removing the action column through the css. Like

 

.actionColumn{
display:none;
}

 

Now i want to disable the action when we click on the product name. When we click on the product name from pdf it will goes the record in salesforce. Please help me how to disable the action of product name in pdf.

 

 

Thanks,

Lakshmi.

I have a date filed(Datefiled12) which is displayed in Visualforce page and a formula filed(Updatedate) of datetype "date", whenever Datefiled12  is changed on visual force page then  Updatedate has to updated  with value equal to  Datefiled12 +4 days.

 

 

EG:

when user select the below value on visualforce page

Datefiled12  = 1/5/2012

 

then Updatedate = 1/9/2012

 

Can it be possible on page level without any button click?

  • January 05, 2012
  • Like
  • 0

I have an Opportunity Controller that deletes each product on the Opportunity saved. Below is the snippet of code that does this. Olis comes out blank from this query. What am I doing wrong?

 

List<OpportunityLineItem> olis = [Select Id, pricebookentryid From OpportunityLineItem Where Id = :ApexPages.currentPage().getParameters().get('id')];
for (OpportunityLineItem oli : olis) {
    delete oli;
}

 

  • January 04, 2012
  • Like
  • 0

I was browsing on my problem in this community and saw many faced similar issue but not found any exact solution .

 

Problem is simple..I've a map like this 

Map<id,integer> MapAppstoRating = new Map<id,integer>();

 

Controller populates this Map. Now what I want is to show values of this map in my VF page. Other thing is..I want to display name of the associated custom object 'record Name' instead of 'record ID' and integer value.

 

Now thing is, I was able to populate id with integer value with something like :

 

<apex:pageblockTable var="c" value="{!MapAppstoRating }" >
<apex:repeat value="{!MapAppstoRating [c]}" var="temp">
<apex:column value="{!c}" />
</apex:repeat>

<apex:repeat value="{!MapAppstoRating [c]}" var="temp">
<apex:column value="{!temp}" />
</apex:repeat>
</apex:pageblockTable>

 

But it has 2 problems..

 

Firstly..it is populating just first element of associated map. Other rows are not getting populated. But major problem is..I 've to populate name 

instead of IDs... Is that possible somehow. or I need to change my map to get names instead of ids?( changing that will be more cumbersome for me ) 

 

thanks for help!

 

Is there any way to stop the user entering required number of characters when it reaches its field size. For ex if the field lenght is 10 then stop showing him characters after 10 th character even if he tries to enter any character.

  • December 29, 2011
  • Like
  • 0

I have implemented some code from developerforce to the auto-clomplete milestones, and in doing so I am getting the error in the Subject line. I'm not sure what is going wrong, here are the segments where tests are indicating being broken:

 

  Entitlement entl = [select id from Entitlement limit 1];
        String entlId;
        if (entl != null)
          entlId = entl.Id;

here is the link to the code that I am using. Any help would be appreciated:

 

http://wiki.developerforce.com/index.php/Case_Milestones_Utilities_Class

 

 

I am currently trying to create a case comment when a task is added to a case.

 

I currently have the following trigger

 

trigger CMCreateCase on Task (after insert) {
    CaseComment cc = new CaseComment(CommentBody='Test',parentID=caseId);
    insert cc;
}

 How do i find the case ID in the task record

Can a command button call two actions at the same time?

 

I am in a situation where I have two methods Save and Update. I want to either invoke the two methods in one command button action or instantiate method1 in method2 so that the command button will first call method1 and then method2.

 

Thanks

Hello,

 

I have a set of three dependent picklists in my Item__c object: Item__c.Type__c, Item__c.Subtype__c and Item__c.Subsubtype__c. The latter two picklists have many entries each.

 

How do I display just the latter two picklists prefiltered based on a hidden input tag that sets Item__c.Type__c?

 

Here is my code and the behavior I am seeing. It seems to be some kind of bug, or maybe I am just obtuse ;)

 

In VF:

<apex:page showHeader="false" standardController="Item__c" extensions="factoryTxnProductReg">

 

1) In following code, Subtype does not get narrowed down. However, when subtype is selected, subsubtype does narrow down.

<input type="hidden" name="{!Item__c.Type__c}" value="Raw Materials"/>

<apex:inputField value="{!Item__c.Subtype__c}"/>

<apex:inputField value="{!Item__c.Subsubtype__c}"/>

(Here, even if in apex constructor we have item.Type__c = myitemtype but still the subtype picklist does not narrowed down. maybe I should be using getter..?)

 

2) When the following code is used, selecting a Subtype does not narrow down the Subsubtype field.

<input type="hidden" name="{!Item__c.Type__c}" value="Raw Materials"/>

<apex:selectList id="optlist" value="{!Item__c.Subtype__c}" multiselect="false">

  <apex:selectOption itemValue="Containers" itemLabel="Containers"/>

  <apex:selectOption itemValue="Other" itemLabel="Other"/>

</apex:selectList>

<apex:inputField value="{!Item__c.Subsubtype__c}"/>

 

Additional information regarding case 1 above:

 

Although I have seen invisible differences in encoding (using UTF-8 to show Japanese, I have translated to post here) I have double-checked by copy-pasting from the picklist value edit dialog box into Eclipse so this is not an issue.

 

Additional information regarding case 2 above:

 

Type <apex:inputField value="{!Item__c.Type__c}" id="itemtype" onchange="itemtype.value='Raw Materials'" rendered="true"/>{!Item__c.Type__c}

Subtype <apex:inputField value="{!Item__c.Subtype__c}"/>

 

The above code works as follows:

- Type picklist is displayed, showing all values of the picklist (which is not what I want)

- Type gets set to Raw Materials, and Subtype picklist gets narrowed down correctly.

- Even if a different value such as "Waste" is selected for Type, the Subtype picklist remains narrowed down as if Type still equals Raw Materials. 

- However, the Type picklist displays "Waste". (Which is confusing since the UI lies, displaying the a different value from that to which the Type variable was set.)

- I was unable to obtain the desired action with other javascript tags than onchange.

- Should I be making an Action?

- If rendered is changed to "False", the Subtype picklist does not get narrowed down anymore.

I think this is a bug… do I get a t-shirt?

 

Thanks for your help,

 

Matt

  • August 10, 2011
  • Like
  • 0

 

Hi,

How can i make standard field- Name Text(80) as Unique?

It is taking duplicate values and i want to avoid the same.

Cheers,
Devendra S

I created a custom component as recordDisplay what they give in VF guide.

 

<apex:component>

<apex:attribute name="record" description="The type of record we are viewing."type="Object" required="true"/><apex:pageBlock title="Viewing {!record}">

<apex:detail />

</apex:pageBlock>

</apex:component>

 

Then i created a apex page as follows

 

<apex:page >

<c:recordDisplay record="Account" />

</apex:page>

 

It works fine when we pass Account id as query string.But my doubt is if we use recordDisplay for 2 times in a page for Account and Contact object then how i have to modify the code to pass 2 ids as id&cid please tell me.......Thanks 

 

Hi,
 
i placed 5 command links in visual force page and i placed the related data of 5 command links line by line in the same visual force page. Now my requirement is,
 
         if am click on the 4th command link,  want to scroll the visual force page up and display the data of 4th command link..
and if am click on the 2nd command link the page would scroll and display the data of 2nd command link.. please any one help me how to solve these. Actually i got the code in html as
 
 
<html>
<body>
<p>
<a href="#C4">See also Chapter 4.</a>
</p>
<p>
<a href="#C5">See also Chapter 5.</a>
</p>
<h2>Chapter 1</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 2</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 3</h2>
<p>This chapter explains ba bla bla</p>
<h2><a name="C4">Chapter 4</a></h2>
<p>This chapter explains ba bla bla</p>
<h2><a name="C5">Chapter 5</a></h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 6</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 7</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 8</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 9</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 10</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 11</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 12</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 13</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 14</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 15</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 16</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 17</h2>
<p>This chapter explains ba bla bla</p>
</body>
</html>

 

Hello,

I earned the Apex specialist super badge in first attemp, everything was done in first attempt but I did not recive the shinny badge with yellow border, just got simple badge. 
Am I missing something ?
Please let me know.
Hi All,

I have overriden a custom object Edit/New button with Visualforce page to leverage some functionalities like adding text instruction on filling up the form, ajax functionality to fetch information based on coditions etc . However I cannot view the button on Community.

I am using Napili theme on community, I know it does not supports visuaforce but how can I add a lightning component  or something to override the records edit functionality. 

Could I create a custom Tab for viewing the record list using lightning component and then eventually will have to create Detail, New, View pages? How can we achieve it if its possible ? Looks lot of work and maintenance in future for this option.

Please help me on this. 
I have stored the duns information on account in 4 fields-
DUNS Number
Panrent DUNS Number
Domestic DUNS Number
Global DUNS Number
I need to create hierarchy based on these 4 fields, has anyone implemented DUNS hierarchy in salesforce ? any logic/code would be really helpful. More information about DUNS hierarchy is here - https://www-01.ibm.com/support/knowledgecenter/SSWSR9_11.3.0/com.ibm.mdmhs.smpl.gd.doc/r_processhierarchyinfor.html 

 
Hello All,

I want to clone any Opportunity record with or without products where I have a set of fields pre-populated on the Clone page in edit mode. The clone page should have the same look and feel of page layouts assigned to logged in user.
The clone page should also have the Opportunity Products in edit mode so that the user can edit it before clonning.
Is there any package available or if anyone has done this ?

Thanks in advance!

Hi,

 

Does any one know the context of outbound email service. I am sending Single Email Message from customer portal to portal User's email. I want to update record whose ID is present in the email subject using Email service under some other user context.

 

Also if anyone knows if we can change context of user somehow w/o using scheduler please let me know. 

Thanks!

 

-Lakshman

 

 

Hi All,

 

I have a trigger as follows:

 

trigger TriggerOnCase on Case (before update) {
  Set<Id> caseIds = new Set<Id>();
  List<PermissionSetAssignment> visitorPerm = new List<PermissionSetAssignment>(); 
visitorPerm = [SELECT PermissionSetId FROM PermissionSetAssignment WHERE AssigneeId= :UserInfo.getUserId() AND PermissionSet.Name = 'Visitor'];
if(visitorPerm .size()>0) { for(Case c : trigger.new) { //Case status is closed if(c.Status == 'Closed') { caseIds.add(c.Id); //a list of cases } } CaseReply__c[] crcases = [select rCase__c,Id FROM CustObject__c WHERE tatus__c = 0.0 And rCase__r.Id in :caseIds]; for (Case c: trigger.new) { for(CustomObject__c cr : custCases) { if(c.Id == cr.rCase__c) { c.Status.addError('Please chk data!!!!'); } } } } }

 The above trigger looks bulkified to me but I still get an error like:- Failure Message: "System.LimitException: Too many SOQL queries: 101", Failure Stack Trace: "Trigger.CaseBeforeUpdate: line 4, column 1", when I try to deploy code into prod with test classes having an Update operation Case.

 

Can any one please help me get out of this.

Thanks in advance.

 

Regards,

Lakshman

 

 

Hi All,

 

I do not want any hovers on outputField having an Id reference as below:

 

<apex:outputField value="{!objCase.OwnerId}"/>

 I dont want any hover popup when user keeps mouse on this field value, is it possible?

 

Regards,

Lakshman

Hi All,

 

I have a trigger which assigns Leads generated from web to owner on some conditions. My trigger works when I insert from Salesforce but it doesnt works if I assign from WebToLead form. It defaults to the owner present in Lead setting.

 

My trigger is on lead before insert which works fine for normal insert from Salesforce but not from WebtoLead form.

Not sure but curios to know if this a bug?

 

Please help me on this

 

Thanks,

Lakshman

Hi All,

 

I want to automate OpportunityLineItemSchedule insert. For this I have written trigger which invokes future method as below:

 

 

global class OLISchedulerAuto{

    @future 
    public static void OLIScheduler(Set<Id> oliIds) 
    {
        List<OpportunityLineItem> o = new List<OpportunityLineItem>();
        List<OpportunityLineItemSchedule> Schedules = new List<OpportunityLineItemSchedule>();
        o = [Select Id, 
                    Duration__c, 
                    UnitPrice, 
                    ServiceDate, 
                    End_Date__c 
               From OpportunityLineItem where Id In :oliIds];
        for(OpportunityLineItem objO :o)
        {
            Double TotalRevenue = objO.UnitPrice;
            Double NumberOfPayments = objO.Duration__c;
            Double RevenuePerPayment = TotalRevenue / NumberOfPayments;
            Schedules = [Select Id from OpportunityLineItemSchedule where OpportunityLineItemId = :objO.Id];
            delete(Schedules);
            for(Integer i=1; i <= NumberOfPayments ; i++){
                                                            
            Date iScheduleDate = objO.ServiceDate.addMonths(objO.End_Date__c.monthsBetween(objO.ServiceDate)*(i-1));
            //RefOpp.closedate.addmonths(MonthsBetweenPayments*(i-1));
            
    
            OpportunityLineItemSchedule Schedule = new OpportunityLineItemSchedule(Type = 'Both', 
                                                                                   Quantity = 1, 
                                                                                   OpportunityLineItemId = objO.id, 
                                                                                   Revenue = RevenuePerPayment, 
                                                                                   ScheduleDate = iScheduleDate);
            Schedules.add(Schedule);
                                
            }
        }
        insert Schedules;                                                                              
    }
}

I think this will come into recursion as the Trigger is on OpportunityLineItem as below and after insert of schedules it will update OLI as well.

 

trigger TriggerOnOpportunityLineItem on OpportunityLineItem (after insert, after update) {
    Set<Id> oliIds = new Set<Id>();
    for(OpportunityLineItem oli: trigger.new)
    {
        oliIds.add(oli.Id);
    }
    if(oliIds.size()>0)
    {
       OLISchedulerAuto.OLIScheduler(oliIds);
    }
}

 

I just want to achieve automatic scheduling.

Please let me know your valuable comments on this. Thank you!

 

Regards,

Lakshman

 

Hi All,

 

I have a requirement where I need to implement inline Add, Edit, Delete and Save opportunity products through VFP on Opportunity layout.

After doing this I want to Schedule each product when clicked through the custom Products section of Opportunity.

 

If any one has done this before, please help me.

Thanks in advance.

 

Regards,

Lakshman

Hi All,

 

I have a requirement where I need to Send Email to fixed users on following conditions:

 

1. I have a field on Account named PublishDate__c which is of type Date.

2. I need to Send email to Users(which are fixed) after every three months from this Date, so it would be like: we will send email after 3 months from this date and then after 6 months then 9 and so on.

 

How can we achieve this, through Scheduler would it be possible? If yes how and if no then is there any other way out?

 

Please help me on this.

 

Regards,

Lakshman

Hi All,

 

Below is my script used for a custom button. I am unable to store the date and get error like below:

 faultstring:''0.0001823305154980938' is not a valid value for the type xsd:date', 

 

{!REQUIRESCRIPT("/soap/ajax/22.0/connection.js")}
var connection = sforce.connection;

var ex = new sforce.SObject("CustomF1__c");
ex.DateF1__c = {!DATEVALUE(TEXT(CustomF2__c.DateF2__c))};
ex.Name = "{!CustomF2__c.Name}";

var rs = connection.create([ex]);
if (rs[0].success=='false')
alert("Message"+rs[0].errors.message);

 CustomF2__c is the object where I am creating this button and CustomF1 is the object which I want to create when user hits this button.

Please help me on this. Thanks in advance!

 

Regards,

Lakshman

 

Hi All,

 

I want to know how can I query for Users having a particular profile permission sets in an Apex class. I am doing following query:

 

SELECT PermissionSetId FROM PermissionSetAssignment WHERE AssigneeId= :UserInfo.getUserId() AND PermissionSet.Name = 'EntityFasadUser'

 

There is an compilation error as below:

Save error: sObject type 'PermissionSetAssignment' is not supported.

 

Please help me on this. Thanks in advance.

 

Regards,

Lakshman

Hi All,

 

I want to display table vertically instead of horizontal. How can we do this. The table should look like below:

 

Vertical header1  CellValue-VH1-1  CellValue-VH1-2...CellValue-VH1-n 

Vertical header2 CellValue-VH2-1  CellValue-VH2-2...CellValue-VH2-n 

.

.

.

Vertical headern CellValue-VHn-1  CellValue-VHn-2...CellValue-VHn-n 

 

P.S.: Where Vertical header would be fixed and the Cell Values will come from list.

 

How can we achieve the above sample table in visualforce using apex:repeat? Any thoughts/suggestion to this are appreciated.

Thank you!

 

Regards,

Lakshman

Hi All,

 

Need help in writing an Apex trigger to assign incoming message from some address say abc@abc.com to a predefined case team member say MyTeam which has one member. How can we do this?

Please help me on this.

Thank you!

 

Regards,

Lakshman

Hi All ,

 

I want to get id for my attached document on FeedItem. The Feed is for my custom object.

In want to get the content document id whose prefix is 069 from my inserted customObject__Feed having.

Can anyone help me in this?

 

Thank you!

 

Regards,

Lakshman

Hi All,

 

I have a pop-up page which sends email to end user, I have done validation on server side and want to show Apexpagemessages on VFP through server side validations but unfortunately I am not able to show page messages when I use actionstatus and command button action.

Below is my Visualforce page code snippet to this:

 

<apex:pageMessages id="errors"/>
<apex:pageBlockButtons rendered="{!showButtons}" id="buttons"> <apex:commandButton action="{!Send}" value="Send" rerender="buttons" status="closer"/> <apex:commandButton value="Cancel" onclick="javascript&colon;closeWindow()"/> <apex:actionStatus startText="(Sending...)" stopText="" onStop="window.close();" id="closer"/> </apex:pageBlockButtons>

Please let me know your thoughts/suggestions on this.

Thank you!

 

Regards,

Lakshman

Hi All,

 

I have a related list within which I want to add a URL field which would be set from my apex class. The scenario is as below:

 

I have an Custom Object A which has Custom object B in it.

Now in this Custom object B's related list we have Action, Name etc columns.

I want to add a new column URL with value View(link will be dynamically added by Apex class) and when user clicks on this url it will show attachment which is stored in custom object B.

So my question is that can I dynamically add a URL field in this related list or I will have to create an inline Visualforce page for this?

If yes then how should I proceed?

 

Please let me know if anyone needs more details for this.

Thank you!

 

Regards,

Lakshman

Hi All,

 

I am trying to bind visualforce value to an Apex class variable. Below is my sample code:

 

<textarea id="editor1" name="editor1">{!apexVariable}</textarea>

<apex:commandButton value="Check" action="{!check}"/>

Below is my Apex class:

 

public class MyClass

{

public String apexVariable{get;set;}

public void check()

{

System.debug(apexVariable+'>>>><<<<');

}

}

 

My question is how do I get the changed value from visualforce page to apex class variable using this html tag?

I know that if I use apex:inputtextarea it will automatically bind it to the desired apex class variable but how to work on simple html tags.

 

 

Regards,

Lakshman

Hi All,

 

I want to declare some constants which will be used by my Apex class. I find two approches to it.

 

1) Custom Settings

2) Global class and declare static varible in the that class. Then access them in my desired class.

 

Let me know which one would be better.

Thank you!

 

Regards,

Lakshman

I am having the following Apex code in my class:

 

public List<SelectOption> getItems() {
                List<SelectOption> options = new List<SelectOption>();
                options.add(new SelectOption('US','US'));
                options.add(new SelectOption('CANADA','Canada'));
                options.add(new SelectOption('MEXICO','Mexico'));
                return options;
        }

The visual force page code which fetches all information is as below:

 

<apex:selectList size="1" id="countryList" onChange="setCountry(this.value);">
    <apex:selectOptions value="{!items}"/>
    </apex:selectList>

 

 

The default value that we get after executing this visual force page is US, but I want it to be suppose Canada, How can i do it.

Please Help.

 

Regards,

Lakshman

 

~Share Knowledge, grow more~

I need to write a formula to calculate the average currency of multiple fields which some can be with blank fields.
I have created app related to university.In this for Student object I need to show some information in one table with 4 columns.
Please guide me how to create table in custom object using Visualforce.

Here I am posting my code which I tried.

<apex:page Controller="Student">
   <apex:pageBlock title="Course Details">
     <apex:pageBlockTable value="{!Student_c}" var="stu">
      <apex:column value="{!stu.Sr_no__c}"/>
      <apex:column value="{!stu.Course_1__c}"/>
      <apex:column value="{!stu.Professor__c}"/>
      <apex:column value="{!stu.Final_Grade__c}"/>
</apex:pageBlockTable>

      </apex:pageBlock>
</apex:page>
----------------------------------------------------------------------
Error: Unknown property 'String.Sr_no__c'



Thanks.
We have our product connected to Salesforce so that we can see customer usage information in SFDC. This is done via API. 

Lately, records have not been getting created in the Account object, and Account updates are happening sporadically. We can't seem to find a pattern as to why some accounts are getting updated, while others are not. We are also not getting any error codes for the accounts that aren't getting updated, which is odd. 

We also create records under a custom object, and the update there is random as well. 

What is the best way to figure out what could be happening if we're not getting any error codes? Thanks so much for your help! 
I'm trying to update the chart colors in our company dashboard to match our brand palette.

So, in Sandbox, Developer Mode I've selected Visualforce Component and inserting the following code:

    <apex:chart><colorSet="#37241E,#94B3C8,#4D4E24,#BD8025,#816A4A,#F0E68C"/>
    </apex:chart>

But when I try to save I'm getting an error (problem!) message every single time.

What am I doing wrong??!!

Thanks
I have a flow embedded on a VF page and a lightning component with an iframe to the VF page. The VF page renders for me when I log into the community (Napili template), but not when I log in as an external user. I have ensured the external user has access to the VF page.

How can I expose this VF/flow to external users? Here's my lightning component:

<aura:component implements="forceCommunity:availableForAllPageTypes" access="global">
    <iframe src="https://xxx.salesforce.com/apex/my_vf_page" width="100%" height="1000px;" frameBorder="0"/>
</aura:component>
HI,

Could anyone tell me how to get each control to be on a separate line?
I thought it was doing this by default, but my outputLabels and inputCheckboxes aren't.
Clone Invoice To and Clone Project Contacts should be on separate lines with either the corresponding checkbox next to them or direclty underneath 

User-added image


This section is within a PageBlock > PageBlockSection and then I have two PageBlockSectionItems. I've put it within an ouputPanel because of the restriction of only having 2 child components.

Many thanks for any help.

<apex:pageBlockSectionItem labelStyle="width:2%" dataStyle="width:10%" dataTitle="Select field to clone">
                        <apex:outputPanel>
                            <apex:outputLabel value="Opportunity to Clone" for="selectedOpp"/>
                            <apex:inputText id="selectedOpp" value="{!selectedOpportunity.Name}" disabled="true" />
                            
                            <apex:outputLabel value="Opportunity name" for="oppName"/>
                            <apex:inputText id="oppName" />
                            
                            <apex:outputLabel value="Stage" for="oppStage"/>
                            <apex:inputField id="oppStage" value="{!selectedOpportunity.StageName}"/>
                                          
                            <apex:outputLabel value="Close Date" for="oppCloseDate"/>
                            <apex:inputField id="oppCloseDate" value="{!selectedOpportunity.CloseDate}"/>
                            
                            <apex:outputLabel value="Live Date" for="oppLiveDate"/>
                            <apex:inputfield id="oppLiveDate" value="{!selectedOpportunity.Expected_Live__c}"/>
                                                   
                            <apex:outputLabel value="Clone Invoice To: " for="invoiceToSelected" />
                            <apex:inputCheckbox id="invoiceToSelected" title="Clone Invoice To" selected="true" />
                            
                            <apex:outputLabel value="Clone Project Contacts: " for="projectContactsSelected"/>
                            <apex:inputCheckbox id="projectContactsSelected" title="Clone Project Contacts" selected="true" />
                            
                            <!--<apex:outputLabel value="Invoice To count: " for="oppInvoiceTo"></apex:outputLabel>
                            <apex:inputField id="oppInvoiceTo" value="{!selectedOpportunity.Invoice_To_Count__c}" />-->
                                                
                            <!--<apex:outputLabel value="Purchase Order Attachment" for="purchaseOrderSelected"></apex:outputLabel>
                            <apex:inputCheckbox id="purchaseOrderSelected" label="Purchase Order Attachment" title="Clone Purchase Order Attachment" selected="true" />
                            <apex:inputText id="oppPurchaseOrderAtt" disabled="true" />-->

                            <!--<apex:outputLabel value="Number of contacts: " for="oppProjectContacts"></apex:outputLabel>
                            <apex:inputField id="oppProjectContacts" value="{!selectedOpportunity.Invoice_To_Count__c}" />-->                                            
                        </apex:outputPanel>
                        
                    </apex:pageBlockSectionItem>
Hi Community, 

I have the below VisualForce Email Template:
 
<messaging:emailTemplate subject="[Email] #{!relatedTo.CaseNumber} - {!relatedTo.Subject} - {!relatedTo.Contact.Name}" recipientType="User" relatedToType="Case">
<messaging:htmlEmailBody >
<html>
<style type="text/css">
body {font-family: arial; size: 12pt;}
</style>
<body>
    <img src="https://my.salesforce.com/servlet/servlet.ImageServer?id=01561000001JYOm&oid=OBFUDCATED"/><br/>
A <b>new Email</b> was added to the case below:
<br />------------------------
<br />• Case #: {!relatedTo.CaseNumber}
<br />• Account:&nbsp;<apex:outputLink value="https://my.salesforce.com/{!relatedTo.Account}">{!relatedTo.Account.Name}</apex:outputLink>
<br />• Contact Name:&nbsp;<apex:outputLink value="https://my.salesforce.com/{!relatedTo.Contact}">{!relatedTo.Contact.Name}</apex:outputLink>
<br />• Case status: {!relatedTo.Status}
<br />• Priority: {!relatedTo.Priority}<apex:image id="theImage" value="{!relatedTo.Priority_Flags_URL__c}" width="12" height="12"/>
<br />• Link: https://my.salesforce.com/{!relatedTo.Id}
<apex:outputPanel rendered="{!relatedTo.Jira__c!=null}" >
<br />• Jira issue:&nbsp;<apex:outputLink value="https://www.atlassian.net/browse/{!relatedTo.Jira__c}">{!relatedTo.Jira__c}</apex:outputLink></apex:outputPanel>
<apex:outputPanel rendered="{!relatedTo.Git_Link__c!=null}" >
<br />• Git Link:&nbsp;<apex:outputLink value="{!relatedTo.Git_Link__c}">{!relatedTo.Git_Link__c}</apex:outputLink></apex:outputPanel>
<br />------------------------
<apex:outputPanel rendered="{!relatedTo.Last_Incoming_Email_Content__c!=null}" style="white-space:pre;">
<h3><br /><b><u>Case Last Incoming Email:</u></b></h3><br />
<apex:outputField value="{!relatedTo.Last_Incoming_Email_Content__c}" style="white-space:pre;"></apex:outputField>
</apex:outputPanel>
</body>
</html>
</messaging:htmlEmailBody>
</messaging:emailTemplate>
This VF Email is used in a WorkFlow rule, to send and Email Alert for each new incoming Email to the case which is under his custody. The WorkFlow Rule is pretty simple, it 'listens' to the change in the Custom Field 'Last_Incoming_Email_Content__c', and fires the email notification.

The issue is that the Email notification doesn't populate the Merge Fields: 

User-added image

Below is my email client's 'original' massage:
Date: Mon, 31 Oct 2016 12:13:08 +0000 (GMT)
From: System <obfuscated>
Sender: noreply@salesforce.com
To: "obfuscated" <obfuscated>
Message-ID: <QLFAw000000000000000000000000000000000000000000000OFWV9W004MUKYztRQrCfzfyDk0URBQ@sfdc.net>
Subject: [Email] #00008640 -
  -
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_Part_16014_1675508803.1477915988038"
X-SFDC-LK: 00D61000000edsH
X-SFDC-User: 00561000001nhq1
X-Sender: postmaster@salesforce.com
X-mail_abuse_inquiries: http://www.salesforce.com/company/abuse.jsp
X-SFDC-TLS-NoRelay: 1
X-SFDC-Binding: 1WrIRBV94myi25uB
X-SFDC-EmailCategory: workflowActionAlert
X-SFDC-EntityId: obfuscated
X-SFDC-Interface: internal

------=_Part_16014_1675508803.1477915988038
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit


------=_Part_16014_1675508803.1477915988038
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit


<html>
<style type="text/css">
<!--

body {font-family: arial; size: 12pt;}

//-->
</style>
In addition, when testing with the 'test and verify merge fiels' in the Email Template editor, everything looks fine:

User-added image

Thank you
Hello,

I earned the Apex specialist super badge in first attemp, everything was done in first attempt but I did not recive the shinny badge with yellow border, just got simple badge. 
Am I missing something ?
Please let me know.
I have the following code, but when side bar collapsed - text aligns to the center.  When side bar extended - alignment is thrown off. Can someone help?
 
<apex:page standardController="Account" >

<apex:outputPanel style="font-size: 38px;background-color:yellow;width:100%;padding:550px;" rendered="{!account.Current_Engagement_Level__c =='At-Watch'}">At-Watch</apex:outputPanel>
    
<apex:outputPanel style="font-size: 38px;background-color:green;width:100%;padding:550px;" rendered="{!account.Current_Engagement_Level__c =='Engaged'}">Engaged</apex:outputPanel>

<apex:outputPanel style="font-size: 38px;background-color:red;width:100%;padding:550px;" rendered="{!account.Current_Engagement_Level__c =='At-Risk'}">At-Risk</apex:outputPanel>

</apex:page>

collapsed:
User-added image

not collapsed:
User-added image
Hello,

We are new to Salesforce and currently have only Sales Cloud licenses. We are thinking of adding some App Cloud licenses as well. Our Salesforce rep is telling us that the only two standard objects that we will not have access to from our App Cloud licenses are Lead and Opportunity. I have a feeling that the list is longer than that.

Does anyone know of a resource that indicates which standard objects are available in each edition? 

I'm familiar with this reference guide but it does not indicate which edition has access to the object: https://resources.docs.salesforce.com/sfdc/pdf/object_reference.pdf

Thank you,
Brian
Hi All,

I have overriden a custom object Edit/New button with Visualforce page to leverage some functionalities like adding text instruction on filling up the form, ajax functionality to fetch information based on coditions etc . However I cannot view the button on Community.

I am using Napili theme on community, I know it does not supports visuaforce but how can I add a lightning component  or something to override the records edit functionality. 

Could I create a custom Tab for viewing the record list using lightning component and then eventually will have to create Detail, New, View pages? How can we achieve it if its possible ? Looks lot of work and maintenance in future for this option.

Please help me on this. 
I would like to change this code:

tmp.add((f.startsWith('Address'))?mapField.get(f):f);

To add all the value in mapField into tmp? Any help is appreciated.

Thanks
  • February 02, 2016
  • Like
  • 0
Hi,

I am creating a visualforce page on opportunity. I am refering 4 lookup fields in this page. I am inserting this page in opportunity page layout. The page looks as

User-added image

The visualforce code section for Teleasales Partner is

<apex:pageBlockSectionItem id="section1" >
<apex:outputLabel value="Telesales Partner" for="tp_id" />
<apex:panelGroup >
  <apex:outputField value="{!opportunity.Telesales_Partner__c}" id="tp_id">
   <apex:inlineEditSupport showOnEdit="saveButton, cancelButton" event="ondblclick" changedStyleClass="myBoldClass" resetFunction="resetInlineEdit"/>
  </apex:outputField>
  <apex:outputLabel value="Commission Applicable? " for="tp_id2" style="font-weight:bold;font-family:Arial,Helvetica,sans-serif;" />
  <apex:inputField value="{!opportunity.Telesales_Partner_Commission_Flag__c}" id="tp_id2" onchange="selectFlag()">
  </apex:inputField>
</apex:panelGroup>
</apex:pageBlockSectionItem>

How can I disable link to lookup field but need to keep look up functionality. I want to disable link becase link opens record in page layout section as
User-added image

which I don't need ?

Could you please help ? Let me know if you need more details

Thanks,

clouddev@surashri