master/details

I have a master in the field, this field is not 'in the relationship with the details.
I would use the value of the field during the insertion of a new record in detail (in the business rules).
How can I do?
1 person has
this question
+1
Reply
  • Hello mike,

    if i understand you correctly i have had a similar situation lately.

    I have a master record containing a state-field. But it is read-only in the master and can only be changed by adding detail records (so we have a comment on what is happening in each step). So to be able to do that, I needed that the state field would be read from the master and used as default for the new detail record.

    The solution was to add a business rule to the detail record

    [RowBuilder("DetailRecord", RowKind.New)]
    public void ReadStateAndUseAsDefault()
    {
    FieldValue master = PageRequest.Current.ExternalFilter[0];
    using (var state = new SqlText("SELECT state FROM master where Id=" + master.OldValue))
    {
    if (state.Read())
    {
    UpdateFieldValue("State", state["state"]);
    }
    }
    }

    Greetings,
    Stefan
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly happy, confident, thankful, excited indifferent, undecided, unconcerned sad, anxious, confused, frustrated

  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly happy, confident, thankful, excited indifferent, undecided, unconcerned sad, anxious, confused, frustrated