CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 ::: Problem with $DataForm->ds->RecordsCount ...

Print topic Send  topic

Author Message
klwillis


Posts: 428
Posted: 10/05/2004, 3:01 PM

Has anyone experienced this problem:

I have a grid based on a query of several tables,
and when selecting one the grid entries, I display
a record form on the same page.

The problem is when I try and detect the record count
for the record form - using $DataForm->ds->RecordsCount -
it always returns 0.


_________________
Kevin Willis, VP/CIO
HealthCare Information Technology Specialist
http://www.nexushealthcare.com
"Fast - Convenient - Quality-Care"

Medical Software Consulting Services
Email : klwillis@nexushealthcare.com
Skype : klwillis2006
View profile  Send private message
peterr


Posts: 5971
Posted: 10/06/2004, 1:27 AM

This doesn't look like a problem. Record forms display only one record therefore the count is not needed. It would be always 1.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
klwillis


Posts: 428
Posted: 10/06/2004, 8:45 AM

No - it returns 0, when it should return 1.

The best way to simulate this problem is to create a grid based
on a query across several tables whose primary key values have
the same name (i.e. table family has a primary key named id, and
table children has a primary key named id, with foreign key family_id, etc...)

The record detail information is to be displayed on the same page.

Quote peterr:
This doesn't look like a problem. Record forms display only one record therefore the count is not needed. It would be always 1.

_________________
Kevin Willis, VP/CIO
HealthCare Information Technology Specialist
http://www.nexushealthcare.com
"Fast - Convenient - Quality-Care"

Medical Software Consulting Services
Email : klwillis@nexushealthcare.com
Skype : klwillis2006
View profile  Send private message
peterr


Posts: 5971
Posted: 10/06/2004, 11:22 AM

Of course. I only meant that it *would* always return 1, therefore there is no need for such count. You already know that it is 1 and always will be 1.
Thus there is no such functionality. Count for records doesn't exist because there is no need for it, therefore it is returned as 0. You can just replace "$DataForm->ds->RecordsCount" with the constant value "1".
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
SteveG

Posts: 56
Posted: 02/03/2005, 3:25 PM

Why bother providing this function to record forms if it doesn't work?

If the query for a record finds no results, then shouldn't the recordscount say 0, but if the query does find a record, then the recordscount ought to say 1, no?

For example, I have a custom insert record which drags in fields from other tables to help with the field values; it would be nice to know if it finds related table records or not, to know if it's possible to insert the record I want. I tried to tweak recordscount to do this, *for hours*, and now it seems that it was a waste of time. How can I find out if the datasource is finding a record to help me with the custom update?
View profile  Send private message
klw
Posted: 02/03/2005, 3:35 PM

Maybe we'll see a fix for this in the next release? 8-)


Quote peterr:
Of course. I only meant that it *would* always return 1, therefore there is no need for such count. You already know that it is 1 and always will be 1.
Thus there is no such functionality. Count for records doesn't exist because there is no need for it, therefore it is returned as 0. You can just replace "$DataForm->ds->RecordsCount" with the constant value "1".
peterr


Posts: 5971
Posted: 02/03/2005, 3:42 PM

This is a function of the datasource, not the record form itself. You may be right that this function could return 0 or 1 (I could check into this), however the Record Form works differently depending on if a record is found or not. Thus our docs and tutorials show how to examine the record's form mode:
http://docs.codecharge.com/studio/html/ProgrammingTechn...neFormMode.html
http://docs.codecharge.com/studio/html/QuickStart/Creat...LabelValue.html

I see others using this method as well: http://forums.codecharge.com/search.php?s_keyword=editm...m[]=6&s_period=
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.