Saturday, September 23, 2023
HomeUncategorizedAlternative Line Objects in Salesforce - Study Right here

Alternative Line Objects in Salesforce – Study Right here


What are Alternative Line Objects? 

The Merchandise related to an Alternative are referred to as OpportunityLineItem. 

There are lots of various things {that a} enterprise may promote. This stuff are collectively known as Merchandise. Nevertheless, “OpportunityLineItem” data are what are created when a Product or numerous Merchandise are related to an Alternative.  

There could also be one or a number of alternative product strains for a single alternative. 

Alternative Line Objects -Associated Objects and Associated Lists 

  • Alternative 
  • Pricebook Entry 
  • Product2 

dont miss out iconRemember to take a look at: All You Need to Know About Apex Testing in Salesforce | The Developer Guide

Creating Alternative Line Objects in Salesforce 

  • On the associated tab, click on on a brand new product. 
  • Choose a product. 
  • Click on Subsequent. 
  • Add amount. 
  • Click on Save. 
  • Alternative Line Merchandise will likely be created. 

How Alternative Line Objects are associated to Alternative and Product 

An Alternative Line Merchandise is said to a Product via the Pricebook Entry Object and associated to the chance immediately. 

What’s the distinction between Merchandise and Alternative Line Objects?   

Merchandise are the means via which you earn a living. 

These could possibly be tangible objects. However they is also setup prices, SaaS licencing, or companies. in truth, any extra intangible benefits you give prospects. 

In different phrases, contemplate your product line as a listing of doable purchases for patrons. 

Alternative merchandise are the distinctive items and companies from that catalogue that you simply promote in reference to a sure provide or alternative. 

Advantages of Alternative Line Objects 

  • Improved Salesforce usability 
  • Enhance Alternative Accuracy 
  • Enhance Pipeline Visibility 
  • Determine Improvement Wants 
  • Improve Value Low cost Management 
  • Shut Offers Extra Rapidly 

dont miss out iconTake a look at one other superb weblog by Ashish right here: Lightning App Manager in Salesforce – All you Need to Know

Methods to Create Alternative Line Objects utilizing Apex 

//First Step to create a brand new alternative and Insert it 
Alternative opp  = new Alternative(title="Any Title", ); 
insert opp; 
Pricebook2  standardPb = [select id, name, isActive from Pricebook2 where          IsStandard = true limit 1]; 
Product2 prod = new Product2(); // ----> Create  product 
prod.Title="Check Product"; 
insert prod; 
  //------->Create PriceBookEntry 
PricebookEntry pbEntry = new PricebookEntry ();;; 
insert pbEntry; 
//-->Create OpportunityLineItem 
OpportunityLineItem oppLI = new OpportunityLineItem();  
oppLI.PricebookEntryId= pbEntry.Id; 
oppLI.OpportunityId = opp.Id; 
oppLI.Amount = 5; 
 oppLI.TotalPrice = 10.0; 
insert opLineItemlist;  


Source link



Please enter your comment!
Please enter your name here

- Advertisment -

Most Popular

Recent Comments