Hi,
We have developed a plugin with a component that works within the Management Client. As part of this plugin, we have an item under the Servers entry in the tree. Under this item is a series of items (e.g. Encoders) which have child items (e.g. Encoder Inputs). For this application, the child items are tightly tied to the parent and have limited configuration requirements; therefore, we are creating the child items (Encoder Inputs) programmatically rather than from the tree and displaying the configuration for them in the parent form (Encoder) rather than a separate configuration screen. All of this works as expected.
When we attempt to set roles for accessing the devices. We get an error when setting the role for the child devices that are created programmatically. This error is:
TITLE: OnAfterCheck ()
------------------------------
VMO60021: Could not create the access entry. The object with the ID 9c11af98-5943-4d33-aa91-f17c55198592 does not exist.
------------------------------
ADDITIONAL INFORMATION:
VMO60021: Could not create the access entry. The object with the ID 9c11af98-5943-4d33-aa91-f17c55198592 does not exist. (mscorlib)
------------------------------
BUTTONS:
OK
------------------------------
The error seem to indicate that the item does not exist; however, this is the item that was created and has been verified to exist.
If we create them via the tree (which is possible though not the typical way in which it is done), we do not get this error when setting the roles.
Sample code for the programmatic creation of the device is below:
EncoderInputUserControl \_userControl = new EncoderInputUserControl("EncoderInput");
Guid guid = Guid.NewGuid();
ServerId serverId = new ServerId(\_item.FQID.ServerId.ServerType, \_item.FQID.ServerId.ServerHostname, \_item.FQID.ServerId.Serverport, \_item.[FQID.ServerId.Id](https://FQID.ServerId.Id));
FQID suggestedFQID = new FQID(serverId, \_item.FQID.ObjectId, guid, [FolderType.No](https://FolderType.No), PAGuids.EncoderInputKind);
CurrentItem = new EncoderInputItem(suggestedFQID, "Enter a name", \_item);
if (\_userControl != null)
{
\_userControl.FillContent(CurrentItem);
CurrentItem.Properties\["EncoderInputNumber"\] = i.ToString();
[CurrentItem.Name](https://CurrentItem.Name) = "Enter a name ...";
}
if (CurrentItem != null)
{
Configuration.Instance.SaveItemConfiguration(PluginGuids.PluginId, CurrentItem);
SecurityAccess.RegisterItem(CurrentItem);
}
As part of this code we are creating the item, saving the configuration, and registering the item. Also, we have compared the programmatically created item with the tree created item and they appear to be identical except for information that should be different (e.g. objectId).
Can you tell us what part of the programmatic creation process is missing as compared to what the tree created process does for items?
Thanks