Skip to main content

Get the ID of newly opened Form

Comments

2 comments

  • Patrick ALLAIRE

    To be more acurate, I have to add that my code did something:  it wrote "Some content" into the original form instead of the destination one.  About the Matrix part: nothing.

    0
  • Patrick ALLAIRE

    I found the solution, so I give it to those who are looking for the same.

     

     

    //First: keep track of the actual active Form

    Form FormA = Form.GetActiveForm();

    //Open a new form

    Form.OpenFormByKey("22", null);

    //Capture the newly opened Form
    Form FormB = Form.GetActiveForm();

    //Set the new form into ADD status
    FormB.Mode = SwissAddonFramework.UI.Components.ModeComponent.FormModes.ADD;

    //Now you can write into the new form

    TextEdit.GetFromUID(FormB, "4").Value = "8881231234";

    //And even pass info from FormA to FormB
    TextEdit.GetFromUID(FormB, "92").Value = TextEdit.GetFromUID(FormA, "92").Value;

    0

Please sign in to leave a comment.