Column list and value list (OpenInsight Specific)
At 07 FEB 2001 04:10:16PM a becker wrote:
This problem is probably something simple but it has me puzzled.
Whenever an estimate is written, the write script writes a billing record for that estimate and inserts the estimate amount and the revision number. This has caused no problems since it was first coded about 2 months ago.
Today, it was decided that the write script should also write the type of estimate (media type). Media is the 1st field in the billing record and is also on the estimate file. The estimate and revision is field 4 and 5 respectfully.
To accomplish this, I figured just put in the media at the front and the appropriate field marks and we're in business. Wrong!!! I obtained the media type using get_property (the same as obtained the estimate and revision). Using debug, I found that the columnvaluelist did not have the media (this can be TV, Radio, Out-of-home and Print). The estimate and revision is numeric, the media is not. I then used the quote command on the media and it was then in the columnvaluelist. However, when I write the record using the write_column, it is not in the @record.
I even tried puting a field mark before the media and leaving 2 field marks between the media and estimate. Same result. The revision and amount is fine, it's where it should be.
Seems to me it should be there, what I am doing wrong?
The following is copied directly from the script:
column_list=MEDIA":@FM:@FM:@FM:"EST_PER_BILLING":@FM:"BILL_REVISION_NUMBER"
columnvaluelist=QUOTE(med):@fm:@fm:@fm:est_amount:@fm:rev
WRITE_COLUMN("BILLING_SUMM",bill_key, column_list, columnvaluelist,2)
Yes I know I can make it a symbolic field, but because there can be many estimates and only the last revision is the active estimate, it was impractical to make it a symbolic. There can only be one billing record, with a table containing the individual billings.
Any ideas???
Thanks
Andy
At 07 FEB 2001 06:49PM Scott, LMS wrote:
Hi Andy
Hmm puzzles again.
I am thinking that what ever method you used to get the media from the form may not be quite right. Or maybe that the Media control on the form is not associated with the database, or that the name of the Media field is spelled differently in the table definition.
For instance if you have check boxes or radio buttons for the media type then the "TEXT" property will not retrieve your required value. You will need to get the "VALUE" property or maybe the "CHECK" property (but that will get you a Yes (1) or a No (0) which doesn't meet your need either).
So if there is nothing in the first field of the columnvaluelist, I would suspect there is nothing in the "med" field.
What kind of control on the form (I am assuming there is a form) have you used for media?
Is it bound to the associated table? (Do you have anything in the database association for that table column or control?) - As far as I know this is how information gets into @RECORD
Is the MEDIA field on the table, text or numeric?
From the help on WRITE_COLUMN, it cares more that you have correctly spelt the field name in your column list than what position it is in. I would be inclined to this form of the code
* this structure allows you to add new columns
* and reorder them easily.
* this bit has to be at the very top of your code,
* otherwise just use regular assignments (eg media_idx=1)
equate media_idx$ to 1
equate bill_idx$ to 2
equate rev_idx$ to 3
* these bits can go where ever they are appropriate
Column_List='
Column_List=MEDIA"
* this is the exact same name you see in Tablebuilder?
* you could try using 1 instead of "MEDIA" if it is the first field
* on the table
Column_List = "EST_PER_BILLING"
Column_List = "BILL_REVISION_NUMBER"
* this bit goes after you have retrieved
* the values for med, est_amount and rev
ColumnValuelist='
ColumnValuelist=Quote(med)
* only works if med contains your value
ColumnValuelist=est_amount
ColumnValuelist=rev
I have no idea if the above is any use to you Andy, but I thought it worth a shot.
Scott, LMS
At 08 FEB 2001 03:04PM a becker wrote:
Scott
Your idea partially worked.
I ended up doing 2 write_columns - 1 for the media by itself, the other for the amount and revision.
Thanks for your help.
Andy