SBX - Search With Button

SBX - Forum Post Title

Getting the sum of a specific attribute in a node list

Microsoft Dynamics CRM Forum

PeteN asked a question on 13 Oct 2018 12:34 PM
My Badges

Question Status

Unanswered

I'm trying to get the sum of the @valueOf  attribute from a node list. There can be x number of records

if for instance there are three records , my code below only gets the first record 3 times

                                        Dim _values As XmlNodeList = _temp_xml_Doc.SelectNodes("/BACSDocument/Data/ARUDD/Advice/OriginatingAccountRecords/OriginatingAccountRecord/ReturnedDebitItem")
                                        Dim Counter As Integer = 0
                                        For Counter = 1 To _values.Count
                                            Dim x As XmlAttribute = _temp_xml_Doc.SelectSingleNode("/BACSDocument/Data/ARUDD/Advice/OriginatingAccountRecords/OriginatingAccountRecord/ReturnedDebitItem/@valueOf")
                                            _totalvalue = _totalvalue + CDec(x.Value)
                                        Next


Reply
Aric Levin responded on 13 Oct 2018 11:38 PM

Hi Pete,

How is this question associated with Dynamics CRM?

Have you tried msdn or visual studio forums?

social.msdn.microsoft.com/.../home

developercommunity.visualstudio.com

Hope this helps

Reply

SBX - Two Col Forum

SBX - Migrated JS