We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [orderitem]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
5
votes
2answers
6k views

Product2 field in OrderItem Object

When I ran below query in workbench/developer console SELECT product2 FROM OrderItem am getting below error No such column 'Product2' on entity 'OrderItem'. If you are attempting to use a custom ...
4
votes
1answer
454 views

In which sequence should I be creating/inserting order/orderItem/pricebookEntry/product2?

I'm on the advanced apex super badge step 7, and before this I thought I had a good understanding of order/orderItem/pricebookEntry/product2/pricebook2 objects. However, upon creating my own ...
4
votes
2answers
2k views

INVALID_CROSS_REFERENCE_KEY, invalid cross reference id on Order Item Insert

I am getting the error "INVALID_CROSS_REFERENCE_KEY, invalid cross reference id:" while trying to insert an Order Item related to an order, by cloning the opportunity line item records using an Apex ...
4
votes
0answers
63 views

How to use Reduction Orders with decimal / non-integer quantities?

I'm considering using Reduction Orders to model the partial refund of an annual service. Example: Create and Activate new Order A with one line, Quantity = 1, Price = $15000 Create and Activate ...
3
votes
2answers
1k views

Assign Product to OrderItem

I am trying to create an orderitem from visualforce page and I am getting an error Attempt to de-reference a null object while assigning pricebookentry.priduct2Id.Here is my part of code where it ...
3
votes
1answer
277 views

Validation rule error messages not showing up on multiple entry Order Product page

I am working on Standard Order and Order Product objects. Here's the scenario: Restrict users from entering more than 100 Order Product items in Quantity on an Order. I've created a Rollup summary ...
2
votes
2answers
7k views

How can I query Orders to get OrderItems associated with that order

I see that there is a related list on Orders showing the OrderItems but there is not field on orders that I can SOQL query in Apex.
2
votes
1answer
2k views

List controllers are not supported for Order Item

I am trying to create a custom EDIT ALL list button on OrderItem (Order Product) with content source as Visualforce page and am getting below error. I don't want to use standard EDIT ALL button as I ...
2
votes
1answer
7k views

Problem with Inserting a New Order Item

I am a certified admin and I am just beginning to learn code. I am currently trying to update several Order records to add a new Order Item and update the status on each record. My code worked in our ...
2
votes
1answer
64 views

Override the OrderItem standard Edit page for some Order recordtypes without a controller extension

It is well-known that OrderItem doesn't support record types so you can't vary the page layout based on recordtype like you can for most other objects. Given that OrderItem is a detail to Order, and ...
2
votes
1answer
200 views

Approval Process for OrderItem Object in Salesforce?

Does anyone know how to create a approval process for Object Order Product(orderitem) object in Salesforce?I can't find the names in the list of objects in the approval definition screen or find any ...
2
votes
2answers
653 views

INSUFFICIENT_ACCESS_OR_READONLY, when deleting OrderItems in Apex

I am currently working on a lightning quick action which will update OrderItems on demand from a specified quote. If an OrderItem has no corresponding QuoteLineItem, the line item will be deleted. ...
2
votes
0answers
345 views

OrderItem does not have ListPrice set in test, contrary to non-test

This is something I've run into and worked around, but it still annoys me because I have to write test specific things in my non-test code (and can't get to 100% coverage because of it). I can find ...
2
votes
1answer
607 views

The Ominous INVALID_CROSS_REFERENCE_KEY Error on OrderItem Insert

So in an attempt to convert an OpportunityLineItem into an OrderItem, I get the mysterious and vague INVALID_CROSS_REFERENCE_KEY Error on insert of an OrderItem list. What's odd is my test class runs ...
1
vote
2answers
970 views

How can I provide a partner user access to a report with order product fields?

I have a report with Order and Order Product fields in it. The Partner Communities user has read permission to both Order and Order Product and no problem viewing them outside of reports (eg: in a ...
1
vote
1answer
457 views

What's the the apex:relatedlist 'list' parameter for Order Product History?

I'm trying to add the 'Order Product History' related list for an OrderItem (aka 'Order Product') to a Visualforce page that uses 'OrderItem' as the standardController: <apex:page showHeader="true"...
1
vote
1answer
186 views

Field is not writeable: Order.IsReductionOrder

I am trying to update Order.IsReductionOrder to true from a trigger but getting below error. Field is not writeable: Order.IsReductionOrder It looks like field is read only from Order ...
1
vote
1answer
42 views

Is it possible to update Order Product on Draft Order?

We are trying to utilize the Order object, but we're finding that if we create an Order Product, we are unable to change the product (i.e. essentially the Pricebook entry), even if we're in a Draft ...
1
vote
1answer
370 views

List controllers are not supported for OrderItem

I am trying to do pagination for OrderItems using StandardSetController, however, when I am passing my query in setCon, I am getting following error. List controllers are not supported for ...
1
vote
2answers
434 views

How to make a order in salesforce using php

I'm tried to insert or create new order like product and shipping details in salesforce,but i got get the exact table name for create order please help me name of the table i need to use and what ...
1
vote
0answers
30 views

Orderitems Javascript Button replacement for Lightning

Currently I have the following as a javascript list button that allows the user to selected records: {!REQUIRESCRIPT('/soap/ajax/29.0/connection.js')} var selectedRecords = {!GETRECORDIDS( $...
1
vote
1answer
485 views

Custom (re)ordering of legend/bar segments in Einstein Analytics

Question: Currently I can sort bar segments of a stacked column chart in asc/desc order or keep it unsorted. However I would like to sort them in a custom fashion like in the image. How to do it with ...
1
vote
2answers
361 views

OrderItem doesn't have a recordtype, so how can use different page layouts depending on Order rectype?

I have different recordtypes for the Order object, and the line items (OrderItem) need to show different fields depending on the Order recordtype, yet I can't seem to do this. It allows me to create ...
1
vote
1answer
88 views

Adding Field Set for Order Item

I am trying to add a field Set for OrderItem object but I can't see any way to do so. Is field Set not supported for Order Item? If not, then what could be the other way to have dynamic fields?
0
votes
1answer
71 views

Writing test class for order activate. Error: Required fields are missing: [PricebookEntryId]: [PricebookEntryId]

I've written a test class for order update, though I am stuck at some minor issue which I am unable to get through. My test class looks like: @IsTest public class TestCreateMyOrder { static ...
0
votes
1answer
788 views

ORDER BY a String which contains a number [duplicate]

I'm trying to 'ORDER BY' a String field which contains numbers. It orders like this: 1 10 2 3 ... I've tried whith LPAD, VALUE, *1, but nothing works. THANKS all for ur help!
0
votes
2answers
239 views

Order Product Validation Rule

Is it possible to add a Validation Rule to Orders which checks a certain product name has been added to the order? Basically the price book includes products a, b and c. If the user selects a ...
0
votes
1answer
216 views

Delete OrderItem Error

When I try to delete an OrderItem from an Order, I am getting a DML Mixed Exception. However, I am not updating any other object. Am I missing something? @istest private class ...
0
votes
1answer
41 views

How to prefill UnitPrice on Order Products

I want my Order Product price to prefill based on the price defined on the Pricebook Entry. I swear I've seen this work in the past, but I can't figure out why this time I keep getting an empty field ...
0
votes
1answer
74 views

OrderItem Creation via Enterprise wsdl call

I am trying to create via Enterprise WSDL create call an OrderItem record related to an order. As per image below, inside my call i pass the OrderID, the PriceBook ID, Quantity and Line Description, ...
0
votes
0answers
48 views

Products to opportunities, and the SortOrder field

While adding products to an opportunity in Salesforce, you can not specify the values for the 'SortOrder' field on Opportunity Line Items. That is very weird, and is a feature requested more than 7 ...
0
votes
1answer
88 views

How to access OrderItems that are in a related list on Opportunity

The related list on opportunities contains records of order items which usually have an account name associated with them. I have a requirement where if an opportunity's stage name is 'closed won', I ...
0
votes
1answer
575 views

Not able to access TotalPrice in OrderItem

Trying to write trigger on Order item .I have created new field called discount.I have to perform formula using trigger on TotalPrice(TotalPrice=Discount*TotalPrice).I am not able to access TotalPrice ...
0
votes
3answers
601 views

Create Asset record from data on OrderItem and OpportunityLineItem records

Scenario: When an Opportunity is closed/won, we are creating an Order record with the corresponding OrderItem records based on the OpportunityLineItems of the Opportunity. When the OrderItems are ...