CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Accessing fields not in form

Print topic Send  topic

Author Message
j9
Posted: 08/18/2004, 9:57 AM

I have a table with fld1, fld 2, fld3. Only two of these are in my form, though the entire table (all columns) are my form's data source.

I am trying to do an After Execute Update custom function, which needs fld3 (the one not on the form).

In custom code I have the line:
print $myform->$ds->f("fld3");

The retruned value is null. I know the value is NOT null (fld3 is in my URL parameter string).

What is wrong with my syntax? I know I can get fld3 from the URL, but I am trying to write a more universal function, so I really need to be using the data source. Ideas?

Thanks!
j9
j9
Posted: 08/18/2004, 10:01 AM

oops, I meant $myform->ds->f("fld3");
Damian
Posted: 08/18/2004, 5:55 PM

Try inserting the field into your tabel and then making it a hidden field.
Then you can reference it from wherever.

"j9" <j9@forum.codecharge> wrote in message
news:541238b5e00b25@news.codecharge.com...
> oops, I meant $myform->ds->f("fld3");
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

Karsten
Posted: 08/25/2004, 10:41 AM

Making it a hidden field... but what if the data would be security sensitive
like for example an activation key in my case or an automatic generated password?

there must be another solution for this if not it should be implemented in CCS

in my opinion its not a elegant style using hidden fields....
i figured around in the code and tryed around with custom insert property of the record.But due the lack of documentation and about for example the cp["fieldname"] data in the generated source and much other things i dont go on one step forward with this "RAD" tool

Question1: how to access a field from the datasource, update its value so it will be inserted along the insertoperation of the form?
Note: the field is not on the form as a Control or as hidden field because of security reasons.

Question2: why does the CCS generated code not use all fields in the datasource, it just using the ones that exist as a control on the form?
for example: if you have a field "field1" in the table and it dont exist as control on the form you cannot access its value even if the datasource is "tabel" and uses all fields in the table (SELECT * from table)


any solution for this standard programming needs?
Damian
Posted: 08/25/2004, 7:26 PM

CCS is a tool to help you write code quickly. It doesnt promise that it will
do everything for you.

You can add your own code quite easily.

You can run queries on all data fields, whether they are displayed or not,
but I dont think you can pass them if they are not in the grid.

As to your example - you are printing it, so how sensitive can it be?


"Karsten" <Karsten@forum.codecharge> wrote in message
news:5412ccf64c29db@news.codecharge.com...
> Making it a hidden field... but what if the data would be security
sensitive
> like for example an activation key in my case or an automatic generated
> password?
>
> there must be another solution for this if not it should be implemented in
CCS
>
> in my opinion its not a elegant style using hidden fields....
> i figured around in the code and tryed around with custom insert property
of
> the record.But due the lack of documentation and about for example the
> cp["fieldname"] data in the generated source and much other things i dont
go on
> one step forward with this "RAD" tool
>
> Question1: how to access a field from the datasource, update its value so
it
> will be inserted along the insertoperation of the form?
> Note: the field is not on the form as a Control or as hidden field because
of
> security reasons.
>
> Question2: why does the CCS generated code not use all fields in the
> datasource, it just using the ones that exist as a control on the form?
> for example: if you have a field "field1" in the table and it dont exist
as
> control on the form you cannot access its value even if the datasource is
> "tabel" and uses all fields in the table (SELECT * from table)
>
>
> any solution for this standard programming needs?
>
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

Don Safar
Posted: 08/26/2004, 8:51 AM

Open query builder, make sure the field is checked in the table. You do not
have to use hidden field. You can access the field from the data source.
Press F1 in ccs for help and type in db->f.

There is really a lot of information in the help file. You can save yourself
a lot of time by looking there first, then searching the forums before
posting your question and waiting on an answer.

"Karsten" <Karsten@forum.codecharge> wrote in message
news:5412ccf64c29db@news.codecharge.com...
> Making it a hidden field... but what if the data would be security
sensitive
> like for example an activation key in my case or an automatic generated
> password?
>
> there must be another solution for this if not it should be implemented in
CCS
>
> in my opinion its not a elegant style using hidden fields....
> i figured around in the code and tryed around with custom insert property
of
> the record.But due the lack of documentation and about for example the
> cp["fieldname"] data in the generated source and much other things i dont
go on
> one step forward with this "RAD" tool
>
> Question1: how to access a field from the datasource, update its value so
it
> will be inserted along the insertoperation of the form?
> Note: the field is not on the form as a Control or as hidden field because
of
> security reasons.
>
> Question2: why does the CCS generated code not use all fields in the
> datasource, it just using the ones that exist as a control on the form?
> for example: if you have a field "field1" in the table and it dont exist
as
> control on the form you cannot access its value even if the datasource is
> "tabel" and uses all fields in the table (SELECT * from table)
>
>
> any solution for this standard programming needs?
>
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

SteveG

Posts: 56
Posted: 02/25/2005, 5:18 PM

I'm with j9 on this one, there's incredibly little on how to custom update field if the goal is to keep it hidden. There isn't much either on how to modify custom update SQL's so as to safely add the update fields to it.

- Steve
View profile  Send private message
RonB

Posts: 228
Posted: 03/01/2005, 9:59 AM

If you aproach the problem from the beginning you can state a few things as fact :
1. You want to update a field that is not present => conclusion get the field.
2. in order to get the field you can do two things: aproach the dataset(ds) or make a trip to the database and get the field.
3. if the ds does not give you what you want you have to go to the database. Presumably you could get last insert id to get the primary key for the record you updated. Having the last insert id gives you the where section of the sql statement to get what you want from the database. do a GetDBValue() and use the insert id to get fld3 from the recird that just got updated. Now you can use it in whatever fashion you want.

It's aworkaround but in principle should work. Havent tried it myself...just thinking out loud:-)

Ron
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.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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