Baanboard.com

Baanboard.com (http://www.baanboard.com/baanboard/index.php)
-   Miscellaneous (http://www.baanboard.com/baanboard/forumdisplay.php?f=9)
-   -   How to use array form field to display multiple data (http://www.baanboard.com/baanboard/showthread.php?t=70354)

kingsley143 18th August 2017 09:48

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

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:
Code:


field.cprj:
after.zoom:
        serial.num = 0
        get.details()
        get.contract()
        get.invoice.number()
        sern = serial.num + 1
        display("sern")
        refresh()

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

Thanks in advance.

mark_h 18th August 2017 15: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

Code:


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

field.main.f:
after.input:
        main.t(1,attr.element) = main.f(1,attr.element)
        display.all()


bhushanchanda 18th August 2017 17: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 15:18.


vB.Sponsors
©2001-2017 - Baanboard.com - Baanforums.com