12-14-2023 04:58 PM - last edited on 12-14-2023 05:09 PM by JackLacava
Hi, I have the following code that gives me an error: Object reference not set to an instance of an object.
Dim listMbrEntityD As New List(Of Member)
Dim dimpkEntityD As New DimPk(mbrEntityD.DimTypeId, mbrEntityD.DimId)
listMbrEntityD.AddRange(BRApi.Finance.Members.GetBaseMembers(si, dimpkEntityD, mbrEntityD.MemberId))
I have debugged with errorlog but it doesn’t manage to print anything to see the values, any idea how to solve it?
Solved! Go to Solution.
12-14-2023 06:10 PM
The reason you got no values in your debug is probably the same reason you're getting the error. Something you're trying to use is not set to anything.
E.g., mbrEntityD, dimpkEntityD, or the result of "BRApi.Finance.Members.GetBaseMembers(si, dimpkEntityD, mbrEntityD.MemberId)"
Check those one by one and I think you'll find it.
12-14-2023 06:10 PM
The reason you got no values in your debug is probably the same reason you're getting the error. Something you're trying to use is not set to anything.
E.g., mbrEntityD, dimpkEntityD, or the result of "BRApi.Finance.Members.GetBaseMembers(si, dimpkEntityD, mbrEntityD.MemberId)"
Check those one by one and I think you'll find it.
12-15-2023 12:32 PM
Hi Daniel, I saw that my empty variable is mbrEntityD, which is extracted in the following way.
Dim mbrEntityD As Member = BRApi.Finance.Members.GetMember(si, dimTypeId.Entity, drAllocRegister("DEntity").ToString)
And the values: Entity - 11201_12207.
Do you know how I can verify the information that getmember returns to me with those values?
12-17-2023 08:10 PM
Sorry I'm not quite sure what you mean. My Guess is that 'drAllocRegister("DEntity").ToString' is not returning what you expect though.
12-19-2023 12:21 PM
Hi Marco,
Try adding the line below and then run it and check it in the System/Error Log. Then you can check that you're selecting the right member looking to the memberID information.
Good luck
Carlos
BRApi.ErrorLog.LogMessage(si, mbrEntityD.ToString)