• Laxman1975
  • NEWBIE
  • 5 Points
  • Member since 2016
  • HCL Technologies

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 6
    Replies
Hi All,

We have Quote as custom child object under Opportunity. On Opportunity Page layout - > Related list for Quote-> New Button is override by visualforce in classic. Using retURL, we are getting parent id i.e. opportunity id and we can do necessary business logic.

But in lightening, as we cannot use retURL , so we have override New button with Lightening Component with HasRecordId. But we are not able to get parent record id i.e. Opportunity. Does any one know solution on this? Please let us know any suggestion or comments. 

Regards
Laxman
Hi All,

I have create a formula which will give me total of last 12 months. I have 13 columns for storing data which include January to December data and 1 month i.e from Last year.

Based on Current Date formula should give me last 12 months total.

Here is formula - 

CASE(MONTH( TODAY()), 
1, Feb__c + Mar__c + Apr__c + May__c + Jun__c + Jul__c + Aug__c + Sep__c + Oct__c + Nov__c + Dec__c + LM__c,
2, Jan__c + Mar__c + Apr__c + May__c + Jun__c + Jul__c + Aug__c + Sep__c + Oct__c + Nov__c + Dec__c + LM__c,
3, Jan__c + Feb__c + Apr__c + May__c + Jun__c + Jul__c + Aug__c + Sep__c + Oct__c + Nov__c + Dec__c + LM__c,
4, Jan__c + Feb__c + Mar__c + May__c + Jun__c + Jul__c + Aug__c + Sep__c + Oct__c + Nov__c + Dec__c + LM__c,
5, Jan__c + Feb__c + Mar__c + Apr__c + Jun__c + Jul__c + Aug__c + Sep__c + Oct__c + Nov__c + Dec__c + LM__c,
6, Jan__c + Feb__c + Mar__c + Apr__c + May__c + Jul__c + Aug__c + Sep__c + Oct__c + Nov__c + Dec__c + LM__c,
7, Jan__c + Feb__c + Mar__c + Apr__c + May__c + Jun__c + Aug__c + Sep__c + Oct__c + Nov__c + Dec__c + LM__c,
8, Jan__c + Feb__c + Mar__c + Apr__c + May__c + Jun__c + Jul__c + Sep__c + Oct__c + Nov__c + Dec__c + LM__c,
9, Jan__c + Feb__c + Mar__c + Apr__c + May__c + Jun__c + Jul__c + Aug__c + Oct__c + Nov__c + Dec__c  + LM__c,
10, Jan__c + Feb__c + Mar__c + Apr__c  + May__c + Jun__c + Jul__c + Aug__c + Sep__c + Nov__c + Dec__c + LM__c,
11, Jan__c + Feb__c + Mar__c + Apr__c + May__c + Jun__c + Jul__c + Aug__c + Sep__c + Oct__c + Dec__c + LM__c,
12, Jan__c + Feb__c + Mar__c + Apr__c + May__c + Jun__c + Jul__c + Aug__c + Sep__c + Oct__c + Nov__c +  LM__c,
0)

So I have check month number based on current date and perform sum of last 12 months(fields) data. But formula compile size execeed 5000 limit. Can some one help me to reduce this size?

Or any other way to do that using formula or workflow? I dont want to build any trigger just for this calculations.

Thanks in advance.

Regards
Laxman
Hi All,

I would like to create roll up summary of few fields from Account on account itself using Account Hierarchy. 

Using below query I can get sum of booking upto 3 levels in account Hierarchy.

SELECT SUM(Booking__c) 
                               FROM   Account
                               WHERE (Id =:accountId) OR (ParentId =:accountId) OR (Parent.ParentId =:accountIds

We have 50K accounts and that need to be processed in Batch. 

If I will do this in Batch with size 200 records then how to breakup above query so that Summary will be calculated only for accounts which are hierarchical connected? 

Or is it that I need to process only one account record at a time.

Appreciate help on this or any other solution/work around for this. Thanks

Laxman
Hi All,

I'm trying to connect other Salesforce org using Partner WSDL.

I'm getting below error :

Web service callout failed: Unable to parse callout response. Apex type not found for element Subject__c 

String soqlQuery = 'SELECT Subject__c, Closed_Date__c FROM Service_Incident__c';
        
qr = pc.Query(soqlQuery);
 
Hi,
 
I would like to display data in tabular format, as below:
 
Customer        Brand         Series     Year    January    February   March     April        May         June                     
Best Solution    Apple          S5          2015    $20,500     $15,300     $12,200    $16,000    $23,700     $28,900
Best Solution    Samsung     A6          2015    $21,000     $23,400     $15,440    $19,700    $25,300     $32,430
Best Solution    Apple          S5          2016    $18,200     $11,100     $18,900    $11,000    $24,600   

My question is what should I do to get my data in above layout. I will appreciate your help, please include code to show to how to write code and layout the fields to get the above output, as I am new to Apex and Visualforce. Thanks. 

 
Please see my apex class and Visualforce page. My apex class and vf page are producing results result as follows:
 
Customer          Brand          Series     Year    Month     Net Sale
Best Solution    Apple          S5          2015    1              $20,500  
Best Solution    Apple          S5          2015    2              $15,300
...
...
...
Best Solution    Apple          S5          2016    1              $18,200
...
...
Best Solution    Samsung     A6          2015    1              $21,000  
...
...
 
Apex Class
 
public with sharing class SaleSum {
 
    public Summary[ ] Summaries { get; set; }
 
 public SaleSum() {
        AggregateResult[ ] results = [
        Select Brand__c, CALENDAR_MONTH(Invoice__r.Invoice_Date__c) InvMn, CALENDAR_YEAR(Invoice__r.Invoice_Date__c) InvYr,
            SUM(Net_Amount_US__c) NetUS, SUM(Net_Amount_CDN__c) NetCDN, Invoice__r.Account__r.Currency_Id__c,     
            Invoice__r.Account__r.Customer_Id__c
        From Invoice_Line__c
        Group By Brand__c, CALENDAR_MONTH(Invoice__r.Invoice_Date__c), CALENDAR_YEAR(Invoice__r.Invoice_Date__c),
            Invoice__r.Account__r.Currency_Id__c, Invoice__r.Account__r.Customer_Id__c
        ];
       
        Summaries = new List<Summary>();
        for (AggregateResult gr : results) {
            Summaries.add(new Summary(gr));
        }
    }
 
    public class Summary {
        public Decimal NetUS { get; private set; }
        public Decimal NetCDN { get; private set; }
        public String Brand { get; private set; }
        public Integer InvMn { get; private set; }
        public integer InvYr { get; private set; }
        public String Curren { get; private set; }
        public String Customer { get; private set; }
       
   public Summary(AggregateResult gr) {
            NetUS = (Decimal) gr.get('NetUS');
            NetCDN = (Decimal) gr.get('NetCDN');
            Brand = (String) gr.get('Brand__c');
            InvMn = (Integer) gr.get('InvMn');
            InvYr = (Integer) gr.get('InvYr');
            Currency = (String) gr.get('Currency_Id__c');
            Customer = (String) gr.get('Customer_Id__c');
        }
    }
 
}
 
Visualforce Page
<apex:page controller="TestController" title="Monthly Net Amount by Customer" >
    <apex:pageBlock title="Monthly Net Amount by Customer">
    <table>
    <tr>
            <td>Customer</td>
            <td>Brand</td>
            <td>Series</td>
            <td>Year</td>
            <td>Month</td>
            <td>Net Sale</td>
    </tr>
   
<apex:repeat value="{!Summaries}" var="summary">
           <tr>
                <td><apex:outputText value="{!summary.Name}"/></td>               
                <td><apex:outputText value="{!summary.Brand}"/></td>
                <td><apex:outputText value="{!summary.Series}"/></td>
                <td><apex:outputText value="{!summary.InvYr}"/></td>
                <td><apex:outputText value="{!summary.InvMn}"/></td>
                <td><apex:outputText value="{!summary.NetUS}" rendered="{!IF(summary.Curren='US',true,false)}"/></td>
                <td><apex:outputText value="{!summary.NetCDN}" rendered="{!IF(summary.Curren='CAD',true,false)}"/></td>
            </tr>
      </apex:repeat>
      </table>
    </apex:pageBlock>
</apex:page>
 
I'm trying to create a formula field which wwill dsipalay an assigned value based on the opportunity stage: 

For Example: 
Lead/Idea Generation = 02-Noticed
Needs Analysis = 04-Validated
Request for Plan/Proposal = 05-Qualified
Working likely = 05-Qualified
Verbal  = 05-Qualified
I/O In House - Order In = 06-Conditional
Contract Complete  = 07-Won/Implementing
Lead Disqualified  = Lost
Lost  = Lost

Here is the formula field i started:

IF(ISPICKVAL(StageName ,"Lead/Idea Generation"), 02-Noticed),
  If(ISPICKVAL(StageName ,"Needs Analysis"), 04-Validated),
     If(ISPICKVAL(StageName ,"04-Validated"), 100, 0.1),
        If(ISPICKVAL(StageName ,"Request for Plan/Proposal","Working likely","Verbal" ), 05-Qualified),
           If(ISPICKVAL(StageName ,"I/O In House - Order In"), 06-Conditional),
              If(ISPICKVAL(StageName ,"Contract Complete"), 07-Won/Implementing),
                 If(ISPICKVAL(StageName ,"Lead Disqualified", "Lost"), Lost
)
)
)
)
)
)
)
I have an escalation rule in case objects.After 1 day i triggering my escalation rule. Is Escalated is getting set on case.
How I will change the status of case to "Escalated" after escalation automatically.
Please provide me your suggestions.
So...I created a checkbox formula field on a case that clicks true if the following criteria are met:

IF( (TODAY()> Contact_Cust_Identify_Issues__c ) && ISBLANK(Contacted_Customer_Date__c) 
,true,false)

I then created a workflow that SHOULD trigger an email and create a completed task that states the email was sent. I chose to have the workflow evaulate each time the case meets criteria. The workflow is not firing. 

Here is the workflow rule:
(Case: Case Record TypeEQUALSCase; VOC Response Plan) AND (Case: > 2 DaysEQUALSTrue) AND (Case: StatusEQUALSNew)

Is the formula field update not considered an edit? What am I doing wrong here? I feel dumb because this seems so simple.

Please help,

Shannon
Hi,
I need to be able to send hard copy invitation for campaign members and I need to generate list of labels with names/addresses of contacts and these labels would be later used for envelopes with the invitation. This list of labels needs to be 3 columns x 8 rows. We have proffesional edition so I cannot use apex, only visualforce. Im trying my luck with the code below, but Im not good at that. Columns are responsive so they change the width according to cell content and still dont know how to specify fixed number of rows per page. Many thanks for help
<apex:page standardController="Campaign" showHeader="false" applyBodyTag="false" >

      <apex:pageBlock >
          <apex:pageBlockSection columns="3" showHeader="false">
                <apex:repeat value="{!Campaign.CampaignMembers}" var="line" >   
                    <apex:pageBlockSectionItem rendered="{!line.Status='Sent'}" dataStyle="width:33%" labelStyle="width:33%" >
    
                    {!line.Contact.Name}<BR/>
                    {!line.Contact.MailingStreet}<BR/>
                    {!line.Contact.MailingPostalCode} {!line.Contact.MailingCity}<BR/>
                    {!line.Contact.MailingCountry}<BR/>  
                    
                    </apex:pageBlockSectionItem>
                </apex:repeat>
          </apex:pageBlockSection>
      </apex:pageBlock> 
      
    
</apex:page>
Hi All,

I'm trying to connect other Salesforce org using Partner WSDL.

I'm getting below error :

Web service callout failed: Unable to parse callout response. Apex type not found for element Subject__c 

String soqlQuery = 'SELECT Subject__c, Closed_Date__c FROM Service_Incident__c';
        
qr = pc.Query(soqlQuery);