row pointer that points to the Sales Order Detail record



VIP Member
I'm looking at executing B4200450 (AdvancedSODetailLineSplit)

In the business function viewer documentation I see this blurb

"In order to call this function, you must pass to it a row pointer that points to the Sales Order
Detail record. Use a business function to fetch and create this pointer."

Anyone know what function to call?
BF mnDocumentOrderInvoiceE [DOCO] -> mnOrderNumber [DOCO]
BF szOrderType [DCTO] -> szOrderType [DCTO]
BF szCompanyKeyOrderNo [KCOO] -> szKeyCompany [KCOO]
BF mnLineNumber [LNID] -> mnLineNumber [LNID]
"1" -> cSuppressErrorMesg [EV02]
"1" -> cReturnPtr [EV03]
VA evt_F4211Ptr_GENLNG [GENLNG] <- idPtrToF4211Record [GENLNG]

dont forget to free it

| VA evt_F4211Ptr_GENLNG [GENLNG] <> idGenericLong [GENLNG]
So that I understand what is actually happening on the enterprise server

The requested record is retrieved from the database and then stored in memory using a struct, then it returns some sort of reference number using jdeStoreDataPtr. When executing using your tool(sweet tools btw), It returns the value of '1'. does that value of '1' then somehow correspond to an actual c pointer to the struct in memory?
Yes, the jdeStoreDataPtr API stores that pointer in an internal list and returns a number which is like an index. The retrievePtr API takes that index value and looks up the internal pointer where the strucutre sits in memory. It's important to jdeRemoveDataPtr when you're done (which is done in FreePtrToDataStructure) . The internal list is not infinite.
I think there is 1000 jdeStoreDataPtr elements (if you get anywhere near that you need to rethink your design). You have to be VERY, VERY careful with jdeStoreDataPtr and make sure that jdeRemoveDataPtr is ALWAYS called at some point for a given pointer handle. Unlike other resource leaks that may just degrade performance over time this can actually take down all JDE applications for a given user session. In other words, if P59MYAPP leaks jdeStoreDataPtr handles it can cause Sales Order Entry, Accounts Payable or Purchase Orders to crash.
Are there other functions to split the sales order line that don't require a pointer?
AdvancedSODetailLineSplit is the only pristine one I know of offhand. It's safe enough. Didn't mean to scare you off of passing ptrs via jdeStoreDataPtr. Just wanted to point out you really need to review what you are doing to make sure there are not any logic paths that result in the handle not being release back to the pool. We have used AdvancedSODetailLineSplit for years w/o any problems. Here is an excerpt of our code that uses it:

0029                Get Audit Information
                       VA frm_TimeLastUpdated_UPMT <> BF mnTime
                       VA frm_WorkStationId_JOBN <> BF szWorkstation_UserId
0030                F4211 Get Sales Detail Row
                       FC Order Number -> BF mnOrderNumber
                       FC Order Type -> BF szOrderType
                       FC Order Company -> BF szKeyCompany
                       GC Line Number -> BF mnLineNumber
                       "1" -> BF cCallType
                       "1" -> BF cSuppressErrorMesg
                       "1" -> BF cReturnPtr
                       VA frm_F4211Pointer_GENLNG <- BF idPtrToF4211Record
0031                Get Internal Next NUmber
                       VA evt_Jobnumber_JOBS <> BF mnJobnumberA
0032                // ATI#1148 - pass EP4205 as PID so ship recs for OT are updated correctly
0033                F4211 Write Split Line for Shipped Quantity
                       VA frm_F4211Pointer_GENLNG -> BF idF4211LongPointer
                       "9" -> BF cPreferenceProcessing
                       GC Last Stat -> BF szOverrideLastShipStatus
                       "Y" -> BF cWriteSalesLedger
                       GC Quantity to Split -> BF mnSplitLineOrderQty
                       VA frm_ErrorCode_ERRC <- BF cErrorCode
                       "EP4205" -> BF szProgramID
                       SL DateToday -> BF jdTodaysDate
                       VA frm_TimeLastUpdated_UPMT -> BF mnTimeOfDay
                       SL UserID -> BF szUserID
                       VA frm_WorkStationId_JOBN -> BF szWorkStationID
                       GC Next Stat -> BF szSplitLineNextStatus
                       GC Carrier Number -> BF mnSplitLineCarrierNumber
                       VA evt_Jobnumber_JOBS -> BF mnJobnumberA
0034                Memory, Free Ptr To Data Structure
                       VA frm_F4211Pointer_GENLNG <> BF idGenericLong