12-14-2010 02:22 PM
I have a plug-in with custom sub-entittes and everything is more or less fine, except one field has too short a fieldproperty.length. Is there a way to alter this value short of stripping the table and re-adding it (what I was doing before this went live and only using dummy data. Not an option at the moment).
12-15-2010 04:39 AM
This is straight off the top of my head and without the assistance of an editor so it might be a bit off, but once you have the field descriptor it should look something like:
myDBFieldDescriptor.Attributes[FieldDescriptorProperty.Length] = new ActApp.ActFramework.Fields.FieldDescriptorProperty.Length(Value);
Hopefully that's not too far off the mark.
12-15-2010 02:15 PM
This doesn't seem to work.
The code originally reads as
If entity doesn't exist
I added an else statement, to jutst change the field attribute. However, my issue is that it's not a new field. It's an existing one whose attributes need to be updated. Not saving causes the changes to be complete ignored. Using the Fields.Save command causes an exception.
Any other thoughts?
12-16-2010 01:28 PM
Sorry for the lte replies, I can only lock the database at the end fo teh day.
I'm getting 'The descriptor name <NAME> is already in use adn cannot be applied. It's the use of the word 'NEW' as this is a fild that's already been created in the Plug-in, I just need to modify its attributes at the moment.
Is there a way to just do a 'Get' on the given field descirptor than trying to create a new one?
12-16-2010 01:47 PM
Absolutely, there are several different Get methods for field descriptor, I'd refer to the code reference for all that are available, in the meantime here's an example of grabbign the edit date field from contacts:
DBFieldDescriptor EditDate = _ActApp.ActFramework.Contacts.GetFieldDescriptor("TBL_CONTACT.EDITDATE", true);
12-16-2010 02:00 PM
However, the issue is that the field in is a part of a custom entity. I create it just fine using the New FieldDescriptor command, I just am having issues editing it in situ.
Not sure if it's relevant, but this plug-in has a COMPANY as a parent, not CONTACT.