• Dhanraj kumar 7
  • NEWBIE
  • -2 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 5
    Replies
Hi All,
I have created the below code for a trigger that once an opportuntiylineitem is added, edited, deleted or undelted it SUM() the total of all product ids on opportuntilineitems as a particular status.

However I get the below error when you try to update an opportunitylineitem in Salesforce:
LookupRollup: execution of AfterUpdate caused by: System.ListException: Row with null Id at index: 0 Trigger.LookupRollup: line 11, column 1

This is my code for the trigger:
trigger LookupRollup on OpportunityLineItem (after insert,after update, after delete,after undelete) {

     //Declare Variables
    List<Product2> ProductIDs = new List<Product2>();

	//Get list of all product codes on unprocessed orders
    ProductIDs = [ SELECT id,Other_Details__c
							FROM Product2 ];

	//map productid to totals on orders
	MAP<id,AggregateResult > ProductTotal = new MAP<id,AggregateResult >(
        	[SELECT Product2Id,SUM(NUMBER_OF_UNITS__c)vol
			FROM OpportunityLineItem 
			WHERE (Opportunity.Sage_Status__c like 'Processing%' 
			OR Opportunity.Sage_Status__c like 'Despatched%')
             GROUP BY Product2Id]) ;
    
	//Update to product
	FOR (Product2 pt : ProductIds) {
        STRING OnOrderTotal = string.ValueOf(ProductTotal.get(pt.id));
		pt.Other_details__C = OnOrderTotal;
		UPSERT pt;
	}

	}

Any ideas?
Hi All,
I have passed all the challenges of "Lightning Experience Reports & Dashboards Specialist" and received all the points of aech step. But I could not get the superbadge, even I refreshed my page several times.
Can someone please help me on this?

Thanks,
Helen
I used an API that contains Data in Global Class.
API  URL:  https://api.covid19api.com/summary

So I am not able to define a class with Name GLOBAL IN MY parser then How to Use this Global Class.
So I changed the Name to All Stats
Below I Attached ss Thank you 

User-added image

User-added image
One of my Users unable to update their own Task fields and while updating the data, it shows the error like "insufficient access rights on object id". As an administrator, i dont want to give "Modify All' access to my user. if i gave "Modify all" access to user, My user able to update their own Task information.
  • May 24, 2020
  • Like
  • 0
User-added imageI want to show custom help text on mouse hover to the icon in the column header of the datatable in lwc.