• Alexander G Goodman
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 9
    Replies
Long story short: I have made a workflow that updates a check box to true when certian  critia are met, I now want to make the opersite of it so that when the critia no longer matchs what I need it it then updates it to false (its importaint as I have a validation rule riding on this working).
This is the formula minus sensative info which is covered by asterisks: 
AND( OR( ISNEW(), ISNULL( ***_****__c), ISNULL( ****_****__c ) ), ISPICKVAL( Product2.Family, '****'), OR(Opportunity.Probability < 90, Opportunity.IsClosed = FALSE))
any ideas
I am try to make a vaildation rule that kicks in on the Opportunity object, if a field in Opportunity Product object meets certain critia. The field is a date field. Firstly is this possable with Visualforce? and if so how as I have no experience with Visualforce.
I have Custom code for a trigger which I am trying to get it to only activate if a pick list field is selected. The code needsto be Triggered from a If Statement. 

This is the original Code:
trigger OpportunityAutoUpdate on Opportunity (before insert,before update)
{
   // get the ids of all the accounts
     Set<Id> accIds=new Set<Id>();
   for (Opportunity opp : trigger.new)
 {
     accIds.add(opp.AccountId);
 }

   // retrieve the accounts and owners
  List<Account> accs=[select id, OwnerId from Account where id in :accIds];
  Map<Id, Account> accById=new Map<Id, Account>();
  accById.putall(accs);

   // iterate the opportunities, updating the opportunity owner to the account owner
   for (Opportunity opp : trigger.new)
  {
       // any logic about when to do this - i.e. only if the current owner matches a
       // particular id goes here
      if (null!=opp.AccountId)
       { 
         opp.OwnerId=accById.get(opp.AccountId).OwnerId;
              
       }  }
}
Any help would be apprecated.
Note: I can not give the field name of the picklist.
Long story short: I have made a workflow that updates a check box to true when certian  critia are met, I now want to make the opersite of it so that when the critia no longer matchs what I need it it then updates it to false (its importaint as I have a validation rule riding on this working).
This is the formula minus sensative info which is covered by asterisks: 
AND( OR( ISNEW(), ISNULL( ***_****__c), ISNULL( ****_****__c ) ), ISPICKVAL( Product2.Family, '****'), OR(Opportunity.Probability < 90, Opportunity.IsClosed = FALSE))
any ideas
I am try to make a vaildation rule that kicks in on the Opportunity object, if a field in Opportunity Product object meets certain critia. The field is a date field. Firstly is this possable with Visualforce? and if so how as I have no experience with Visualforce.
I have Custom code for a trigger which I am trying to get it to only activate if a pick list field is selected. The code needsto be Triggered from a If Statement. 

This is the original Code:
trigger OpportunityAutoUpdate on Opportunity (before insert,before update)
{
   // get the ids of all the accounts
     Set<Id> accIds=new Set<Id>();
   for (Opportunity opp : trigger.new)
 {
     accIds.add(opp.AccountId);
 }

   // retrieve the accounts and owners
  List<Account> accs=[select id, OwnerId from Account where id in :accIds];
  Map<Id, Account> accById=new Map<Id, Account>();
  accById.putall(accs);

   // iterate the opportunities, updating the opportunity owner to the account owner
   for (Opportunity opp : trigger.new)
  {
       // any logic about when to do this - i.e. only if the current owner matches a
       // particular id goes here
      if (null!=opp.AccountId)
       { 
         opp.OwnerId=accById.get(opp.AccountId).OwnerId;
              
       }  }
}
Any help would be apprecated.
Note: I can not give the field name of the picklist.