public static void OnNew(DataMap dataMap, ApplicationSchemaDefinition application, CompositeDataMap composite) { var context = new OnNewContext(application, MetadataRepository, User.Current, composite); var behavior = GetBehavior(context.Application); behavior.OnNew(context, dataMap); }
/// <summary> /// Invoked when a brand-new data map is created by the user. /// This method can be used to initialize default values or /// perform any related tasks. /// </summary> /// <param name="context">The operation context.</param> /// <param name="dataMap">The empty data map to hold entity data.</param> public virtual void OnNew(OnNewContext context, DataMap dataMap) { // Inspects the metadata looking for SITEID and // ORGID. If they exist, initialize them with // the ORGID and SITEID of the current user. SetFieldIfExists(context.Application, dataMap, "orgid", context.User.OrgId); SetFieldIfExists(context.Application, dataMap, "siteid", context.User.SiteId); }