• elosso
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 11
    Questions
  • 7
    Replies

Here is the trigger I'd like to create:

 

I have an Opportunity Product with a Actual Impressions field. I use the Quantity to forecast the likely impressions; however, at the end of each month, I go back and populate Actual Impressions. When I change Actual Impressions, I'd like to launch a trigger that update the Quantity field to the value of the Actual Impressions field. 

 

Any help would be appreciated!

  

My code so far:

 

trigger updateQuantity on OpportunityLineItem (after update) {

for (OpportunityLineItem newQuantity : Trigger.new) {
    OpportunityLineItem oldQuantity = Trigger.oldMap.get(newQuantity.Id);
    if (oldQuantity.Actual_Impressions__c != newQuantity.Actual_Impressions__c) {
        // this is where I don't know how to update a given field
    }
}

}

I have a trigger in Opportunity Product that creates new record in a custom Object (Impressions) once whenever a certain type of Opportunity Product is added to an Opportunity.

 

The Impressions Object has a Lookup Field, called Opportunity Name, linked to the Opportunity Object. I'd like to populate Opportunity Name with the Name of the Opportunity (as listed in the Oportunituy Object); however, my code does not seem to be able to do that. At the moment, it does not populate with anything at all. Any help would be appreciated, thank you!

 

Here is my code... issue is that the following line does not appear to pass the Name to the Opportunity_Name__c field.

i.Opportunity_Name__c = o.Opportunity.Name;

 

trigger createNewImpression on OpportunityLineItem (after insert) {

    List <Impressions__c> impToInsert = new List <Impressions__c> ();

    for (OpportunityLineItem o : Trigger.new) {
        
        if (o.Product_Family__c == 'Impression') {     
            
            Impressions__c i = new Impressions__c ();          
            
            i.Opportunity_Name__c = o.Opportunity.Name;
            i.Bill_Date__c = o.ServiceDate;
            i.Expected_Impressions__c = o.Quantity;
            i.Predicted_Revenue__c = o.TotalPrice;
            
        impToInsert.add(i);
        
        }
        
    }
    
    insert impToInsert;

}

 

 

I'm writing a trigger and need to get the Opportunity Name from from OpportunityLineItem. Any help would be appreciated!

I created a custom object called Impressions. Every time a Opportunity Product is created with a Product Family = Impressions I would like copy some fields from this Opportunity Product and insert them into a new row on the Impressions object. 

 

For example if I add an Impression Product to an Opportunity with the Quantity of 50 and a Date of 6/1/2013, I would like a new row to be created in the Impressions object with ID = 1 (Autonumber), Quantity = 50, and Date = 6/1/2013.

 

Here is the code that I have. It is not triggering any errors. I have placed the trigger in the Opportunit Product triggers, and it is active; however, when I create a new object to see if it works, it does not. Can anyone offer any assistance?? I think the code is OK, but maybe I'm missing something?? Your help is EXTREMELY appreicated!

 

trigger createImpression on OpportunityLineItem (after insert) {

List <Impressions__c> impToInsert = new List <Impressions__c> ();

for (OpportunityLineItem o : Trigger.new) {

// Check if Opportunity Product Meets my criteria
if (o.Product_Family__c == 'Impression') {

Impressions__c i = new Impressions__c (); //Instantiating new object to put values for future record

// Mapping Opportunity Product fields to new Impressions object

i.Bill_Date__c = o.ServiceDate;
i.Expected_Impressions__c = o.Quantity;
i.Predicted_Revenue__c = o.TotalPrice;
//Adding new object to list that will be inserted. 

impToInsert.add(i);

}

}

//Loop has finished; Inserting new records in SF
try {
insert impToInsert; 
} catch (system.Dmlexception e) {
system.debug (e);
}

}
 

 Thank you!

Is it possible to update a revenue schedule through a 'field update' in a workflow? 

I would like to know whether I can Revenue Schedules can start from a date other than the Date field in Opportunity Product. Meaning, can I creat a custom date, ie: Billing Date, and have the Revenue Schedule start from that date?

 

Reason why I'm asking, is that we sell subscriptions that get billed at the beginning of the next month. IE: Subscription starts on 1/1/13, and we bill for the first month on 2/1/13. I'd like to be able to set a Billing Date, and have Revene Schedules Start from that day.

 

Any help is appreciated. Thank you.

I have created numerous products in the Product object, however, all of these products draw from the same inventory. 

 

Basically I sell Ad Space (that's the true product)

 

However the products I defined in the Product object are the numerous monthly subscriptions to this adspace --> we sell 3 month, 6 month, and 9 month subscriptions. I created numerous Monthly Subscription Products to handle the revenue schedules. 

 

Where can I define inventory? Should I create a separate inventory object?

 

Thank you for any help!

Hello everyone!

 

I'm new to salesforce and need some help recognizing sales and tracking inventory with Products that have sales/quantities spread across numerous months.

 

Here is my problem: Each Month we can only sell 25 units. I'm trying to track the number of units we've sold, and project which months still have available units. 

 

Note: Each Opportunity Project is 1 unit. However, I'm having difficulty when it comes to Opportunity Projects that have a Schedule assigned to them. For example, one of the products we provide is a 3 month subscription. This means we sell 1 Unit for each month: (if we sell the subscription on 1/1/13, this accounts for 1 unit in Jan, 1 unit in Feb, and 1 unit in March)

 

I would like to know if it is possible to get the quantity of product opportunities for each month specifically for those products that use revenue and quantity schedules. I want to know how many Opportunity Products are active in each month. 

 

Please let me know if this makes any sense. ABSOLUTELY any help would be so sincrerly appreciated!

 

Thank you!

Hello,

 

I am looking for an independent salesforce consultant or someone who is certified in Salesforce to help me solve a business need. It's a project that I'm working on and I'll probably only need one days worth of consulting and help.

 

Project is tracking online ad sales and ad sale inventory. I need to be able to track current months revenue, previous months revenue, and expected revenue. Finally need to have an overview of how many ads we've run and how many we've sold. 

 

PM me with your contact information and price per day/hour if you're interested. Thank you.

 

 

Hello Everyone!

 

Thanks so much for taking the time to read my question. I'm new to Sales force, so I apologize if my terminology is not that great. I would like to know if there is a way to automate the revenue sechdule via an APEX trigger. 

 

Here is what I'd like to accompish.

 

A Opportunity Product has a Start date.

 

If a Product Opportunity has Revenue and Quantity schedules can you make the dates dependent on the Opportunity Product Start Date.

 

So, if the Product Opportunity Start Date is changed, all the schedule dates change automatically.

 

For Example  Product Opportunity Start Date - 8/24/2010

 

Schedule dates are set over 3 installments starting on 9/01/2010, 10/01/2010 and 11/01/2010

 

If the Product Opportunity Start Date is CHANGED to 9/24/2010, can the schedule dates automatically change to 10/01/2010, 11/01/2010 and 12/01/2010?

 

Thank you for any help!

I'm created a field called expected value that returns the expected value of a product.

 

IF( ServiceDate < TODAY() , IF( Type__c = "Click", Actual_Clicks__c * PricebookEntry.UnitPrice, NEEDHELP ), IF( Type__c = "Click", Quantity * PricebookEntry.UnitPrice, NEEDHELP ))

 

In the area listed NEEDHELP I would like to input the Scheudle Amount field for an Opportunity Product. I'm new to salesforce and don't know where to look, or whether it's possible to find this field, any help would be appreciated. 

 

Thank you for your time and any suggestions.

Hello Everyone!

 

Thanks so much for taking the time to read my question. I'm new to Sales force, so I apologize if my terminology is not that great. I would like to know if there is a way to automate the revenue sechdule via an APEX trigger. 

 

Here is what I'd like to accompish.

 

A Opportunity Product has a Start date.

 

If a Product Opportunity has Revenue and Quantity schedules can you make the dates dependent on the Opportunity Product Start Date.

 

So, if the Product Opportunity Start Date is changed, all the schedule dates change automatically.

 

For Example  Product Opportunity Start Date - 8/24/2010

 

Schedule dates are set over 3 installments starting on 9/01/2010, 10/01/2010 and 11/01/2010

 

If the Product Opportunity Start Date is CHANGED to 9/24/2010, can the schedule dates automatically change to 10/01/2010, 11/01/2010 and 12/01/2010?

 

Thank you for any help!

Here is the trigger I'd like to create:

 

I have an Opportunity Product with a Actual Impressions field. I use the Quantity to forecast the likely impressions; however, at the end of each month, I go back and populate Actual Impressions. When I change Actual Impressions, I'd like to launch a trigger that update the Quantity field to the value of the Actual Impressions field. 

 

Any help would be appreciated!

  

My code so far:

 

trigger updateQuantity on OpportunityLineItem (after update) {

for (OpportunityLineItem newQuantity : Trigger.new) {
    OpportunityLineItem oldQuantity = Trigger.oldMap.get(newQuantity.Id);
    if (oldQuantity.Actual_Impressions__c != newQuantity.Actual_Impressions__c) {
        // this is where I don't know how to update a given field
    }
}

}

I'm writing a trigger and need to get the Opportunity Name from from OpportunityLineItem. Any help would be appreciated!

I have created numerous products in the Product object, however, all of these products draw from the same inventory. 

 

Basically I sell Ad Space (that's the true product)

 

However the products I defined in the Product object are the numerous monthly subscriptions to this adspace --> we sell 3 month, 6 month, and 9 month subscriptions. I created numerous Monthly Subscription Products to handle the revenue schedules. 

 

Where can I define inventory? Should I create a separate inventory object?

 

Thank you for any help!

Hello everyone!

 

I'm new to salesforce and need some help recognizing sales and tracking inventory with Products that have sales/quantities spread across numerous months.

 

Here is my problem: Each Month we can only sell 25 units. I'm trying to track the number of units we've sold, and project which months still have available units. 

 

Note: Each Opportunity Project is 1 unit. However, I'm having difficulty when it comes to Opportunity Projects that have a Schedule assigned to them. For example, one of the products we provide is a 3 month subscription. This means we sell 1 Unit for each month: (if we sell the subscription on 1/1/13, this accounts for 1 unit in Jan, 1 unit in Feb, and 1 unit in March)

 

I would like to know if it is possible to get the quantity of product opportunities for each month specifically for those products that use revenue and quantity schedules. I want to know how many Opportunity Products are active in each month. 

 

Please let me know if this makes any sense. ABSOLUTELY any help would be so sincrerly appreciated!

 

Thank you!