data insertion in table

mdsrmdsr Member Posts: 163
edited 2019-12-23 in NAV Three Tier
Hello experts,
I have scenario like i have custom page on page i have action on click of that action data from page is store in table .for that i have created table QC test Result.
In action added code
QCTestResult1.INIT;
    QCTestResult1."Test Certificate No":="Test Certificate No";
    QCTestResult1."GRN No.":="GRN No.";
    QCTestResult1."Line No.":="Line No.";
    QCTestResult1."Item No.":="Item No.";
    QCTestResult1."Parameter Code":="Parameter Code";
    QCTestResult1."Test Method Code":="Test Method Code";
    QCTestResult1."Parameter Name":="Parameter Name";
    QCTestResult1."Test Method Name":="Test Method Name";
    QCTestResult1.Specification:=Specification;
    QCTestResult1.Result:=Result;
    QCTestResult1.Approved:=Approved;
    QCTestResult1.Rejected:=Rejected;
    QCTestResult1.INSERT(TRUE);[code]
where QCTestResult is record variable of that table in which data want to store of page.problem is that one one line data pull not multiple line of page how we can get all lines from page into table.
thanks in advance

Answers

  • RockWithNAVRockWithNAV Member Posts: 1,139
    Still the question is not clear but what i understood is you want to insert the entire records of the page into some custom table, that's something you want??

    Where is Repeat Until then?
    All table columns are same?
  • mdsrmdsr Member Posts: 163
    edited 2019-12-23
    @RockWithNAV I have added repeat ..until bu still it not gives me all records of line
    IF  PurchaseQCTestResult.FindFirst THEN BEGIN
    REPEAT
        QCTestResult1.INIT;
        QCTestResult1."Test Certificate No":="Test Certificate No";
        QCTestResult1."GRN No.":="GRN No.";
        QCTestResult1."Line No.":="Line No.";
        QCTestResult1."Item No.":="Item No.";
        QCTestResult1."Parameter Code":="Parameter Code";
        QCTestResult1."Test Method Code":="Test Method Code";
        QCTestResult1."Parameter Name":="Parameter Name";
        QCTestResult1."Test Method Name":="Test Method Name";
        QCTestResult1.Specification:=Specification;
        QCTestResult1.Result:=Result;
        QCTestResult1.Approved:=Approved;
        QCTestResult1.Rejected:=Rejected;
        QCTestResult1.INSERT(TRUE);
    UNTIL PurchaseQCTestResult.NEXT=0;
    END;
    

    table have same column as pages
  • edoderooedoderoo Member Posts: 89
    You repeatedly add the same record into the table (or maybe no record at all, if PurchaseQCTestResult has no records at all. I would suggest to use the debugger, or add a message in your loop to check if the code is excuted at all.
    IF User.Loves('Edo') THEN ok() ELSE currReport.genSkip;
  • vaprogvaprog Member Posts: 1,139
    Your question is entirely unclear.

    What type of page do you have?
    Do you have a repeater on that page, or how else is the data on your page relevant to more than one record to be modified?
    Does your page have SourceTableTemporary=Yes?

    Maybe tell us more about your use case and how you intended to go about it.
  • mdsrmdsr Member Posts: 163
    Hi vaprog,let me explain:
    i have created one table (QC Test Result) in which i have to store data came from page.i have added same field in table.
    i have created custom page .page having action (approved)on click of action data from page shown have to transfer to table.
    if i used code without repeater it will send data but only single line from page.
    if i used repeat..untill then it not sending data at all.
    now i want send all lines from page to table.

Sign In or Register to comment.