Creates an intercompany transaction for a given cell.
To test whether a cell is valid for intercompany transactions, use DoesCellSupportICTransactionDetail. To update an existing transaction, use SaveICTransaction. |
<HsvICM>.CreateICTransaction vbOverwrite, lScenario, lYear, lPeriod, lEntity, lICP, lAccount, lC1, lC2, lC3, lC4, lTRCur, lReason, dTRAmt, dTRLAmt, dTRRate, dTRDate, bstrID, bstrSubID, bstrRefID, bstrComment1, bstrComment2
Boolean (ByVal). A flag that specifies whether to overwrite existing transactions that have the same Transaction ID and Sub ID. Pass TRUE to overwrite, FALSE otherwise. | |
Long (ByVal). The member ID of the transaction’s Scenario dimension member. | |
Long (ByVal). The member ID of the transaction’s Year dimension member. | |
Long (ByVal). The member ID of the transaction’s Period dimension member. | |
Long (ByVal). The member ID of the transaction’s Entity dimension member. | |
Long (ByVal). The member ID of the transaction’s Intercompany Partner dimension member. | |
Long (ByVal). The member ID of the transaction’s Account dimension member. | |
Long (ByVal). The member ID of the transaction’s Custom 1 dimension member. | |
Long (ByVal). The member ID of the transaction’s Custom 2 dimension member. | |
Long (ByVal). The member ID of the transaction’s Custom 3 dimension member. | |
Long (ByVal). The member ID of the transaction’s Custom 4 dimension member. | |
Long (ByVal). The ID of the transaction’s currency. You can obtain the ID of an Entity dimension member’s currency with GetEntityCurrencyID. You also can obtain a currency ID with GetTransCurrencyID. | |
Long (ByVal). The ID of the transaction’s reason code. You can get a reason code ID with GetICReasonCodeID. | |
The following function creates an intercompany transaction with the current date as the transaction date and the specified entity’s default currency as the transaction currency, and returns whether the specified cell is valid for intercompany transactions. The function uses HsvValues.GetValueIDFromCurrencyID to get the member ID of the Value dimension member that corresponds to the entity’s default currency, and passes this ID to DoesCellSupportICTransactionDetail.
Function createIcTransEntCurrToday(lScen As Long, lYear As Long, lPer _ As Long, lEnt As Long, lIcp As Long, lAcct As Long, lCust1 As Long, _ lCust2 As Long, lCust3 As Long, lCust4 As Long, sReason As String, _ dTranAmt As Double, dEntCurrAmt As Double, sTranId As String, _ sSubId As String) As Boolean Dim cICM As HsvICM, lCurr As Long, lReason As Long, bSupport As Boolean Dim lVal As Long, cValues As HsvValues 'g_cSession is an HsvSession object reference Set cICM = g_cSession.ICM lCurr = cICM.GetEntityCurrencyID(lEnt) 'g_cMetadata is an HsvMetadata object reference Set cValues = g_cMetadata.Values cValues.GetValueIDFromCurrencyID lCurr, lVal bSupport = cICM.DoesCellSupportICTransactionDetail(lScen, lYear, lPer, _ lEnt, lVal, lAcct, lIcp, lCust1, lCust2, lCust3, lCust4) If bSupport = True Then lReason = cICM.GetICReasonCodeID(sReason) cICM.CreateICTransaction True, lScen, lYear, lPer, lEnt, lIcp, _ lAcct, lCust1, lCust2, lCust3, lCust4, lCurr, lReason, dTranAmt, _ dEntCurrAmt, 0, Now, sTranId, sSubId, "", "", "" createIcTransEntCurrToday = True Else createIcTransEntCurrToday = False End If End Function