33
Views
5
Comments
Solved
Trying to output a list on integration studio
Application Type
Service
Service Studio Version
11.55.4 (Build 63890)
Platform Version
11.33.0 (Build 44426)

Im trying to apend values directly on a list using visual studios and integration studio but when im debugging on service studio none of the values show up.
This is my function (integration studio view):

This is my structure "TextPerPage":

This is my function(visual studio view)*i'll leave the code bellow *:


And this is my service studio screen action and as its possible to see, it reached the end of the action so it runned the GetTextPerPagemanualTest server action and it also returned the "finished" on errormessage parameter : 




public void MssGetTextPerPagemanualtest(byte[] ssPDF, int ssPageNumber, out RLTextPerPageRecordList ssTextPerPageOutPut, out string ssErrorMessage) {

    ssTextPerPageOutPut = new RLTextPerPageRecordList();

    ssErrorMessage = string.Empty;


        // Manually create and add 3 records

        RCTextPerPageRecord record1 = new RCTextPerPageRecord

        {

            ssSTTextPerPage = new STTextPerPageStructure

            {

                ssPageText = "hello",

                ssPageNumber = 1

            }

        };

        ssTextPerPageOutPut.Add(record1);

    ssErrorMessage = "1";


        RCTextPerPageRecord record2 = new RCTextPerPageRecord

        {

            ssSTTextPerPage = new STTextPerPageStructure

            {

                ssPageText = "hello2",

                ssPageNumber = 2

            }

        };

        ssTextPerPageOutPut.Add(record2);

    ssErrorMessage = "2";

    RCTextPerPageRecord record3 = new RCTextPerPageRecord

        {

            ssSTTextPerPage = new STTextPerPageStructure

            {

                ssPageText = "hello3",

                ssPageNumber = 3

            }

        };

        ssTextPerPageOutPut.Add(record3);

    ssErrorMessage = "finished";


}

2018-08-27 08-29-35
Fábio Vaz
Solution

Hello João, 

leave here an example:


AppendList.Net.oap
2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Apprently the example worked, but @João Palhares can you explain what the difference was between the example and your code?

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi João,

At least two things you're doing wrong. For one, when creating a new Record, always use

RCMyRecord rec = new RCMyRecord(null);

That is, call the constructor that has a parameter (but use null for input). This ensures the internal bookkeeping of records is taken care off, and all the attributes get their default values.

Secondly, you should use Append, not Add, to add a Record to a Record List. Not sure what Add is or does, but Append is the one you're looking for.

2024-10-31 16-25-26
João Palhares

I did what you said but it still doesn't work
service studio view:

Visual Code view:

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Well, for one, you shouldn't do new STTextPerPageStructure, as that's an attribute of record1, and this already initialized by the call to new RCTextPerPageRecord(null). Otherwise it looks ok at first glance.

2018-08-27 08-29-35
Fábio Vaz
Solution

Hello João, 

leave here an example:


AppendList.Net.oap
2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Apprently the example worked, but @João Palhares can you explain what the difference was between the example and your code?

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.