DataObjectControllerLoadObjects Method |
Namespace: Omada.OE.AppLogic
public virtual DataObjects LoadObjects( DataObjectLoadOptions loadOptions )
using System; using Omada.OE.Model; using Omada.OE.AppLogic; namespace CodeAssembly1 { public class Main { public bool GetActionObjectDescription(CodeMethodInvokeContext context, out string result) { DataObjectLoadOptions loadOptions = new DataObjectLoadOptions(); loadOptions.IdPosList.Add(context.ActionObjectId); DataObjectController controller = context.Factory.CreateController<DataObjectController>(); DataObjects dataObjects = controller.LoadObjects(loadOptions); if (dataObjects.Count == 0) throw new Exception("Action object not found: " + context.ActionObjectId); DataObject actionObject = dataObjects[0]; result = "Description for \"" + actionObject.DisplayName + "\": "; foreach (DataObjectVersionProperty versionProperty in actionObject.CurrentVersion.Properties) result += "\r\n" + versionProperty.GetProperty().Name + ": " + versionProperty.ToString(); return true; } } }