Unable to lock UDFs
MIcrotoolmaker
When UDF is on main form or new folder I can lock these fields, and I do. But, I don't see under right click menu an option to lock the UDFs in the normal UDF viewing area (as in ctrl+shift+U). Is it still possible to lock these? (even by code?) I save manufacturing design specifications that I'd like to protect.Thank you
Paolo Manfrin
Hi,This can be done via code.
Similar to:
[CODE]
try {
Item.GetFromUID(pVal.Form.UDFForm , "U_SWA_CT_PartPer").Enabled = false;
}
catch (Exception ex)
{
StatusBar.WriteError(ex.Message);
}
return true;
[/CODE]
hth
paolo
MIcrotoolmaker
That worked perfect. Thank you!MIcrotoolmaker
This had worked perfectly. Now however I need to toggle to unlock the UDFs at times. I tried just changing the "False" to "True" like:to lock:
Item.GetFromUID(pVal.Form.UDFForm , "U_upn").Enabled = false;
and
to unlock
Item.GetFromUID(pVal.Form.UDFForm , "U_upn").Enabled = true;
This is the error I get- "Error SpecsEditFunction: Item"The item is not a user defined item (66000-8)"
SeKo
Hi,we had similar problems. This happens when the UDF is not visible.
Also, you have to make sure you're on the right form. If your rule runs when something changes on the UDF form, then pVal.Form is already your UDF form and you shouldn't use pVal.Form.UDFForm...
0
Please sign in to leave a comment.
Comments
0 comments