• TN Admin
  • NEWBIE
  • 20 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 6
    Replies
Is there any way to send a mail to the list of mails in the custom field?....

We have one custom field in a custom object. User will enter list of emails in one custom text field called "EmailIds" and the user clicks on the button in the same object then it should send email to all user mensioned in the custom field. 
Time based scheduled action in process/workflow irrespective of record change. Is there any possibility to achieve it. Please share if there is any other alternative solution.

Thanks in Advance
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")}

var Suite= document.getElementById('00Nq00000017vbe_ileinner').innerHTML;
var TOV= document.getElementById('00Nq000000181Wp_ileinner').innerHTML;
var RedLightReview= document.getElementById('00Nq00000017qTB_ileinner').innerHTML;
var ce = new sforce.SObject("Contract_Extract__C");
ce.id = "{!Contract_Extract__c.Id}";
var check = {!Contract_Extract__c.Leadership_Notification_check__c}
if ((TOV >= 5000000000 ||  (Suite != ' ' || Suite != ' ' ) || (RedLightReview!= ' ' || RedLightReview != ' ') ) && check === 0) {
       ce.Leadership_Notification_check__c = 1;
       result = sforce.connection.update([ce]);
       
}

 
How to get the opportunity product fields in visualforce email template?

I have created VF email template relatedTo Contract__C object

Relationship:
Opportunity object---Lookup--->Contract__C object

Now hot to get the opportunity products fields on VF email template?..
 

I want to pass collection variable (Contains list of Oppty lineitems) and opportunityId to flow. Please let me know if am doing wrong.
 
trigger OpptyLineItem on OpportunityLineItem(before delete) {
 if(trigger.IsBefore){ 
   if(trigger.IsDelete){

        List<OpportunityLineItem> opptyLineItemList= [select Id,Name__c,OpportunityId,PricebookEntry.Product2.Name FROM OpportunityLineItem Where OpportunityId =: trigger.old[0].OpportunityId];

            Map<String,Object> productAlignmentTOoppty = new Map<String, Object>();          
            system.debug('productAlignmentTOoppty '+ productAlignmentTOoppty); 

             for(OpportunityLineItem Oli: opptyLineItemList){
               if(Oli.Id != trigger.old[0].Id){
               system.debug('test');
                   // productAlignmentTOoppty.put('varOpptyDel',Oli);
                    productAlignmentTOoppty.put('varOpportunityId',Oli.OpportunityId);
               }
             }

            Flow.Interview.MyFlow refToFlow = new Flow.Interview.MyFlow(productAlignmentTOoppty);
            refToFlow.start();


    }
 }

 
trigger AS_OpportunityUpdateFromOppProduct on OpportunityLineItem (after insert) {
   system.debug('trigger values'+ trigger.new);  
    String  oppoptyId = [ SELECT Id,Name,OpportunityId,PricebookEntryId,Product2Id FROM OpportunityLineItem where Id IN: trigger.new limit 1].OpportunityId;
    system.debug('Opporutity id'+ oppoptyId);
      List<OpportunityLineItem> OPtyLineItemList = [select Id,Name,OpportunityId,PricebookEntryId,Product2Id,Contractual_Committed_Revenue__c FROM OpportunityLineItem Where OpportunityId =: oppoptyId];
      system.debug('lineitem list '+ OPtyLineItemList );
      opportunity opty =[Select product_1__C,product_2__C from Opportunity where ID =: oppoptyId];
        system.debug('opty list '+ opty.product_1__C);
        system.debug('opty list '+ opty.product_2__C );
      Map<Double,OpportunityLineItem> productAlignmentTOOpty = new  Map<Double,OpportunityLineItem>();
      List<Double> sortRevenue = new List<Double>(); 
         for(OpportunityLineItem Oli: OPtyLineItemList){
            productAlignmentTOOpty.put(oli.Contractual_Committed_Revenue__c,Oli);
            sortRevenue.add(oli.Contractual_Committed_Revenue__c);   
         }
         system.debug('sortRevenue1 '+ sortRevenue );
        sortRevenue.sort();
         Integer count = 0;
          system.debug('sortRevenue2 '+ sortRevenue);
         for(Integer i=0 ;sortRevenue.Size()> count ; i++){
            if(count == 0 && sortRevenue[i] != null && productAlignmentTOOpty.get(sortRevenue[i]).Name != null){
              opty.product_1__C = productAlignmentTOOpty.get(sortRevenue[i]).Name;
            }
             if(count == 1 && sortRevenue[i] != null  && productAlignmentTOOpty.get(sortRevenue[i]).Name != null){
              opty.product_2__C =productAlignmentTOOpty.get(sortRevenue[i]).Name;
            }

            count = count +1;
         }
         update opty;
}

I need to sort the values in asc from the field Contractual_Committed_Revenue__c and populate the lineitem names in opportunity fields (product_1__C,product_2__C).

Thanks in advance..
 
Is it possible to show/hide the table in vf template?
Below code has to update the Leadership_Notification_check__c when the Suite, RedLightReview are not empty,TOV >= 5000000000 and check field is 0.
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")}

var Suite= document.getElementById('00Nq00000017vbe_ileinner').innerHTML;
var TOV= document.getElementById('00Nq000000181Wp_ileinner').innerHTML;
var RedLightReview= document.getElementById('00Nq00000017qTB_ileinner').innerHTML;
var ce = new sforce.SObject("Contract_Extract__C");
ce.id = "{!Contract_Extract__c.Id}";
var check = {!Contract_Extract__c.Leadership_Notification_check__c}
if ((TOV >= 5000000000 ||  (Suite != ' ' || Suite != '&nbsp;' ) || (RedLightReview!= ' ' || RedLightReview != '&nbsp;') ) && check === 0) {
       ce.Leadership_Notification_check__c = 1;
       result = sforce.connection.update([ce]);
       
}

Thanks in advance...
Objects: Opportunity and custom object(CE) have M-D relation ship

Q: Is it possible to check the child object fields on stage change in opportunity and throw the error in parent object if child object fields are blank.

please let me know how can i achive this ...
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")}

var Suite= document.getElementById('00Nq00000017vbe_ileinner').innerHTML;
var TOV= document.getElementById('00Nq000000181Wp_ileinner').innerHTML;
var RedLightReview= document.getElementById('00Nq00000017qTB_ileinner').innerHTML;
var ce = new sforce.SObject("Contract_Extract__C");
ce.id = "{!Contract_Extract__c.Id}";
var check = {!Contract_Extract__c.Leadership_Notification_check__c}
if ((TOV >= 5000000000 ||  (Suite != ' ' || Suite != '&nbsp;' ) || (RedLightReview!= ' ' || RedLightReview != '&nbsp;') ) && check === 0) {
       ce.Leadership_Notification_check__c = 1;
       result = sforce.connection.update([ce]);
       
}

 
How to get the opportunity product fields in visualforce email template?

I have created VF email template relatedTo Contract__C object

Relationship:
Opportunity object---Lookup--->Contract__C object

Now hot to get the opportunity products fields on VF email template?..
 
Is it possible to show/hide the table in vf template?