Use Data Adapter in a Different Workspace
I'm looking copy an existing data adapter (screenshot below) from the RCM solution into a different workspace and use it within BI Viewer for custom dashboards. I believe the 'GetReconsWithStatusGridView' function is stored within the 'Services' assembly folder and 'ReconService.cs' is the file within the folder that needs called. I have 'Is Shareable Workspace' set to True. Since the method query references WSMU, I need to update that in order to properly call the underlying business rule. That's the part I'm having trouble with. I've tried a wide variety of syntax to no avail. Examples: {Workspace.OFC.RCM}{GetReconsWithStatusGridView}{AccountFilter=...} {Workspace.OFC.RCM.Services}{GetReconsWithStatusGridView}{AccountFilter=...} {Workspace.OFC.RCM.Services.ReconService}{GetReconsWithStatusGridView}{AccountFilter=...} Does anyone know the proper syntax to place in my copied data adapter? Are there any other steps I need to take to properly reference this business rule? Thanks!25Views0likes0Commentsaccount is not translating
Good afternoon, I need help with translating a balance account. We set it up to calculate job to date and load its local currency value, then I wanted to translate it using a job to date rate (also setup as the balance account). The formula attached to the account is for every foreign base entity executes this: api.Data.Calculate("A#JTD_COST:V#YTD:F#EndBalLoad:U8#None:C#USD = RemoveZeros(A#JTD_COST:V#YTD:F#EndBalLoad:U8#None:C#Local * A#JTD_FX_RATE:V#YTD:F#EndBalLoad:U8#None:C#Local)",,,,,"U1#Active.base") The problem is that when I set the original account with Formula Pass then I get an error during the consolidation suggesting the invalid destination data unit in script. When I don't attach any Formula Pass then nothing happens at all. Any suggestions what I miss or how else balance accounts can be translated? Thank you, Ola49Views0likes3CommentsShow Plug Account property for an Account on UD
The below code returns the Plug Account name for an Account, taken from the Plug Account property on the Account It is a DynamicCalc on UD8. Set up a U8 member, f.ex. "YourName" Api.Account.GetPlugAccount returns a long string that contains the Plug Account Name For each Account that has a Plug Account, the string will contain "DimId: 22", so this can be used as filter. The Plug Account name will be stated directly after "Name: ", so this can be extracted from the string. In the below example, "NA" is returned where there is no Plug Account. The Plug Account Name will be shown when using V#Annotation:U8#YourName on Accounts ---------------------------------------------- Dim AccPlugAccName As String = "" ' Fetch the Plug Account property Dim fetchedValue As String = Api.Account.GetPlugAccount(Api.Pov.Account.MemberId)?.ToString() ' Check if the fetched string is not null/empty and contains "DimId: 22" If Not String.IsNullOrEmpty(fetchedValue) AndAlso fetchedValue.Contains("DimId: 22") Then ' Extract only the value after "Name: " and before the next comma Dim startIndex As Integer = fetchedValue.IndexOf("Name: ") + "Name: ".Length Dim endIndex As Integer = fetchedValue.IndexOf(",", startIndex) AccPlugAccName = fetchedValue.Substring(startIndex, endIndex - startIndex).Trim() Else ' Assign "NA" if the condition is not met AccPlugAccName = "NA" End If ' Return the result Return AccPlugAccName9Views0likes0Commentshelp with a conditional statement
Hello, I wrote a simple formula for Wip Rev that checks the amount in Earned Revenue (that is calculated too) and calculates the difference between its current value(POV) and prior year end value(POVPriorYearM12) - this part worked, but then I added a conditional statement saying that if Earned Revenue is zero then Wip Rev should be zero too else run the math (POV - POVPriorYearM12) and only first part works, but math doesn't. I tried a similar statement for the dynamic calc and I was successful, but here no. Please let me know if you can look at the statement and suggests what is wrong... thank you76Views0likes8CommentsHow to call a workspace assembly service from another workspace assembly service ?
Dear community, One of my use case is to create a function that I would commonly use in any other workspace. I haven't seen a community message about it, and the documentations does not specify how to do so, so here's the use case : I have a Workspace A (name: WorkspaceA), with an assembly named WA_Assembly, and in it are my services & functions that I want to reference and use. I have a Workspace B, where I need to call the functions from Workspace A. SOLUTION : Create a new dependency in Workspace B : Dependency Type : "Workspace Assembly" Shared Workspace Name : WorkspaceA Dependency Name : WA_Assembly Then, in a given Workspace B service, use Imports Workspace.WorkspaceA.WA_Assembly (vb.net) or using Workspace.WorkspaceA.WA_Assembly (C#) for referencing the Shared Public Functions. Then you will be able to use these functions in another workspace ! Just adding this message for future references :)43Views2likes1CommentMove File from Application Database to External Shared Drive
I currently have a metadata file being created by an Extender BR and saved down to the Application Database: Case Is = ExtenderFunctionType.ExecuteDataMgmtBusinessRuleStep 'Export File Dim fileName As String = "AccessoryMetadata.csv" Dim filePath As String = $"Documents/Public/XFDocs/XFDocs_Public" Dim ud1DimPk As DimPk = BRApi.Finance.Dim.GetDimPk(si, "MainProduct") Dim category As String = "" Dim businessStream As String = "" 'Export CSV to User Temp Folder Dim listOfParents As List(Of memberinfo) = BRApi.Finance.Members.GetMembersUsingFilter(si, _ ud1DimPk, _ "U1#ReportingProduct.Descendants.Where(" & _ "Name Contains Accessories" & _ "And Name <> 15_Accessories" & _ "And HasChildren = True)", _ True) Dim csv As New Text.StringBuilder csv.AppendLine("Name, Description, ParentName, Category, Business Stream") For Each parentMember In listOfParents For Each childMember In BRApi.Finance.Members.GetChildren(si, _ ud1DimPk, parentMember.Member.MemberId) ... csv.AppendLine($"""{childMember.Name}"",""{childMember.Description _ }"",""{parentMember.Member.Name}"",""{category}"",""{businessStream}""") Next Next Dim fileBytes As Byte() = Encoding.UTF8.GetBytes(csv.ToString) 'Save csv to file Dim XFfileDataInfo As New XFFileInfo(FileSystemLocation.ApplicationDatabase, fileName, filePath) Dim XFfileData As New XFFile(XFFileDataInfo, String.Empty, fileBytes) brapi.FileSystem.InsertOrUpdateFile(si, XFfileData) Is there any way to then automatically move this file to an external shared drive? Or does the above need to be written in a different way in order for it to work?Solved4.2KViews0likes6CommentsRecurring journal with Auto Post
So im trying to create a rule that pulls selected journals forward than posts them automaticaly. I have my test journal pulling forward as expected but when im trying to post the journal in rule below its causing the rule to error. The line in question is, BRApi.Journals.Process.ExecutePost(si, journalObjectHeader.UniqueID) What am i missing it seems pretty straight forward? Imports System Imports System.Data Imports System.Data.Common Imports System.IO Imports System.Collections.Generic Imports System.Globalization Imports System.Linq Imports Microsoft.VisualBasic Imports System.Windows.Forms Imports OneStream.Shared.Common Imports OneStream.Shared.Wcf Imports OneStream.Shared.Engine Imports OneStream.Shared.Database Imports OneStream.Stage.Engine Imports OneStream.Stage.Database Imports OneStream.Finance.Engine Imports OneStream.Finance.Database Imports System.IO.Compression Namespace OneStream.BusinessRule.Extender.CA_JournalRecurring2 Public Class MainClass Public Function Main(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Object, ByVal args As ExtenderArgs) As Object Try Select Case args.FunctionType Case Is = ExtenderFunctionType.Unknown CopyJournal(si) Case Is = ExtenderFunctionType.ExecuteDataMgmtBusinessRuleStep Case Is = ExtenderFunctionType.ExecuteExternalDimensionSource 'Add External Members Dim externalMembers As New List(Of NameValuePair) externalMembers.Add(New NameValuePair("YourMember1Name","YourMember1Value")) externalMembers.Add(New NameValuePair("YourMember2Name","YourMember2Value")) Return externalMembers End Select Return Nothing Catch ex As Exception Throw ErrorHandler.LogWrite(si, New XFException(si, ex)) End Try End Function Private Sub CopyJournal(ByVal si As SessionInfo) Try 'retrieve the names of the workflow parameters and concatenate them together Dim profilePostfix As String = brapi.Workflow.Metadata.GetProfile(si,si.WorkflowClusterPk.ProfileKey).Name Dim scenarioPostfix As String = brapi.Finance.Members.GetMemberName(si,dimtype.Scenario.Id, si.WorkflowClusterPk.ScenarioKey) Dim timePostfix As String = brapi.Finance.Members.GetMemberName(si, dimtype.Time.Id, si.WorkflowClusterPk.TimeKey) Dim strPostfix As String = $"{profilePostfix}_{scenarioPostfix}_{timePostfix}" 'The name of the journal to copy Dim journalName As String ="Tax Accruals_Houston.journals_Actual_2011M2" Dim oldJournalObject As JournalEx = BRApi.Journals.Metadata.GetJournalOrTemplate(si, journalName) brapi.ErrorLog.LogMessage(si, journalName) 'Remove the postfix from the old journal name to get the name Dim strOldName As String = oldJournalObject.Header.Header.Name Dim oldProfileName As String = brapi.Workflow.Metadata.GetProfile(si,oldJournalObject.Header.Header.WorkflowProfileID).Name strOldName = strOldName.Remove(strOldName.IndexOf(oldProfileName)) brapi.ErrorLog.LogMessage(si, strOldName) 'create a copy of the journal header Dim journalObjectHeader As New JournalHeader(oldJournalObject.Header.Header) 'Update the required parameters journalObjectHeader.Name = $"RF_{strOldName}{strPostfix}" journalObjectHeader.Description = $"Roll Forward from {oldJournalObject.Header.Header.name}: {oldJournalObject.Header.Header.Description}" journalObjectHeader.UniqueID = Guid.NewGuid() journalObjectHeader.MemberIds.Scenario = si.WorkflowClusterPk.ScenarioKey journalObjectHeader.MemberIds.Time = si.WorkflowClusterPk.TimeKey journalObjectHeader.WorkflowProfileID = si.WorkflowClusterPk.ProfileKey ' Log the unique ID Of the journal before posting brapi.ErrorLog.LogMessage(si, $"Journal UniqueID: {journalObjectHeader.UniqueID}") 'Journal status as working journalObjectHeader.JournalStatus = JournalStatus.Working 'Create a copy of the journal line item using linq Dim journalObjectLineItems As list(Of JournalLineItem) = oldJournalObject.LineItems.Select(Function(x) New JournalLineItem(x.LineItem)).tolist 'Create a new journal object Dim journalObject As New Journal(journalObjectHeader, journalObjectLineItems) 'Save it BRApi.Journals.Metadata.SaveJournalOrTemplateUsingIds(si, journalObject, False, True) ' Post the journal using ExecutePost BRApi.Journals.Process.ExecutePost(si, journalObjectHeader.UniqueID) brapi.ErrorLog.LogMessage(si, $"Journal '{journalObjectHeader.Name}' posted successfully.") Catch ex As Exception Throw ErrorHandler.LogWrite(si, New XFException(si, ex)) End Try End Sub155Views0likes2CommentsSaveFileBytesToUserTempFolder returning an error message
Hi, I am trying to use the Business Rule API "SaveFileBytesToUserTempFolder" in order to open a file stored as a byte in a datatable. This is exactly like in the "Reporting Compliance" dashboard, where the file is stored as bytes in a datatable. I am actually using the exact same business rule ! However, there is an issue in my case. My business rule that is used to view the document works fine until the very last step... this is the one causing the error ( I have tested FileName and FileBytes fields and these exist) : BRApi.Utilities.SaveFileBytesToUserTempFolder(si, si.UserName, dt(0)("FileName"), dt(0)("FileBytes")) Error message : An error occurred while receiving the HTTP response to http://localhost:50002/OneStreamApp/SVC/XFFileSystem.svc. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details. The underlying connection was closed: An unexpected error occurred on a receive. Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. An existing connection was forcibly closed by the remote host (Socket Error Number 10054). The exact same file is used in Reporting Compliance and I can view it. Am I missing something ? I don't find any documentation on this function ... Regards,4.5KViews0likes12CommentsCAT_executeCopy rule
Hi, In our application, we uninstalled and re-installed Cloud Administration Tool, after did this trying to compile CAT_executeCopy while doing this getting validation errors. My concern is after uninstall CAT, is it mandatory clear CAT_executeCopy rule as well?17Views0likes0Comments