RETURN me.currentrow.item("orderpo")
seems to give me exactly what I want (I was trying something like that in the watch window earlier with me.currentview.item("orderpo") but of course now I see why that wouldn't work)
Found the right syntax by just searching around here on all the message re custom properties
This framework, this forum and this community ROCKS !!
I did get my two custom props (the cust_lastname in the tutorial and my new prop) into an array properly. ( I rewrote my proc to pull the most recent order as creditcard is a varchar(max) and may be encrypted and I just wanted to simplify)
My new prop is Orderpo but my problem is in the GET SET
Return orderpo
End GetEnd Property
I get a warning that variable orderpo is used before it has been assigned a value and that may result in a null ref exception at runtime
If i use me.orderpo (which is available through intellisense) I get an error 'Expression recursivelyh calls the containing property'
Obviously I'm missing something.
Return
Sorry, it should be:
Your custom field property should return a value and in your code the cardnumber has not value. Modify the Return value to return the calculated field as follow:
I left joined credit cards to customers ( handling nulls and returning "NO CARD ON FILE") so there is a cardnumber field being returned in the cursor that I get with the stored proc
At debug time in me.customersbo1.currentview I can see the cardnumber column with data.
I looked in BO mapper and there doesn't look to be anyplace there to fake the BO into created a property (probably just as well as I assume it could not be updateable) Thought a custom field prop would be the way to go but
<Browsable(
BusinessFieldDisplayInEditor(), _
Description(
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
Return Cardnumber gets the error that it must be declared - but I'm not sure what the syntax is to tell it the field will be in the cursor at runtime
( I do realize that if I add a custom prop in this way I will probably need to always be sure it is provided in each data access scenario. Does that mean I should be creating a view on the back end so the field is present in the definition when the bizobj is mapped? No problem, if that's the case but wanted to make sure there wasn't another trick I was missing as I might want to display something like this without having to create an updateable view on the back end)
TIA
Charles