How to handle set value in DC Logic

StatusIDPriorityType
Closed32993MajorQuestion
ProfileReply
gabossoloClient

Below methods are not working capturing when setting my value...

public static void Set_FullName(IMyInterface instance, string value)
public static void Set_FullName(IMyInterface instance, IObjectSpace objectSpace, string value)

[DomainLogic(typeof(Customer))] public class Main : Main
{
public Main(Customer instance) : base(instance) { }
public static void Set_Name(Customer instance, string value) => instance.Name = value.Transform(To.UpperCase);
}

Replies

UserDescriptionPosted On
gabossoloClient

Getting this error:

The 'CH.OpsManager.BusinessObjects.Settings.Customers.CustomerLogics+Main.Set_Name' logic method(s) will not be used for the 'CH.OpsManager.BusinessObjects.Settings.Customers.Customer.Name' property because this property is persistent or has the PersistentAlias attribute. Either remove the logic method(s) declaration or make the property non-persistent or remove the attribute.

gabossoloClient

Problem solved!

public static void AfterChange_Name(Customer instance)
{
if (string.IsNullOrEmpty(instance?.Name )) return;
var value = instance.Name ;
instance.Name = value.Transform(To.UpperCase);
}

× This ticket is closed.

Write US