Setting fields to readonly in UI based upon conditions

I tackled this a different way (in 9.05). I used the customization rule
wizard, added a new "custom condition" on one field, then two rule
actions to disable to another two fields I wanted to control. The rule
wizard created a bunch of code for me, and I just modified one function
to return true/false to disable/enable those fields based on some data
in the first field. Works smoothly.



A bit of the final code looks like this... the rule wizard created the
first line, I added the next couple:



private static bool
OrderHedCustomerCustIDGENER_CustomRuleCondition(object Arg1, object
Arg2)

{

string custid = Arg1.ToString();

if (custid .StartsWith("GENER")) {

etc





Brian.



________________________________

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of ksimon8fw
Sent: Thursday, March 10, 2011 10:54 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Setting fields to readonly in UI based upon
conditions





I'm not exactly sure what I'm doing wrong. I know how to set fields to
readonly using the extended properties. HOwever, I'm trying to set
fields to readonly based upon conditions in the code. I've got an
"epiviewnotification" call which executes the following code:

Private Sub SetLineReadonly()
Dim edvDtl As EpiDataView =
CType(oTrans.EpiDataViews("OrderDtl"),EpiDataView)
edvDtl.dataView.Table.Columns("Reference").ExtendedProperties("ReadOnly"
) = True
edvDtl.dataView.Table.Columns("POLineRef").ExtendedProperties("ReadOnly"
) = True
End Sub

I've put some message boxes in this sub, and have verified that it's
getting called.

I copy/pasted these lines into a "setextendedprops" sub that gets called
on the initialization, and that sets them to readonly (all the time).
It's just when I try to conditionally call this, it doesn't seem to set
the fields to readonly.

Anybody see what I'm doing wrong?

Thanks,
Kevin Simon





[Non-text portions of this message have been removed]
I'm not exactly sure what I'm doing wrong. I know how to set fields to readonly using the extended properties. HOwever, I'm trying to set fields to readonly based upon conditions in the code. I've got an "epiviewnotification" call which executes the following code:

Private Sub SetLineReadonly()
Dim edvDtl As EpiDataView = CType(oTrans.EpiDataViews("OrderDtl"),EpiDataView)
edvDtl.dataView.Table.Columns("Reference").ExtendedProperties("ReadOnly") = True
edvDtl.dataView.Table.Columns("POLineRef").ExtendedProperties("ReadOnly") = True
End Sub


I've put some message boxes in this sub, and have verified that it's getting called.

I copy/pasted these lines into a "setextendedprops" sub that gets called on the initialization, and that sets them to readonly (all the time). It's just when I try to conditionally call this, it doesn't seem to set the fields to readonly.

Anybody see what I'm doing wrong?

Thanks,
Kevin Simon