Página 1 de 1

Displaying fields in a DBBrowse object from two related tables

Publicado: Mié Jun 17, 2009 10:19 pm
por g.s.rogers
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

Displaying fields in a DBBrowse object from two related tables

Publicado: Jue Jun 18, 2009 9:51 pm
por g.s.rogers
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

Displaying fields in a DBBrowse object from two related tables

Publicado: Jue Jun 18, 2009 9:51 pm
por g.s.rogers
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

Displaying fields in a DBBrowse object from two related tables

Publicado: Vie Jun 19, 2009 7:57 pm
por g.s.rogers
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
>

Displaying fields in a DBBrowse object from two related tables

Publicado: Vie Jun 19, 2009 7:57 pm
por g.s.rogers
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
>

Displaying fields in a DBBrowse object from two related tables

Publicado: Lun Jun 22, 2009 10:54 am
por ignacio
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
>>
>
>

Displaying fields in a DBBrowse object from two related tables

Publicado: Lun Jun 22, 2009 10:54 am
por ignacio
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
>>
>
>