Skip to Content

Getting Shopping Cart Details From Purchase Order


A customer wants to set the buyer responsible of a PO to the original requester . To do this I figure I need to go and find the shopping cart reference in the business transaction document references, get the ID, and retrieve the shopping cart to get the details.

There is a shopping cart document reference in the BTDRs, but there's no shopping cart BO in the repository explorer --- I did fuzzy searches for *Shop* and *Cart*, neither of which yielded results. I also made a key variable and assigned the ID and type from the PO's shopping cart reference, but a retrieve() call on the BusinessTransactionDocumentSearch BO yielded nothing, and a query just using type code 62 (Shopping Cart) as a parameter also yielded no results.

Does anyone have any ideas?

My code:

Business Object: PurchaseOrder
Node: Root
Event: AfterModify

import ABSL;
import AP.FO.BusinessDocumentFlow.Global;
import AP.Common.Global as common;

var prRefs = this.BusinessTransactionDocumentReference.PurchaseRequest;
if (prRefs.Count() == 1)
    var pr = prRefs.GetFirst();
    var creator = pr.CreationIdentity.FormattedName;
    var x = 10;

var key:common:BusinessTransactionDocumentKey;

var shoppingCartReferences = this.BusinessTransactionDocumentReference.Where(n => n.BusinessTransactionDocumentReference.TypeCode == "62"); //62 == Shopping Cart.
if (shoppingCartReferences.Count() == 1) //Should only ever be 0 or 1.
    var shoppingCartReference = shoppingCartReferences.GetFirst().BusinessTransactionDocumentReference;
    key.BusinessTransactionDocumentID.content = shoppingCartReference.ID.content.RemoveLeadingZeros();
    key.BusinessTransactionDocumentTypeCode = shoppingCartReference.TypeCode;
    var shoppingCart = BusinessTransactionDocumentSearch.Retrieve(key);
    if (shoppingCart.IsSet())
        var requester = shoppingCart.MainBusinessTransactionDocumentPartyFormattedName;
        var x = 10;



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Aug 21, 2017 at 04:43 PM

    Shopping Cart BO is called "InternalRequest". You should be able to find this in the Repository Explorer.

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 16, 2018 at 04:09 PM

    I don't think this actually came to anything, but Asif's answer was useful.

    Add comment
    10|10000 characters needed characters exceeded