This topic is locked

How can I modify the copied records in details table.

1/21/2021 1:56:46 PM
PHPRunner General questions
Myr0n author

Somebody know how can I edit all records in a details table after the master and details are being copied with the copy button? also how to make stop adding a new blank record to the top of the details table after being copied ?
Can you help me please, i'm stuck.

I have a master and detail page, when I click on the copy button and show me the master and details copied records, I would like that the details records can be editable.

I don't know if is normal or not but when I click the copy button the page show me the copied records but when I click on the save button only save the master record with a new Id but no details records are saved.

The only way that I found to be editable the details copied records is adding the next line in javascriptonload list page



if ( pageObj.baseParams.masterpagetype === "add" ) {

for (i = 0; i < totalNumberOfRecordFromDetails; i++) {

pageObj.inlineAdd.getControls(pageObj, pageObj.inlineAdd.getControls(pageObj, pageObj.inlineAdd.rows[i], false, true, false ); //This line make the row editable.

pageObj.inlineAdd.rows[i].submitted = false;

pageObj.inlineAdd.rows[i].isAdd = true;

}

}

The issue with the above code is that shows the html record and the edited record in the same row.
Somebody know how to fix it or have a clue what can I do please?
Thank you so much

J
jacktonghkDevClub member 3/8/2021

[I am having the same issue with 10.5

Myr0n author 3/9/2021



[I am having the same issue with 10.5



Unfortunately I didn't solve yet this issue and is the last one this issue in my todo list.

If I solve it I will post the solution.

J
jacktonghkDevClub member 3/9/2021



Unfortunately I didn't solve yet this issue and is the last one this issue in my todo list.

If I solve it I will post the solution.


Thank you for your reply. I found that the copy function duplicates the detail records in a way that the original master record key will also be copied to the new detail records. I think the master record key should leave blank because it is not assigned yet until the 'SAVE' button is pressed. That's why we a blank detail record but the 'copied details' are not saved, the new master record key is not saved in these detail records. However, I still don't know how to fix it.

Myr0n author 3/9/2021



Thank you for your reply. I found that the copy function duplicates the detail records in a way that the original master record key will also be copied to the new detail records. I think the master record key should leave blank because it is not assigned yet until the 'SAVE' button is pressed. That's why we a blank detail record but the 'copied details' are not saved, the new master record key is not saved in these detail records. However, I still don't know how to fix it.



I'm totally agree that the master key should be blank because the table in the db will automatically generate the next key but even leaving blank the problem still there.

fhumanes 3/9/2021

Hello:
It is not the same case, but the same serves as inspiration for the resolution of your problem.
https://asprunner.com/forums/topic/28006-guide-7-synchronize-update-between-master-and-detail/
Greetings,

Fernando.

J
jacktonghkDevClub member 3/10/2021



Hello:
It is not the same case, but the same serves as inspiration for the resolution of your problem.
https://asprunner.com/forums/topic/28006-guide-7-synchronize-update-between-master-and-detail/
Greetings,

Fernando.


The copy function works perfectly on a single table and I hope it will do the same for master-detail tables in the near future, may be it can emulate the inline add functions.

Myr0n author 3/10/2021



Hello:
It is not the same case, but the same serves as inspiration for the resolution of your problem.
https://asprunner.co...ter-and-detail/
Greetings,

Fernando.


Thank you Fernando