>>Hi everybody,
>>
>>I have a junction table that is supposed to have
>>
>>OptionID MakeID ModelID and some price fields.
>>
>>I have one OptionID and one MakeID selected and I can have multiple ModelID selected.
>>
>>I want to have a view (or CA) which would have records for each of them, e.g.
>>
>>selOptionID selMakeID selModelID1 Price fields
>>selOptionID selMakeID selModelID2 Price fields
>>
>>
>>If I already have a record in my table, I want to retrieve it, otherwise prepare a record to fill.
>>
>>Also I want to be able to cancel at any moment and therefore new records would not be added.
>>
>>I'm not sure how to construct such view or CA.
>>
>>Any ideas?
>>
>>Thanks in advance.
>
>
>*** SelectCmd
>
>SELECT * (or field list)
> FROM YourTable
>WHERE OptionID = ?m.selOptionID AND
> MakeId = ?m.selMakeID AND
> ModelId IN (?m.lnModel1, ?m.lnModel2, ?m.lnModel3...?m.lnModelN)
>
Here I don't know how many models I select. How can I make this dynamic?
I haven't checked the max number, but may be ~100 Models at most.
>*** AfterCursorFill and AfterCursorRefresh() events
>IF lResult
> this.CheckForRecors()
>ENDIF
>
>*** CheckForRecors method of the CA
>IF RECCOUNT(this.Alias) == 0
> APPEND BLANK IN (this.Alias)
>ENDIF
>
We need a record for each passed ModelID, not just one.
>Of course it should be table buffered and you always can have TABLEREVERT() when you don't want to store record.
>That is VERY rough example, but you know what I mean :-)
Thanks again.
If it's not broken, fix it until it is.
My Blog