• Jorge Ortega
  • NEWBIE
  • 35 Points
  • Member since 2015

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 7
    Replies
Hi,

We have a modified Edit All for our Opportunity Products.  There is a column on the Edit All page that contains a number of dropdown fields that are the configuration for the Product on that line.  We dynamically assign the Field Set to the product and display the config fields for it.  This all displays fine and the dropdowns work for the user.  However, when we save it will use the last fieldset as a template for saving.

For example:

Product 1 has Config A, B & C
Product 2 has Config B & C

When saved Product 2 saves fine.
Product 1 saves Config A into B and Config B in C and discards Config C altogether.

This makes sense as the last field set the page knows about is Product 2's.  Has anyone run into this and gotten it to remember Product 1's FieldSet so it binds the values to the correct field?

Here is the code we are using to display the code in a single column of the Edit All table:

<apex:repeat value="{!$ObjectType.OpportunityLineItem.FieldSets[layout]}"  var="f" >
                        <div style="margin-bottom:1em">
                        <span id="myLabel" class="label" style="align:left"> {!f.fieldPath} </span>
                        <apex:inputField value="{!oppLItem[f]}" required="{!OR(f.required, f.dbrequired)}" onchange="foo(this);"/><br/>
                          </div>
</apex:repeat>

Thanks!
Lee
Hi,

I have used one email template in the single messaging and called in the batch class .........Now i need to call another email template in the batch class based on the condition like in start method 
for eg: string soql = 'select id , Name from Account where Name = 'siva' ';
string soql 3 = 'select id , Name from Account where Name = 'sivakumar' ';

here i used one email template in the batch class
global class  WTPAA_sendReminderwagenoticestoemployees Implements Database.Batchable <sObject> {
    global Database.queryLocator start(Database.BatchableContext bc) {
        
        Date d = Date.today();
     //   String SOQL = 'SELECT Id, WTPAA_Employee_Email__c,WTPAA_Related_To__r.id,WTPAA_Status__c,WTPAA_Reminder_for_2nd_week__c,WTPAA_Reminder_for_3rd_week__c,WTPAA_Reminder_for_4nd_week__c FROM WTPAA_Wage_Notice__c WHERE (WTPAA_Reminder_for_2nd_week__c OR WTPAA_Reminder_for_3rd_week__c OR WTPAA_Reminder_for_4nd_week__c = :d) AND WTPAA_Status__c =  sent ';
        String SOQL = 'SELECT Id,WTPAA_Company_Name__c, WTPAA_Employee_Email__c,WTPAA_Related_To__r.id,WTPAA_Is_same_Employer_Mailing_Address__c FROM WTPAA_Wage_Notice__c WHERE WTPAA_Is_same_Employer_Mailing_Address__c = false';
        return Database.getQueryLocator(SOQL);
    }

    global void execute(Database.BatchableContext bc, List<WTPAA_Wage_Notice__c> wagenotice) {
        List<Messaging.SingleEmailMessage> mailList = new List<Messaging.SingleEmailMessage>();
       Emailtemplate et = [select id, developername , IsActive from Emailtemplate where developername = 'WTPAA_Reminder_for_2_weeks' AND IsActive = true];
      
        for(WTPAA_Wage_Notice__c w: wagenotice) {
           system.debug('size of the list' +wagenotice.size());
          //  List<String> toAddresses = new List<String>{w.WTPAA_Employee_Email__c};           
            Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
          //  mail.setToAddresses(toAddresses);
          
            mail.SetTemplateid(et.id);
            mail.setSaveAsActivity(false);
          
           mail.setTargetObjectId(w.WTPAA_Related_To__r.id);
           system.debug('ID of Contact' +w.WTPAA_Related_To__r.id);
           mail.setWhatid(w.id);
        for(OrgWideEmailAddress owa : [select id, Address from OrgWideEmailAddress]) {

           if(owa.Address.contains('replicastatelabor@gmail.com')) {
            mail.setOrgWideEmailAddressId(owa .id);
           }
          } 
           
            system.debug('IDDDDDDDDDDD*******' +et.id);
            mailList.add(mail);   
               
        } 
        Messaging.sendEmail(mailList);        
    }

    global void finish(Database.BatchableContext bc) {
    }
}

please help me out.....................................................................................................
  • October 08, 2015
  • Like
  • 0
Hi,

We have a modified Edit All for our Opportunity Products.  There is a column on the Edit All page that contains a number of dropdown fields that are the configuration for the Product on that line.  We dynamically assign the Field Set to the product and display the config fields for it.  This all displays fine and the dropdowns work for the user.  However, when we save it will use the last fieldset as a template for saving.

For example:

Product 1 has Config A, B & C
Product 2 has Config B & C

When saved Product 2 saves fine.
Product 1 saves Config A into B and Config B in C and discards Config C altogether.

This makes sense as the last field set the page knows about is Product 2's.  Has anyone run into this and gotten it to remember Product 1's FieldSet so it binds the values to the correct field?

Here is the code we are using to display the code in a single column of the Edit All table:

<apex:repeat value="{!$ObjectType.OpportunityLineItem.FieldSets[layout]}"  var="f" >
                        <div style="margin-bottom:1em">
                        <span id="myLabel" class="label" style="align:left"> {!f.fieldPath} </span>
                        <apex:inputField value="{!oppLItem[f]}" required="{!OR(f.required, f.dbrequired)}" onchange="foo(this);"/><br/>
                          </div>
</apex:repeat>

Thanks!
Lee
hi,

I was trying to use the CASE formula for my picklist and tried almost everything and was also looking into this Forum here but haven't found a solution.

Here is my code:

IF(CASE( Select_Units__c,"Imperial",2.34, IF( Select_Units__c ,"SI",3.22,FALSE),

IF(CASE( Select_Product__c,"Apples",3.45, IF( Select_Product__c ,"Fish,Scampi",3.60,3.48),

IF(CASE( Select_Units__c,"Imperial","KJ/KG*C", IF( Select_Units__c ,"SI","Btu/lb*F")))))))

And the error message always is: "Error: Field Select_Units__c is a picklist field. Picklist fields are only supported in certain functions. Tell me more"
Start_date__c = 02/06/2015 (Feb 6, 2015)
end date - 02/05/2016 (Feb 5, 2016)
We will be billing our customer every month. I am trying to capture Month_billing_date. For eg
 Month_billing_date__c for Feb 6 - March 5 should be March 5
 Month_billing_date__c for March 6 - April 5 should be April 5.
I reasearched various portals and resources I am not able to achieve what I want. Please help.
Thanks in advance!
  • October 05, 2015
  • Like
  • 0