Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Loop through multiple subForms in Form ( ALD) for SAP C4C

Avatar

Avatar
Validate 1
Level 1
dhruvinm
Level 1

Like

1 like

Total Posts

14 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
dhruvinm
Level 1

Like

1 like

Total Posts

14 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
dhruvinm
Level 1

03-04-2019

Dear All,

I have requirement to design a Form and i need to fetch the city of Shipment from FormAddress of Product Recipient party in Form.

loopthrough SubFormsin C4C.PNG

please check my DataView(Model) for the same.

Now as u can see my firlst level ResolveNodes is working and fetching the Formattedname but second level resolvenode is not giving me any data.

Kindly help.

Example data mode:

<FormQuote>
  
<ID>5125</ID>
  
<Date>2019-04-02</Date>
  
<ProductRecipientParty>
  
<InternalID>C00009</InternalID>
  
<SellerID>C00009</SellerID>
  
<FormAddress>
  
<FormattedAddressDescription>xyz/3300/HU</FormattedAddressDescription>
  
<CityName>Eger</CityName>
  
</FormAddress>
  
<FormattedName>Aventics Hungary Kft.</FormattedName>
  
</ProductRecipientParty>
 
</FormQuote>

As you can see i want to go to FormAddress SubForm and i have tried a lot of approaches.

Can some1 help me in this.

BR

Dhruvin

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Springboard
MVP
Magus069
MVP

Likes

143 likes

Total Posts

1,077 posts

Correct Reply

155 solutions
Top badges earned
Springboard
Validate 1
Ignite 3
Ignite 1
Establish
View profile

Avatar
Springboard
MVP
Magus069
MVP

Likes

143 likes

Total Posts

1,077 posts

Correct Reply

155 solutions
Top badges earned
Springboard
Validate 1
Ignite 3
Ignite 1
Establish
View profile
Magus069
MVP

10-04-2019

So if I understand well, you want to access each FormAddress within each ProductRecipientParty, right?

So by setting a variable named PRDL with the resolveNodes of ProductRecipientParty, you should be able to access FormAddress with that variable by using the resolveNodes on each item:

var PRDL = reference_syntax.resolveNodes("ProductRecipientParty[*]");

for (var i = 0, iLength = PRDL.length; i < iLength; i++){

     var FRMADD = PRDL.item(i).resolveNodes("FormAddress[*]");

     for (var ii = 0, iiLength = FRMADD.length; ii < iiLength; ii++){

          var oneFormAddress = FRMADD.item(ii);

     }

}

I hope this will help you.

Answers (4)

Answers (4)

Avatar

Avatar
Validate 1
Level 1
dhruvinm
Level 1

Like

1 like

Total Posts

14 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
dhruvinm
Level 1

Like

1 like

Total Posts

14 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
dhruvinm
Level 1

10-04-2019

Hi,

Thanks a lot for ur response. I did not understand your response.

The problem is not that i am not able to "Loop" the problem is

I have in my Data View Tree,

Main Header is FromQuote.

Parent Subform is ProductRecipientParty and

Child of ProductRecipientParty is FormAddress.

I am able to access ProductRecipientParty like Below,

But i want to access now FormAddress

So how can i use resolveNodes for the same?

I hope this is more clear where i am stuck.

BR

Dhruvin

Avatar

Avatar
Springboard
MVP
Magus069
MVP

Likes

143 likes

Total Posts

1,077 posts

Correct Reply

155 solutions
Top badges earned
Springboard
Validate 1
Ignite 3
Ignite 1
Establish
View profile

Avatar
Springboard
MVP
Magus069
MVP

Likes

143 likes

Total Posts

1,077 posts

Correct Reply

155 solutions
Top badges earned
Springboard
Validate 1
Ignite 3
Ignite 1
Establish
View profile
Magus069
MVP

08-04-2019

For any subform that has multiple instances, you can iterate through each of em using resolveNodes with the following statement:

I hope this will help you

Avatar

Avatar
Validate 1
Level 1
dhruvinm
Level 1

Like

1 like

Total Posts

14 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
dhruvinm
Level 1

Like

1 like

Total Posts

14 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
dhruvinm
Level 1

07-04-2019

Hi Magus069,

Thanks a lot for your response.

You can kindly ignore that line, I just want to know how can I traverse through subForms using resolveNodes?

BR

Dhruvin

Avatar

Avatar
Springboard
MVP
Magus069
MVP

Likes

143 likes

Total Posts

1,077 posts

Correct Reply

155 solutions
Top badges earned
Springboard
Validate 1
Ignite 3
Ignite 1
Establish
View profile

Avatar
Springboard
MVP
Magus069
MVP

Likes

143 likes

Total Posts

1,077 posts

Correct Reply

155 solutions
Top badges earned
Springboard
Validate 1
Ignite 3
Ignite 1
Establish
View profile
Magus069
MVP

04-04-2019

Hi there,

Just to check in with you, it seems like the iteration you are doing until you reach the number ilength would not work because ilength is not defined? Maybe something's missing like

Let me know if this solves your issue