• DaveAdams2
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 6
    Replies

Hi All,

 

I have a custom object called "Account_Activity_Plans" with which I would like to prevent duplicate records when a user creates a new record or updates an existing record. The way i had planned to do this was make a trigger that populates a field called UniqueKey (set as unique in the field properties) before insert and before update with a concatenation of several fields in the record so that the record will not save if the concatenation of the various values already exists on another record.

 

The fields i would like to concatenate are called:-

AcccountID(a master detail relationship exists with the account
Enterprise (picklist)
Activity (picklist)
Month (picklist)
The combination of these 4 fields defines a unique record.
Could you please let me know how i would approach the code to do this, or if there is a better way to achive what i want to do.
Dave
Using the formula editor, how do i round up (or down) a number to x decimal places. eg:- I would like 1.239 rounded up to 2 decimal places to get the result 1.24. thanks!

Hi All,

 

I have a custom object called "Account_Activity_Plans" with which I would like to prevent duplicate records when a user creates a new record or updates an existing record. The way i had planned to do this was make a trigger that populates a field called UniqueKey (set as unique in the field properties) before insert and before update with a concatenation of several fields in the record so that the record will not save if the concatenation of the various values already exists on another record.

 

The fields i would like to concatenate are called:-

AcccountID(a master detail relationship exists with the account
Enterprise (picklist)
Activity (picklist)
Month (picklist)
The combination of these 4 fields defines a unique record.
Could you please let me know how i would approach the code to do this, or if there is a better way to achive what i want to do.
Dave
Using the formula editor, how do i round up (or down) a number to x decimal places. eg:- I would like 1.239 rounded up to 2 decimal places to get the result 1.24. thanks!
Hi all,
 
the problem is as follows:
I need to set up a workflow that creates two tasks if these rules match:
- opportunity stage has a certain value
- The opportunity has at least one product with a certain "product code"
 
Now our internal work procedure requires us to first add new products to the opportunity and then switch the opportunity stage to the desired "trigger value" that should fire the workflow.
 
Option A:
Chose "Opportunity" as workflow trigger object. The show stopper is that its not possible to use opportunity products in the workflow rules - their fields are simply not listed in the dropdown lists.
 
Option B:
Chose "Opportunity Product" as workflow trigger object. Now you can set up all rules fine. The "oops" comes when you try to fire the new workflow by creating an opportunity that matches both rules mentioned above.
If you set the opportunity stage to the right value and after that add one matching product, all works perfect - but this just isn't the way we work. If you do it the other way around (select the product and then set the opportunity stage), the workflow won't be fired at all...
 
Any ideas on this one?
 
Cheers,
Harry
  • February 18, 2008
  • Like
  • 0