• sdondeti
  • NEWBIE
  • 10 Points
  • Member since 2014

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

We are capturing a few custom fields at product level and wanted to use them in some calculation. The result of the calculation needs appear on Opportunity custom fields.

Let us say, the product has field1 and field2 custom fields..I wanted to multiply these fields first and summarize this value for all products and update on opportunity(kind of rollup)

Example formula: SUM of all products(field1 * field2).

Having said that, I tried with workflow field update..I was able to get the custom field in workflow field update on OpportunityLineitem but I don't know how to to aggregate this for all products.

I was thinking trigger is the only option for this and here is the approach.
  1.     Create a trigger on OpportunityLineitem which gets fired anytime a product added to Opportunity
  2.     In the trigger do calculation based on the product custom fields and aggregate the value for all line items.
  3.     Update opportunity.

Before moving forward, I wanted to make sure I am in the right direction OR it could be achieved with out a trigger using workflow field update or any other means.

Appreciate your feedback.

Thanks.
Hi,

I got a requirement to close all the open events and tasks of a Lead when it reaches a specific status. I did some analysis and figured out that it is possible only with a trigger.

As to closing the Tasks, I queried Task object using "WhoId" field and set the Status to Completed which closed all the tasks of a Lead.

However for the events, I am not seeing a status field in the Event object. I was wondering how can we close the open events for a lead. Is it by setting the eventdate=currentdate Or any other mechanism?

Would appreciate your help.

Thanks
Hi, I was deploying some apex code from one sandbox to another using Force.com IDE and the deployment was successful. But when I ran unite tests in the target org, the tests  failed due to some missing data. I was under the impression that that Force.com IDE would run all unit tests before deploying the code to target environment. Can you please give your input on how to make sure it runs all tests before the deployment..I even clicked on the "Validate Deployment" button before the deployment. Thanks.
Hello, I am developing a APEX webservice and I would like to send a custom fault(may be something like InvalidDataFault) to consumer when there are any errors during processing..I have referred the documentation and could not come across this case. Just wondering Id that is possible? Thanks for your feedback.