• Mary Ardelyn Nabong
  • NEWBIE
  • 25 Points
  • Member since 2015

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

Is there a way to determine either by metadata, table or fields if workflow is on or off meaning activated or not?

Thanks,
Hi guro,

I have a custom object(Billing Plan) with a custom field (opportunitylineitem, text). Everytime I clone the Billing Plan opportunitylineitem is not populated. I build the relationshop One(pooportunity line item)  to Many (Billing Plan).
1. build a trigger to create a billing plan as soon as opportunily line item is added.
2. another trigger to update the opportunity line item with Billing ID.
3. when i clone Billing Plan, everything is populated except the opportunity line item ID(text) , not required, not unique.

Below is the code for my Billing plan
------------------------------------------------------------------------
trigger BillingSchedule on Schedule__c (after insert) {
 
    for(Schedule__c BSupd:trigger.new){
        system.debug('BSupd: '+ BSupd.Opportunity_Line_Item__c);
     Id lineitemid = BSupd.Opportunity_Line_Item__c;
        if (lineitemid != null){
        Opportunitylineitem oplnitm =[select id from opportunitylineitem
                                      where id=:lineitemid limit 1];
       oplnitm.Schedule__c = BSupd.Id;
        update oplnitm;
     }
   }
}

------------------------------------------------------
Thanks in advance.
Mary


Hi Guro,
I have the above error. Please help!!!.

trigger OpportunityBillingSchedule on OpportunityLineItem (after insert) {
    list<Schedule__c> AddBS = new list<Schedule__c>();
    for( OpportunityLineItem olitems : Trigger.new)
    {
        //populate the account
        List<opportunity> oppl = [Select Id, AccountId
                                 from Opportunity
                                 where Id =:olitems.OpportunityId] ;
       
        set<id> opAcc = new set<id>();
        for( Opportunity opp: oppl )
         {
             opAcc.add( opp.AccountId);
         }  
         if (olitems.term__c)
         {
            Schedule__c BS       = new Schedule__c();
             BS.name                   = olitems.name;
             BS.Account__c        = opAcc; 
             BS.opportunity__C    = olitems.opportunityid;
             BS.Billing_amount__c = olitems.unitprice;
             BS.Date__c           = Date.today();  // olitems.Maintenance_start_date__c;
             BS.Status__c         = 'Open';
             AddBS.add(BS);
              }
        }
 
       insert AddBS;   
  }
-----------------------------------------
i did try:     BS.Account__c        =  oppl[1].id ; 
but got another error upon saving : System.ListException: List index out of bounds: 1: Trigger.OpportunityBillingSchedule: line 25, column 1   ​


Thank in Advance.

Mary



 

Hi,

On the Order object I have a requirement to create custom button to check if the custom field(check box) in object Account object is check or not. Can I do this using Javascript only if yes, can anybody show me? if no  and i need to do a VF and controller on this please let me know

Example of displaying custom field in an order:
alert('{!Order.SAP_Status__c}');

but if i want to display using the standard fields like Accountname, accountNumber, how will get these value.


Thanks,
Smurfet

 
 


Hi Guro,
I have the above error. Please help!!!.

trigger OpportunityBillingSchedule on OpportunityLineItem (after insert) {
    list<Schedule__c> AddBS = new list<Schedule__c>();
    for( OpportunityLineItem olitems : Trigger.new)
    {
        //populate the account
        List<opportunity> oppl = [Select Id, AccountId
                                 from Opportunity
                                 where Id =:olitems.OpportunityId] ;
       
        set<id> opAcc = new set<id>();
        for( Opportunity opp: oppl )
         {
             opAcc.add( opp.AccountId);
         }  
         if (olitems.term__c)
         {
            Schedule__c BS       = new Schedule__c();
             BS.name                   = olitems.name;
             BS.Account__c        = opAcc; 
             BS.opportunity__C    = olitems.opportunityid;
             BS.Billing_amount__c = olitems.unitprice;
             BS.Date__c           = Date.today();  // olitems.Maintenance_start_date__c;
             BS.Status__c         = 'Open';
             AddBS.add(BS);
              }
        }
 
       insert AddBS;   
  }
-----------------------------------------
i did try:     BS.Account__c        =  oppl[1].id ; 
but got another error upon saving : System.ListException: List index out of bounds: 1: Trigger.OpportunityBillingSchedule: line 25, column 1   ​


Thank in Advance.

Mary



 

Hi,

On the Order object I have a requirement to create custom button to check if the custom field(check box) in object Account object is check or not. Can I do this using Javascript only if yes, can anybody show me? if no  and i need to do a VF and controller on this please let me know

Example of displaying custom field in an order:
alert('{!Order.SAP_Status__c}');

but if i want to display using the standard fields like Accountname, accountNumber, how will get these value.


Thanks,
Smurfet