Skip to content

Add GetFormObject Helper Method #92

@scottolsonjr

Description

@scottolsonjr

It would be helpful for writing unit test and some use cases to retrieve a specific FormObject to work with. For example, to interact with rows in a specific form. To accomplish this we could implement a GetFormObject method to retrieve a FormObject by ID.

FormObject formObject = optionObject.GetFormObject("123");

Another way this could look is to use this method to quickly retrieve the CurrentRow of a FormObject.

RowObject rowObject = optionObject.GetFormObject("123").CurrentRow;

The intent of this method is to reduce the need for selecting FormObjects using the methods below.

string formId = "123";
for (FormObject formObject in optionObject.Forms)
{
    if (formObject.FormId == formId) {
        // logic for this form
    }
}
FormObject formObject = optionObject.Form[2];
// logic for this form

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions