Good evening everyone
With nubuilder 3.0 it referred to the id code of the records in a form
get record from db using parameter passed through runIt() via a hash id
$sql ="SELECT * FROM requerimiento where tarea_id='#runIt1#'";
nuDebug($sql);
Que comando o variable replaces #runlt# in nubuilder forte 4.5?
I appreciate the guidance
Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
How to Call the Record ID of a Subform Topic is solved
Re: How to Call the Record ID of a Subform
Hi cjuliao,
I can't remenber, but I think nuBuilder 3 may have required a where clause.
eg.
(I'm not sure about #runIt1#)
But nuBuilder 4 does it automatically by asking for the Foriegn Key...
I think you are refering to #RECORD_ID#. - now refered to as a Hash Cookie...
https://wiki.nubuilder.cloud/index.php? ... sh_Cookies
You can still use Hash Cookies in the Subform's SQL.
You can check the Hash Cookies available in PHP by using nuHash()...
https://wiki.nubuilder.cloud/index.php?title=PHP#nuHash
You can create your own as well in JavaScript with nuSetProperty()...
https://wiki.nubuilder.cloud/index.php? ... etProperty
Steven
I can't remenber, but I think nuBuilder 3 may have required a where clause.
eg.
Code: Select all
SELECT * FROM zzzsys_object WHERE sob_zzzsys_form_id = '#RECORD_ID#'
But nuBuilder 4 does it automatically by asking for the Foriegn Key...
I think you are refering to #RECORD_ID#. - now refered to as a Hash Cookie...
https://wiki.nubuilder.cloud/index.php? ... sh_Cookies
You can still use Hash Cookies in the Subform's SQL.
You can check the Hash Cookies available in PHP by using nuHash()...
https://wiki.nubuilder.cloud/index.php?title=PHP#nuHash
You can create your own as well in JavaScript with nuSetProperty()...
https://wiki.nubuilder.cloud/index.php? ... etProperty
Steven
You do not have the required permissions to view the files attached to this post.
If you like nuBuilder, how about leaving a nice review on SourceForge?
Re: How to Call the Record ID of a Subform
When I click the download button of the subform, I need the value of the ID of the subform record to call me.
The procedure for the consultation is:
$select = "SELECT tarea_id, concep_tecnico_file_name, concep_tecnico_file_type, concep_tecnico FROM requerimiento WHERE tarea_id = ?";
$stmt = nuRunQuery($select, ['#?????????? #']);
If I use #RECORD_ID" it returns the form code 153eb96eaced14
And I need you to return the registration code of subform 15aa80171121cb.
What should I use for the statement $stmt = nuRunQuery($select, ['#?????????? #']);
See attached image of the form Imagen_1.png
Thank you steven for the attention, nubuilder helps me a lot to an environmental management program
You do not have the required permissions to view the files attached to this post.
Re: How to Call the Record ID of a Subform
cjuliao,
Can you upload of copy of your db (without any private information), and we can take a look.
Steven
Can you upload of copy of your db (without any private information), and we can take a look.
Steven
If you like nuBuilder, how about leaving a nice review on SourceForge?
Re: How to Call the Record ID of a Subform
cjuliao wrote: ↑Wed Dec 18, 2024 5:42 pmThank you very much Steven for the attention, but I have not been able to solve it.
When I click the download button of the subform, I need the value of the ID of the subform record to call me.
The procedure for the consultation is:
$select = "SELECT tarea_id, concep_tecnico_file_name, concep_tecnico_file_type, concep_tecnico FROM requerimiento WHERE tarea_id = ?";
$stmt = nuRunQuery($select, ['#?????????? #']);
If I use #RECORD_ID" it returns the form code 153eb96eaced14
And I need you to return the registration code of subform 15aa80171121cb.
What should I use for the statement $stmt = nuRunQuery($select, ['#?????????? #']);
See attached image of the form Imagen_1.png
Thank you steven for the attention, nubuilder helps me a lot to an environmental management programImagen_1.png
Hi may be you can do something like this on the onclick event of the button;
Code: Select all
var id = event.target.parentNode.id;
var subformid = $('#' + String(id)).attr('data-nu-primary-key');
if (subformid === '-1' || subformid === ''){
alert('can not update this record');
return } else{
nuSetProperty('subformid', subformid);
nuPopup('60e788e61c8c475', subformid, '','');
}
Code: Select all
nuSetProperty('subformid', subformid);
Regards
Nilesh
Re: How to Call the Record ID of a Subform
Good night Steven
He sent you the database.
Please review the Download button and the SHOWFILE_CON_TEC procedure
He sent you the database.
Please review the Download button and the SHOWFILE_CON_TEC procedure
You do not have the required permissions to view the files attached to this post.
Re: How to Call the Record ID of a Subform
Hi cjuliao,
Add this JavaScript...
Here...
And change the PHP in your Procedure to this...
If you open up Debug (after it has run)...
You can see that running nuHash() will show that CURRENT_SUBFORM_ID has been created by the JavaScript above...
Steven
Add this JavaScript...
Code: Select all
nuSetProperty('CURRENT_SUBFORM_ID', $(this).parent().attr('data-nu-primary-key'),1);
nuRunPHP('SHOWFILE_CON_TEC', '', 1);
Here...
And change the PHP in your Procedure to this...
Code: Select all
nuDebug(nuHash());
$select = "SELECT tarea_id,concep_tecnico_file_name,concep_tecnico_file_type,concep_tecnico FROM requerimiento WHERE tarea_id = ?";
$stmt = nuRunQuery($select, ['#CURRENT_SUBFORM_ID#']);
if ($stmt->rowCount() > 0) {
while($row = db_fetch_array($stmt)){
$nombre_archivo = $row['concep_tecnico_file_name'];
$documento_id = $row['tarea_id'];
$fileData = $row['concep_tecnico'];
$fileType = $row['concep_tecnico_file_type'];
$fileName = $row['concep_tecnico_file_name'];
$nombre_archivoreal = $row['concep_tecnico_file_name'];
header("Content-Type: $fileType");
header("Content-Disposition: attachment; filename=\"$fileName\"");
header("Content-Length: " . strlen($fileData));
echo $fileData;
}
}
If you open up Debug (after it has run)...
You can see that running nuHash() will show that CURRENT_SUBFORM_ID has been created by the JavaScript above...
Steven
You do not have the required permissions to view the files attached to this post.
If you like nuBuilder, how about leaving a nice review on SourceForge?
Re: How to Call the Record ID of a Subform
Good evening, Steven
Thank you very much for the assistance or help.
I want to thank you and congratulate you for this project, it is really a good tool that has helped me a lot in my work.
I'm sure I haven't taken advantage of nubuilder's full potential.
I wonder if there is a commercial version with permanent assistance.
This is because I would like to make use of the tool with a formal business relationship.
I speak Spanish and use a translator, so excuse me if I write something incorrectly.
The NC07 version also worked but latest code is a bit better.
Thank you very much for the assistance or help.
I want to thank you and congratulate you for this project, it is really a good tool that has helped me a lot in my work.
I'm sure I haven't taken advantage of nubuilder's full potential.
I wonder if there is a commercial version with permanent assistance.
This is because I would like to make use of the tool with a formal business relationship.
I speak Spanish and use a translator, so excuse me if I write something incorrectly.
The NC07 version also worked but latest code is a bit better.