1

We are trying to run sample code effects business-rule engine MVC sample by using an existing .NET class as a Source Object, this class have two drop-down Fields. FieldA have string datatype, whereas FieldB is of int data type as shown below both fields have data source on them to treat them as drop-down fields.

[Data("FieldAData", "getFieldAData")]
[Data("FieldBData", "getFieldBData")]
public class Fields
{
    public Fields()
    {
        this.ID = Guid.Empty;
    }

    public Guid ID { get; set; }

    [Field(DisplayName = "Field A", DataSourceName = "FieldAData", Description = "Field A")]
    public string FieldA { get; set; }//(varchar(2), null)

    [Field(DisplayName = "Field B", DataSourceName = "FieldBData", Description = "Field B")]
    public int FieldB { get; set; }//(int, null)

    [Field(DisplayName = "Application Number", Description = "Application Number", Max = 20)]
    public string ApplicationNumber { get; set; }//(varchar(20), null)

when we create a new execution rule on this class then we are able to see drop down for FieldB (having data type int) but not for FieldA (having data type string). Test Rule Sample

Is data source binding is not available for fields with data type string? or we are missing something here?

1 Answers1

0

Data sources with string IDs are not supported by Code Effects. The most common way to bypass that (if your source is in a database) is to add an auto incrementing column to your table and use that as ID. Details

Alex
  • 566
  • 1
  • 6
  • 14
  • Is there any plan to make this part on Code Effects rule engine? Also is there any way we can declare variables to keep some result temporarily in variable. so we can utilize variable later in same rule? – Muhammad Salman Jun 16 '17 at 10:34