A DBBrowse object is linked with one dataset.
The datacontrols.htm discusses constructing a calculated field.
I have one table (and thus a dataset) that has attorney information records,
which includes the attorney's name (CAATTRNY.DBF)
I have another table, related to the first through a unique identifier, that
has records that link that attorney to assigned cases. This table does not
have the attorney's name, just a pointer to the attorney's record in the
first table (CAASATT.DBF).
On the case screen, I want to put a DBBrowse object showing attorneys
assigned to that case by name.
My question is how to best accomplish this.
Should I add a calculated field to the dataset of assigned attorneys to show
the NAME field from the first dataset? If so, could you give me the proper
syntax? The sample documentation shows how to create a calculated field by
combining fields from the same dataset. In this case, I would be adding a
field from a different dataset.
In my Clipper app, I simply related the two tables and referenced the fully
qualified field name in the column of the TBrowse. I am guessing I could
scope the CAATTRNY dataset based upon the selected record in the CAASATT
dataset and then attach the DBBrowse object to the CAATTRNY dataset.
So, would either method work? Which is best or easiest?
TIA,
Gary
In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.
Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.
Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.
Displaying fields in a DBBrowse object from two related tables
-
- Mensajes: 202
- Registrado: Dom Feb 17, 2008 3:35 am
-
- Mensajes: 202
- Registrado: Dom Feb 17, 2008 3:35 am
Displaying fields in a DBBrowse object from two related tables
I guess it would be clearer to ask:
Can a "calculated" field come from another dataset?
Thanks,
Gary
"Gary S. Rogers" <g.s.rogers@att.net> wrote in message
news:[email=4a394ff0@svctag-j7w3v3j....]4a394ff0@svctag-j7w3v3j....[/email]
>A DBBrowse object is linked with one dataset.
> The datacontrols.htm discusses constructing a calculated field.
>
> I have one table (and thus a dataset) that has attorney information
> records, which includes the attorney's name (CAATTRNY.DBF)
> I have another table, related to the first through a unique identifier,
> that has records that link that attorney to assigned cases. This table
> does not have the attorney's name, just a pointer to the attorney's record
> in the first table (CAASATT.DBF).
>
> On the case screen, I want to put a DBBrowse object showing attorneys
> assigned to that case by name.
>
> My question is how to best accomplish this.
>
> Should I add a calculated field to the dataset of assigned attorneys to
> show the NAME field from the first dataset? If so, could you give me the
> proper syntax? The sample documentation shows how to create a calculated
> field by combining fields from the same dataset. In this case, I would be
> adding a field from a different dataset.
>
> In my Clipper app, I simply related the two tables and referenced the
> fully qualified field name in the column of the TBrowse. I am guessing I
> could scope the CAATTRNY dataset based upon the selected record in the
> CAASATT dataset and then attach the DBBrowse object to the CAATTRNY
> dataset.
>
> So, would either method work? Which is best or easiest?
>
> TIA,
> Gary
Can a "calculated" field come from another dataset?
Thanks,
Gary
"Gary S. Rogers" <g.s.rogers@att.net> wrote in message
news:[email=4a394ff0@svctag-j7w3v3j....]4a394ff0@svctag-j7w3v3j....[/email]
>A DBBrowse object is linked with one dataset.
> The datacontrols.htm discusses constructing a calculated field.
>
> I have one table (and thus a dataset) that has attorney information
> records, which includes the attorney's name (CAATTRNY.DBF)
> I have another table, related to the first through a unique identifier,
> that has records that link that attorney to assigned cases. This table
> does not have the attorney's name, just a pointer to the attorney's record
> in the first table (CAASATT.DBF).
>
> On the case screen, I want to put a DBBrowse object showing attorneys
> assigned to that case by name.
>
> My question is how to best accomplish this.
>
> Should I add a calculated field to the dataset of assigned attorneys to
> show the NAME field from the first dataset? If so, could you give me the
> proper syntax? The sample documentation shows how to create a calculated
> field by combining fields from the same dataset. In this case, I would be
> adding a field from a different dataset.
>
> In my Clipper app, I simply related the two tables and referenced the
> fully qualified field name in the column of the TBrowse. I am guessing I
> could scope the CAATTRNY dataset based upon the selected record in the
> CAASATT dataset and then attach the DBBrowse object to the CAATTRNY
> dataset.
>
> So, would either method work? Which is best or easiest?
>
> TIA,
> Gary
-
- Mensajes: 202
- Registrado: Dom Feb 17, 2008 3:35 am
Displaying fields in a DBBrowse object from two related tables
I guess it would be clearer to ask:
Can a "calculated" field come from another dataset?
Thanks,
Gary
"Gary S. Rogers" <g.s.rogers@att.net> wrote in message
news:[email=4a394ff0@svctag-j7w3v3j....]4a394ff0@svctag-j7w3v3j....[/email]
>A DBBrowse object is linked with one dataset.
> The datacontrols.htm discusses constructing a calculated field.
>
> I have one table (and thus a dataset) that has attorney information
> records, which includes the attorney's name (CAATTRNY.DBF)
> I have another table, related to the first through a unique identifier,
> that has records that link that attorney to assigned cases. This table
> does not have the attorney's name, just a pointer to the attorney's record
> in the first table (CAASATT.DBF).
>
> On the case screen, I want to put a DBBrowse object showing attorneys
> assigned to that case by name.
>
> My question is how to best accomplish this.
>
> Should I add a calculated field to the dataset of assigned attorneys to
> show the NAME field from the first dataset? If so, could you give me the
> proper syntax? The sample documentation shows how to create a calculated
> field by combining fields from the same dataset. In this case, I would be
> adding a field from a different dataset.
>
> In my Clipper app, I simply related the two tables and referenced the
> fully qualified field name in the column of the TBrowse. I am guessing I
> could scope the CAATTRNY dataset based upon the selected record in the
> CAASATT dataset and then attach the DBBrowse object to the CAATTRNY
> dataset.
>
> So, would either method work? Which is best or easiest?
>
> TIA,
> Gary
Can a "calculated" field come from another dataset?
Thanks,
Gary
"Gary S. Rogers" <g.s.rogers@att.net> wrote in message
news:[email=4a394ff0@svctag-j7w3v3j....]4a394ff0@svctag-j7w3v3j....[/email]
>A DBBrowse object is linked with one dataset.
> The datacontrols.htm discusses constructing a calculated field.
>
> I have one table (and thus a dataset) that has attorney information
> records, which includes the attorney's name (CAATTRNY.DBF)
> I have another table, related to the first through a unique identifier,
> that has records that link that attorney to assigned cases. This table
> does not have the attorney's name, just a pointer to the attorney's record
> in the first table (CAASATT.DBF).
>
> On the case screen, I want to put a DBBrowse object showing attorneys
> assigned to that case by name.
>
> My question is how to best accomplish this.
>
> Should I add a calculated field to the dataset of assigned attorneys to
> show the NAME field from the first dataset? If so, could you give me the
> proper syntax? The sample documentation shows how to create a calculated
> field by combining fields from the same dataset. In this case, I would be
> adding a field from a different dataset.
>
> In my Clipper app, I simply related the two tables and referenced the
> fully qualified field name in the column of the TBrowse. I am guessing I
> could scope the CAATTRNY dataset based upon the selected record in the
> CAASATT dataset and then attach the DBBrowse object to the CAATTRNY
> dataset.
>
> So, would either method work? Which is best or easiest?
>
> TIA,
> Gary
-
- Mensajes: 202
- Registrado: Dom Feb 17, 2008 3:35 am
Displaying fields in a DBBrowse object from two related tables
I found a way to do it.
The documentation on data controls shows the following example:
oDataSet:AddCalcField:( "FullName",;
{|oField| oField:DataSet:Name + ;
oField:DataSet:LastName }
Note that the last closing parenthesis is missing.
I found that the following adds a "calculated" field which comes from a
different open dataset:
oDataSet:AddCalcField("Name", { |oField| ::oDbfDataSet:Name })
In this example, oDbfDataSet:Name is a field called "Name" from a different
dataset.
If the first dataset is scoped and then related to the second dataset, then
the "calculated" field shows the correct related information for the record
in the first dataset.
Hope this helps someone attempting to do the same thing in their own app.
Gary
"Gary S. Rogers" <g.s.rogers@att.net> wrote in message
news:4a3a9ae0$[email=1@svctag-j7w3v3j....]1@svctag-j7w3v3j....[/email]
>I guess it would be clearer to ask:
>
> Can a "calculated" field come from another dataset?
>
> Thanks,
> Gary
>
>
>
> "Gary S. Rogers" <g.s.rogers@att.net> wrote in message
> news:[email=4a394ff0@svctag-j7w3v3j....]4a394ff0@svctag-j7w3v3j....[/email]
>>A DBBrowse object is linked with one dataset.
>> The datacontrols.htm discusses constructing a calculated field.
>>
>> I have one table (and thus a dataset) that has attorney information
>> records, which includes the attorney's name (CAATTRNY.DBF)
>> I have another table, related to the first through a unique identifier,
>> that has records that link that attorney to assigned cases. This table
>> does not have the attorney's name, just a pointer to the attorney's
>> record in the first table (CAASATT.DBF).
>>
>> On the case screen, I want to put a DBBrowse object showing attorneys
>> assigned to that case by name.
>>
>> My question is how to best accomplish this.
>>
>> Should I add a calculated field to the dataset of assigned attorneys to
>> show the NAME field from the first dataset? If so, could you give me the
>> proper syntax? The sample documentation shows how to create a calculated
>> field by combining fields from the same dataset. In this case, I would be
>> adding a field from a different dataset.
>>
>> In my Clipper app, I simply related the two tables and referenced the
>> fully qualified field name in the column of the TBrowse. I am guessing I
>> could scope the CAATTRNY dataset based upon the selected record in the
>> CAASATT dataset and then attach the DBBrowse object to the CAATTRNY
>> dataset.
>>
>> So, would either method work? Which is best or easiest?
>>
>> TIA,
>> Gary
>
The documentation on data controls shows the following example:
oDataSet:AddCalcField:( "FullName",;
{|oField| oField:DataSet:Name + ;
oField:DataSet:LastName }
Note that the last closing parenthesis is missing.
I found that the following adds a "calculated" field which comes from a
different open dataset:
oDataSet:AddCalcField("Name", { |oField| ::oDbfDataSet:Name })
In this example, oDbfDataSet:Name is a field called "Name" from a different
dataset.
If the first dataset is scoped and then related to the second dataset, then
the "calculated" field shows the correct related information for the record
in the first dataset.
Hope this helps someone attempting to do the same thing in their own app.
Gary
"Gary S. Rogers" <g.s.rogers@att.net> wrote in message
news:4a3a9ae0$[email=1@svctag-j7w3v3j....]1@svctag-j7w3v3j....[/email]
>I guess it would be clearer to ask:
>
> Can a "calculated" field come from another dataset?
>
> Thanks,
> Gary
>
>
>
> "Gary S. Rogers" <g.s.rogers@att.net> wrote in message
> news:[email=4a394ff0@svctag-j7w3v3j....]4a394ff0@svctag-j7w3v3j....[/email]
>>A DBBrowse object is linked with one dataset.
>> The datacontrols.htm discusses constructing a calculated field.
>>
>> I have one table (and thus a dataset) that has attorney information
>> records, which includes the attorney's name (CAATTRNY.DBF)
>> I have another table, related to the first through a unique identifier,
>> that has records that link that attorney to assigned cases. This table
>> does not have the attorney's name, just a pointer to the attorney's
>> record in the first table (CAASATT.DBF).
>>
>> On the case screen, I want to put a DBBrowse object showing attorneys
>> assigned to that case by name.
>>
>> My question is how to best accomplish this.
>>
>> Should I add a calculated field to the dataset of assigned attorneys to
>> show the NAME field from the first dataset? If so, could you give me the
>> proper syntax? The sample documentation shows how to create a calculated
>> field by combining fields from the same dataset. In this case, I would be
>> adding a field from a different dataset.
>>
>> In my Clipper app, I simply related the two tables and referenced the
>> fully qualified field name in the column of the TBrowse. I am guessing I
>> could scope the CAATTRNY dataset based upon the selected record in the
>> CAASATT dataset and then attach the DBBrowse object to the CAATTRNY
>> dataset.
>>
>> So, would either method work? Which is best or easiest?
>>
>> TIA,
>> Gary
>
-
- Mensajes: 202
- Registrado: Dom Feb 17, 2008 3:35 am
Displaying fields in a DBBrowse object from two related tables
I found a way to do it.
The documentation on data controls shows the following example:
oDataSet:AddCalcField:( "FullName",;
{|oField| oField:DataSet:Name + ;
oField:DataSet:LastName }
Note that the last closing parenthesis is missing.
I found that the following adds a "calculated" field which comes from a
different open dataset:
oDataSet:AddCalcField("Name", { |oField| ::oDbfDataSet:Name })
In this example, oDbfDataSet:Name is a field called "Name" from a different
dataset.
If the first dataset is scoped and then related to the second dataset, then
the "calculated" field shows the correct related information for the record
in the first dataset.
Hope this helps someone attempting to do the same thing in their own app.
Gary
"Gary S. Rogers" <g.s.rogers@att.net> wrote in message
news:4a3a9ae0$[email=1@svctag-j7w3v3j....]1@svctag-j7w3v3j....[/email]
>I guess it would be clearer to ask:
>
> Can a "calculated" field come from another dataset?
>
> Thanks,
> Gary
>
>
>
> "Gary S. Rogers" <g.s.rogers@att.net> wrote in message
> news:[email=4a394ff0@svctag-j7w3v3j....]4a394ff0@svctag-j7w3v3j....[/email]
>>A DBBrowse object is linked with one dataset.
>> The datacontrols.htm discusses constructing a calculated field.
>>
>> I have one table (and thus a dataset) that has attorney information
>> records, which includes the attorney's name (CAATTRNY.DBF)
>> I have another table, related to the first through a unique identifier,
>> that has records that link that attorney to assigned cases. This table
>> does not have the attorney's name, just a pointer to the attorney's
>> record in the first table (CAASATT.DBF).
>>
>> On the case screen, I want to put a DBBrowse object showing attorneys
>> assigned to that case by name.
>>
>> My question is how to best accomplish this.
>>
>> Should I add a calculated field to the dataset of assigned attorneys to
>> show the NAME field from the first dataset? If so, could you give me the
>> proper syntax? The sample documentation shows how to create a calculated
>> field by combining fields from the same dataset. In this case, I would be
>> adding a field from a different dataset.
>>
>> In my Clipper app, I simply related the two tables and referenced the
>> fully qualified field name in the column of the TBrowse. I am guessing I
>> could scope the CAATTRNY dataset based upon the selected record in the
>> CAASATT dataset and then attach the DBBrowse object to the CAATTRNY
>> dataset.
>>
>> So, would either method work? Which is best or easiest?
>>
>> TIA,
>> Gary
>
The documentation on data controls shows the following example:
oDataSet:AddCalcField:( "FullName",;
{|oField| oField:DataSet:Name + ;
oField:DataSet:LastName }
Note that the last closing parenthesis is missing.
I found that the following adds a "calculated" field which comes from a
different open dataset:
oDataSet:AddCalcField("Name", { |oField| ::oDbfDataSet:Name })
In this example, oDbfDataSet:Name is a field called "Name" from a different
dataset.
If the first dataset is scoped and then related to the second dataset, then
the "calculated" field shows the correct related information for the record
in the first dataset.
Hope this helps someone attempting to do the same thing in their own app.
Gary
"Gary S. Rogers" <g.s.rogers@att.net> wrote in message
news:4a3a9ae0$[email=1@svctag-j7w3v3j....]1@svctag-j7w3v3j....[/email]
>I guess it would be clearer to ask:
>
> Can a "calculated" field come from another dataset?
>
> Thanks,
> Gary
>
>
>
> "Gary S. Rogers" <g.s.rogers@att.net> wrote in message
> news:[email=4a394ff0@svctag-j7w3v3j....]4a394ff0@svctag-j7w3v3j....[/email]
>>A DBBrowse object is linked with one dataset.
>> The datacontrols.htm discusses constructing a calculated field.
>>
>> I have one table (and thus a dataset) that has attorney information
>> records, which includes the attorney's name (CAATTRNY.DBF)
>> I have another table, related to the first through a unique identifier,
>> that has records that link that attorney to assigned cases. This table
>> does not have the attorney's name, just a pointer to the attorney's
>> record in the first table (CAASATT.DBF).
>>
>> On the case screen, I want to put a DBBrowse object showing attorneys
>> assigned to that case by name.
>>
>> My question is how to best accomplish this.
>>
>> Should I add a calculated field to the dataset of assigned attorneys to
>> show the NAME field from the first dataset? If so, could you give me the
>> proper syntax? The sample documentation shows how to create a calculated
>> field by combining fields from the same dataset. In this case, I would be
>> adding a field from a different dataset.
>>
>> In my Clipper app, I simply related the two tables and referenced the
>> fully qualified field name in the column of the TBrowse. I am guessing I
>> could scope the CAATTRNY dataset based upon the selected record in the
>> CAASATT dataset and then attach the DBBrowse object to the CAATTRNY
>> dataset.
>>
>> So, would either method work? Which is best or easiest?
>>
>> TIA,
>> Gary
>
- ignacio
- Site Admin
- Mensajes: 9469
- Registrado: Lun Abr 06, 2015 8:00 pm
- Ubicación: Madrid, Spain
- Contactar:
Displaying fields in a DBBrowse object from two related tables
Gary,
Yes you can, at least on read-only mode. But you should create a relation
between the two datasets, or call a function inside the calculated field
that do the trick.
Regards,
--
Ignacio Ortiz de Zúñiga
Xailer support / Soporte de Xailer
http://www.xailer.com
http://www.xailer.info
"Gary S. Rogers" <g.s.rogers@att.net> escribió en el mensaje
news:[email=4a3bd1b8@svctag-j7w3v3j....]4a3bd1b8@svctag-j7w3v3j....[/email]
>I found a way to do it.
>
> The documentation on data controls shows the following example:
>
> oDataSet:AddCalcField:( "FullName",;
> {|oField| oField:DataSet:Name + ;
> oField:DataSet:LastName }
>
> Note that the last closing parenthesis is missing.
>
> I found that the following adds a "calculated" field which comes from a
> different open dataset:
>
> oDataSet:AddCalcField("Name", { |oField| ::oDbfDataSet:Name })
>
> In this example, oDbfDataSet:Name is a field called "Name" from a
> different dataset.
>
> If the first dataset is scoped and then related to the second dataset,
> then the "calculated" field shows the correct related information for the
> record in the first dataset.
>
> Hope this helps someone attempting to do the same thing in their own app.
>
> Gary
>
>
>
> "Gary S. Rogers" <g.s.rogers@att.net> wrote in message
> news:4a3a9ae0$[email=1@svctag-j7w3v3j....]1@svctag-j7w3v3j....[/email]
>>I guess it would be clearer to ask:
>>
>> Can a "calculated" field come from another dataset?
>>
>> Thanks,
>> Gary
>>
>>
>>
>> "Gary S. Rogers" <g.s.rogers@att.net> wrote in message
>> news:[email=4a394ff0@svctag-j7w3v3j....]4a394ff0@svctag-j7w3v3j....[/email]
>>>A DBBrowse object is linked with one dataset.
>>> The datacontrols.htm discusses constructing a calculated field.
>>>
>>> I have one table (and thus a dataset) that has attorney information
>>> records, which includes the attorney's name (CAATTRNY.DBF)
>>> I have another table, related to the first through a unique identifier,
>>> that has records that link that attorney to assigned cases. This table
>>> does not have the attorney's name, just a pointer to the attorney's
>>> record in the first table (CAASATT.DBF).
>>>
>>> On the case screen, I want to put a DBBrowse object showing attorneys
>>> assigned to that case by name.
>>>
>>> My question is how to best accomplish this.
>>>
>>> Should I add a calculated field to the dataset of assigned attorneys to
>>> show the NAME field from the first dataset? If so, could you give me the
>>> proper syntax? The sample documentation shows how to create a calculated
>>> field by combining fields from the same dataset. In this case, I would
>>> be adding a field from a different dataset.
>>>
>>> In my Clipper app, I simply related the two tables and referenced the
>>> fully qualified field name in the column of the TBrowse. I am guessing I
>>> could scope the CAATTRNY dataset based upon the selected record in the
>>> CAASATT dataset and then attach the DBBrowse object to the CAATTRNY
>>> dataset.
>>>
>>> So, would either method work? Which is best or easiest?
>>>
>>> TIA,
>>> Gary
>>
>
>
Yes you can, at least on read-only mode. But you should create a relation
between the two datasets, or call a function inside the calculated field
that do the trick.
Regards,
--
Ignacio Ortiz de Zúñiga
Xailer support / Soporte de Xailer
http://www.xailer.com
http://www.xailer.info
"Gary S. Rogers" <g.s.rogers@att.net> escribió en el mensaje
news:[email=4a3bd1b8@svctag-j7w3v3j....]4a3bd1b8@svctag-j7w3v3j....[/email]
>I found a way to do it.
>
> The documentation on data controls shows the following example:
>
> oDataSet:AddCalcField:( "FullName",;
> {|oField| oField:DataSet:Name + ;
> oField:DataSet:LastName }
>
> Note that the last closing parenthesis is missing.
>
> I found that the following adds a "calculated" field which comes from a
> different open dataset:
>
> oDataSet:AddCalcField("Name", { |oField| ::oDbfDataSet:Name })
>
> In this example, oDbfDataSet:Name is a field called "Name" from a
> different dataset.
>
> If the first dataset is scoped and then related to the second dataset,
> then the "calculated" field shows the correct related information for the
> record in the first dataset.
>
> Hope this helps someone attempting to do the same thing in their own app.
>
> Gary
>
>
>
> "Gary S. Rogers" <g.s.rogers@att.net> wrote in message
> news:4a3a9ae0$[email=1@svctag-j7w3v3j....]1@svctag-j7w3v3j....[/email]
>>I guess it would be clearer to ask:
>>
>> Can a "calculated" field come from another dataset?
>>
>> Thanks,
>> Gary
>>
>>
>>
>> "Gary S. Rogers" <g.s.rogers@att.net> wrote in message
>> news:[email=4a394ff0@svctag-j7w3v3j....]4a394ff0@svctag-j7w3v3j....[/email]
>>>A DBBrowse object is linked with one dataset.
>>> The datacontrols.htm discusses constructing a calculated field.
>>>
>>> I have one table (and thus a dataset) that has attorney information
>>> records, which includes the attorney's name (CAATTRNY.DBF)
>>> I have another table, related to the first through a unique identifier,
>>> that has records that link that attorney to assigned cases. This table
>>> does not have the attorney's name, just a pointer to the attorney's
>>> record in the first table (CAASATT.DBF).
>>>
>>> On the case screen, I want to put a DBBrowse object showing attorneys
>>> assigned to that case by name.
>>>
>>> My question is how to best accomplish this.
>>>
>>> Should I add a calculated field to the dataset of assigned attorneys to
>>> show the NAME field from the first dataset? If so, could you give me the
>>> proper syntax? The sample documentation shows how to create a calculated
>>> field by combining fields from the same dataset. In this case, I would
>>> be adding a field from a different dataset.
>>>
>>> In my Clipper app, I simply related the two tables and referenced the
>>> fully qualified field name in the column of the TBrowse. I am guessing I
>>> could scope the CAATTRNY dataset based upon the selected record in the
>>> CAASATT dataset and then attach the DBBrowse object to the CAATTRNY
>>> dataset.
>>>
>>> So, would either method work? Which is best or easiest?
>>>
>>> TIA,
>>> Gary
>>
>
>
Ignacio Ortiz de Zúñiga
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
- ignacio
- Site Admin
- Mensajes: 9469
- Registrado: Lun Abr 06, 2015 8:00 pm
- Ubicación: Madrid, Spain
- Contactar:
Displaying fields in a DBBrowse object from two related tables
Gary,
Yes you can, at least on read-only mode. But you should create a relation
between the two datasets, or call a function inside the calculated field
that do the trick.
Regards,
--
Ignacio Ortiz de Zúñiga
Xailer support / Soporte de Xailer
http://www.xailer.com
http://www.xailer.info
"Gary S. Rogers" <g.s.rogers@att.net> escribió en el mensaje
news:[email=4a3bd1b8@svctag-j7w3v3j....]4a3bd1b8@svctag-j7w3v3j....[/email]
>I found a way to do it.
>
> The documentation on data controls shows the following example:
>
> oDataSet:AddCalcField:( "FullName",;
> {|oField| oField:DataSet:Name + ;
> oField:DataSet:LastName }
>
> Note that the last closing parenthesis is missing.
>
> I found that the following adds a "calculated" field which comes from a
> different open dataset:
>
> oDataSet:AddCalcField("Name", { |oField| ::oDbfDataSet:Name })
>
> In this example, oDbfDataSet:Name is a field called "Name" from a
> different dataset.
>
> If the first dataset is scoped and then related to the second dataset,
> then the "calculated" field shows the correct related information for the
> record in the first dataset.
>
> Hope this helps someone attempting to do the same thing in their own app.
>
> Gary
>
>
>
> "Gary S. Rogers" <g.s.rogers@att.net> wrote in message
> news:4a3a9ae0$[email=1@svctag-j7w3v3j....]1@svctag-j7w3v3j....[/email]
>>I guess it would be clearer to ask:
>>
>> Can a "calculated" field come from another dataset?
>>
>> Thanks,
>> Gary
>>
>>
>>
>> "Gary S. Rogers" <g.s.rogers@att.net> wrote in message
>> news:[email=4a394ff0@svctag-j7w3v3j....]4a394ff0@svctag-j7w3v3j....[/email]
>>>A DBBrowse object is linked with one dataset.
>>> The datacontrols.htm discusses constructing a calculated field.
>>>
>>> I have one table (and thus a dataset) that has attorney information
>>> records, which includes the attorney's name (CAATTRNY.DBF)
>>> I have another table, related to the first through a unique identifier,
>>> that has records that link that attorney to assigned cases. This table
>>> does not have the attorney's name, just a pointer to the attorney's
>>> record in the first table (CAASATT.DBF).
>>>
>>> On the case screen, I want to put a DBBrowse object showing attorneys
>>> assigned to that case by name.
>>>
>>> My question is how to best accomplish this.
>>>
>>> Should I add a calculated field to the dataset of assigned attorneys to
>>> show the NAME field from the first dataset? If so, could you give me the
>>> proper syntax? The sample documentation shows how to create a calculated
>>> field by combining fields from the same dataset. In this case, I would
>>> be adding a field from a different dataset.
>>>
>>> In my Clipper app, I simply related the two tables and referenced the
>>> fully qualified field name in the column of the TBrowse. I am guessing I
>>> could scope the CAATTRNY dataset based upon the selected record in the
>>> CAASATT dataset and then attach the DBBrowse object to the CAATTRNY
>>> dataset.
>>>
>>> So, would either method work? Which is best or easiest?
>>>
>>> TIA,
>>> Gary
>>
>
>
Yes you can, at least on read-only mode. But you should create a relation
between the two datasets, or call a function inside the calculated field
that do the trick.
Regards,
--
Ignacio Ortiz de Zúñiga
Xailer support / Soporte de Xailer
http://www.xailer.com
http://www.xailer.info
"Gary S. Rogers" <g.s.rogers@att.net> escribió en el mensaje
news:[email=4a3bd1b8@svctag-j7w3v3j....]4a3bd1b8@svctag-j7w3v3j....[/email]
>I found a way to do it.
>
> The documentation on data controls shows the following example:
>
> oDataSet:AddCalcField:( "FullName",;
> {|oField| oField:DataSet:Name + ;
> oField:DataSet:LastName }
>
> Note that the last closing parenthesis is missing.
>
> I found that the following adds a "calculated" field which comes from a
> different open dataset:
>
> oDataSet:AddCalcField("Name", { |oField| ::oDbfDataSet:Name })
>
> In this example, oDbfDataSet:Name is a field called "Name" from a
> different dataset.
>
> If the first dataset is scoped and then related to the second dataset,
> then the "calculated" field shows the correct related information for the
> record in the first dataset.
>
> Hope this helps someone attempting to do the same thing in their own app.
>
> Gary
>
>
>
> "Gary S. Rogers" <g.s.rogers@att.net> wrote in message
> news:4a3a9ae0$[email=1@svctag-j7w3v3j....]1@svctag-j7w3v3j....[/email]
>>I guess it would be clearer to ask:
>>
>> Can a "calculated" field come from another dataset?
>>
>> Thanks,
>> Gary
>>
>>
>>
>> "Gary S. Rogers" <g.s.rogers@att.net> wrote in message
>> news:[email=4a394ff0@svctag-j7w3v3j....]4a394ff0@svctag-j7w3v3j....[/email]
>>>A DBBrowse object is linked with one dataset.
>>> The datacontrols.htm discusses constructing a calculated field.
>>>
>>> I have one table (and thus a dataset) that has attorney information
>>> records, which includes the attorney's name (CAATTRNY.DBF)
>>> I have another table, related to the first through a unique identifier,
>>> that has records that link that attorney to assigned cases. This table
>>> does not have the attorney's name, just a pointer to the attorney's
>>> record in the first table (CAASATT.DBF).
>>>
>>> On the case screen, I want to put a DBBrowse object showing attorneys
>>> assigned to that case by name.
>>>
>>> My question is how to best accomplish this.
>>>
>>> Should I add a calculated field to the dataset of assigned attorneys to
>>> show the NAME field from the first dataset? If so, could you give me the
>>> proper syntax? The sample documentation shows how to create a calculated
>>> field by combining fields from the same dataset. In this case, I would
>>> be adding a field from a different dataset.
>>>
>>> In my Clipper app, I simply related the two tables and referenced the
>>> fully qualified field name in the column of the TBrowse. I am guessing I
>>> could scope the CAATTRNY dataset based upon the selected record in the
>>> CAASATT dataset and then attach the DBBrowse object to the CAATTRNY
>>> dataset.
>>>
>>> So, would either method work? Which is best or easiest?
>>>
>>> TIA,
>>> Gary
>>
>
>
Ignacio Ortiz de Zúñiga
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com