-   Miscellaneous (
-   -   How to use array form field to display multiple data (

kingsley143 18th August 2017 08:48

How to use array form field to display multiple data
1 Attachment(s)

I am developing a maintain session on which project no will be input and based on that i want to fetch all the invoice no.s present against project no. and against every invoice user can enter bill no.

After giving project as input, only last invoice is getting displayed on the form. I want to display all the invoices.In this case 3 invoices are present against one project. I want to display all the 3 invoices and date on the form.

Do I have to use form field as array and how to use? Or is there any other way.
Please suggest.

screenshot of my form is attached.
Here, invn, bdte, sern are my display fields on the form.
Below is my code:

        serial.num = 0
        sern = serial.num + 1

function void get.invoice.number()
        select        cisli310.*
        from                cisli310
        where        cisli310.cprj = {:cprj}
                invn = cisli310.tran&(str$(cisli310.idoc))
                select        cisli305.*
                from                cisli305
                where        cisli305._index1 ={:cisli310.sfcp,:cisli310.tran,:cisli310.idoc}
                        if cisli305.stat = tcsli.stat.posted then
                                flag = true
                        bdte = cisli305.idat
                        bdte = 0

Thanks in advance.

mark_h 18th August 2017 14:20

I do something like this in 4c4. So what I do is create an array of the domain I am looking to display. Then on my form I put the fields - in the below case I allow them to run 20 ranges of work centers. So on the form the first from and to field are element 1 and then the second is 2 so on and so forth. On 4c4 next to the field name on the form is the array element. So not sure if this helps or answers your question or not. In your example I would expect invn to be an array.

Now my session was simple - if you are trying to display partial records and scroll up or down that becomes different. This is what I think you are doing. Then what I did was just build a temporary table to have what I wanted in it - then the user scrolls just like any other multi-occurrence session. So basically I could not have a field defined as multi-occurrence named something like WC(even if it was an array). There is something probably better in LN than I have access so you might want to wait for an LN user. Anyway wait for an LN user


        extern        domain        tccwoc                main.f(20), main.t(20)

        main.t(1,attr.element) = main.f(1,attr.element)

bhushanchanda 18th August 2017 16:05

I will recommend creating a table instead of using an array of fields on form.That will make your life much simpler. Upon entering the project, fill the table with all related invoices. And, now let user maintain the Bill numbers against them.

Keep it simple.

All times are GMT +2. The time now is 05:41.

©2001-2018 - -