• Zaid Darbar
  • NEWBIE
  • 55 Points
  • Member since 2014

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 10
    Replies
Hello All,
I am trying to associate an existing related record(sales rebate__c) to another custom object when they are created(Sales program__c)
Below is what I have so far but I am receiving an error where I am comparing the year on the parent child record.  
There is only a single child(sales_rebate) record that will be associated to many parent accounts.  
Error Message "Initial term of field expression must be a concrete SObject: List<Sales_Rebate__c>"

Thanks for your time and help.
M


trigger AddSalesRebateToSalesProgram on Sales_Program__c (After insert) {
    
 List<Sales_Rebate__c> salesrebate = new List<Sales_Rebate__c>();
 List<Sales_Program__c> salesprogram = new List<Sales_Program__c>();
    
    for(Sales_Program__c sp : Trigger.new)
    {
      *if(salesrebate.Early_Buy_Rebate_Year__c == salesprogram.Current_SBF_Year__c )*
      {
           Sales_Rebate__c rebate = new Sales_Rebate__c();
            rebate.Sales_Program__c = sp.id;  
                  salesrebate.add(rebate);
      }
    }
   
    insert salesrebate;
}
 
There is a requirement to have a new record created on the Product2 object when the current product2 record meets a certain criteria. These records should then be linked together.
I have used process builder to create a new product2 record in the product2 object when the current product2 record meets a certain criteria. On the new product2 record I have a lookup field that is populated with the historic product2 record Id.
If I want to reference the new product2 record, from the historic product2 record, how would I do this? The lookup field is called Historic_R&D_Record__c and has a child relationship name of "Services".
I need to reference the historic product record in the soql query below.

List<Opportunity> listOpportunity = new List<Opportunity>();
            listOpportunity = [SELECT Id, OwnerId, Name, Owner.FirstName, (SELECT Id, Product2.Name FROM OpportunityLineItems WHERE Product2.Opportunity_Owner_Notification__c = FALSE
                            AND Product2.Isactive = FALSE
                            AND (Product2.RecordType.DeveloperName = 'Unavailable_R_D_Service' OR Product2.RecordType.DeveloperName = 'Unavailable_R_D_Project' ) LIMIT 1)
                           FROM Opportunity WHERE Id In
                           (SELECT OpportunityId FROM OpportunityLineItem WHERE Product2.Opportunity_Owner_Notification__c = FALSE
                            AND Product2.Isactive = FALSE
                            AND (Product2.RecordType.DeveloperName = 'Unavailable_R_D_Service' OR Product2.RecordType.DeveloperName = 'Unavailable_R_D_Project' ))];
Hi,

I have this small aura lightning component which has a simple button which redirects me to a case record. It is working fine in SF1 but it is not working in web browser. Any help will be appreciated :) 

i am getting the following error:

"Something has gone wrong. Cannot read property 'setParams' of undefined. Please try again."

_____________________________________________________________________________

component

<aura:component implements="force:appHostable">
    
    <ui:button press="{!c.navigate}" label="NavigateURL" ></ui:button>
    
</aura:component>

___________________________________________________________

({
    navigate : function(component, event, helper) {
        var urlEvent = $A.get("e.force:navigateToURL");
        var myUrl = '/50028000007kPj9';
        urlEvent.setParams({
          "url": myUrl
        });
        urlEvent.fire();
    }
})

_____________________________________________________

I've used the Debug Logs in the past without any issue, so it's strange that this would pop up seemingly overnight.  No Users or Apex classes that I try to log are showing up in my Debug Log history.  I know something is happening because the user I'm trying to log is making changes to records that aren't being captured in debug logs.

This is a huge issue for us as I effectively can't continue development without being able to see what I'm doing!  Any advice is appreciated, thanks!


Eulogio

Hello All,
I am trying to associate an existing related record(sales rebate__c) to another custom object when they are created(Sales program__c)
Below is what I have so far but I am receiving an error where I am comparing the year on the parent child record.  
There is only a single child(sales_rebate) record that will be associated to many parent accounts.  
Error Message "Initial term of field expression must be a concrete SObject: List<Sales_Rebate__c>"

Thanks for your time and help.
M


trigger AddSalesRebateToSalesProgram on Sales_Program__c (After insert) {
    
 List<Sales_Rebate__c> salesrebate = new List<Sales_Rebate__c>();
 List<Sales_Program__c> salesprogram = new List<Sales_Program__c>();
    
    for(Sales_Program__c sp : Trigger.new)
    {
      *if(salesrebate.Early_Buy_Rebate_Year__c == salesprogram.Current_SBF_Year__c )*
      {
           Sales_Rebate__c rebate = new Sales_Rebate__c();
            rebate.Sales_Program__c = sp.id;  
                  salesrebate.add(rebate);
      }
    }
   
    insert salesrebate;
}
 
There is a requirement to have a new record created on the Product2 object when the current product2 record meets a certain criteria. These records should then be linked together.
I have used process builder to create a new product2 record in the product2 object when the current product2 record meets a certain criteria. On the new product2 record I have a lookup field that is populated with the historic product2 record Id.
If I want to reference the new product2 record, from the historic product2 record, how would I do this? The lookup field is called Historic_R&D_Record__c and has a child relationship name of "Services".
I need to reference the historic product record in the soql query below.

List<Opportunity> listOpportunity = new List<Opportunity>();
            listOpportunity = [SELECT Id, OwnerId, Name, Owner.FirstName, (SELECT Id, Product2.Name FROM OpportunityLineItems WHERE Product2.Opportunity_Owner_Notification__c = FALSE
                            AND Product2.Isactive = FALSE
                            AND (Product2.RecordType.DeveloperName = 'Unavailable_R_D_Service' OR Product2.RecordType.DeveloperName = 'Unavailable_R_D_Project' ) LIMIT 1)
                           FROM Opportunity WHERE Id In
                           (SELECT OpportunityId FROM OpportunityLineItem WHERE Product2.Opportunity_Owner_Notification__c = FALSE
                            AND Product2.Isactive = FALSE
                            AND (Product2.RecordType.DeveloperName = 'Unavailable_R_D_Service' OR Product2.RecordType.DeveloperName = 'Unavailable_R_D_Project' ))];