Multiply two integer fields and save the results to another field.

I'm trying to multiply the values stored in two integer fields and save the results in another integer field. I'm not sure if I have the correct syntax for the multiplier in my code or if my saveInto statement is correct. The Total estimated capacity field is not displaying the results of the value in the Number of files field multiplied by the value in the Average file size field  This is my code:

a!integerField(
  label: "Total estimated capacity",
  value: ri!totalEstCapacity,
  saveInto: {
    a!save(ri!totalEstCapacity,ri!numberOfFiles*ri!averageFileSize)},
  refreshAfter: "UNFOCUS",
  required:true,
  validations: {}
)

Can someone help with this?  Thanks...

  Discussion posts and replies are publicly visible

Parents
  • This will do the trick:

    load(
      with(
        a!formLayout(
          contents: {
            a!sectionLayout(
              contents: {
                a!columnsLayout(
                  columns: {
                    a!columnLayout(
                      contents: {
                        a!integerField(
                          label: "int1",
                          labelPosition: "ABOVE",
                          value: ri!int1,
                          saveInto: {
                            ri!int1,
                            a!save(
                              ri!integerOUT,
                              if(
                                and(
                                  not(isNull(ri!int1)),
                                  not(isNull(ri!int2))
                                ),
                                ri!int1 * ri!int2,
                                {}
                              )
                            )
                          },
                          refreshAfter: "KEYPRESS"
                        )
                      }
                    ),
                    a!columnLayout(
                      contents: {
                        a!integerField(
                          label: "int2",
                          labelPosition: "ABOVE",
                          value: ri!int2,
                          saveInto: {
                            ri!int2,
                            a!save(
                              ri!integerOUT,
                              if(
                                and(
                                  not(isNull(ri!int1)),
                                  not(isNull(ri!int2))
                                ),
                                ri!int1 * ri!int2,
                                {}
                              )
                            )
                          },
                          refreshAfter: "KEYPRESS"
                        )
                      }
                    ),
                    a!columnLayout(
                      contents: {
                        a!integerField(
                          label: "product",
                          labelPosition: "ABOVE",
                          value: ri!integerOUT,
                          saveInto: {
                            ri!integerOUT,
                            a!save(
                              ri!integerOUT,
                              save!value
                            )
                          },
                          refreshAfter: "UNFOCUS",
                          readonly: true()
                        )
                      }
                    )
                  }
                )
              }
            )
          }
        )
      )
    )

Reply
  • This will do the trick:

    load(
      with(
        a!formLayout(
          contents: {
            a!sectionLayout(
              contents: {
                a!columnsLayout(
                  columns: {
                    a!columnLayout(
                      contents: {
                        a!integerField(
                          label: "int1",
                          labelPosition: "ABOVE",
                          value: ri!int1,
                          saveInto: {
                            ri!int1,
                            a!save(
                              ri!integerOUT,
                              if(
                                and(
                                  not(isNull(ri!int1)),
                                  not(isNull(ri!int2))
                                ),
                                ri!int1 * ri!int2,
                                {}
                              )
                            )
                          },
                          refreshAfter: "KEYPRESS"
                        )
                      }
                    ),
                    a!columnLayout(
                      contents: {
                        a!integerField(
                          label: "int2",
                          labelPosition: "ABOVE",
                          value: ri!int2,
                          saveInto: {
                            ri!int2,
                            a!save(
                              ri!integerOUT,
                              if(
                                and(
                                  not(isNull(ri!int1)),
                                  not(isNull(ri!int2))
                                ),
                                ri!int1 * ri!int2,
                                {}
                              )
                            )
                          },
                          refreshAfter: "KEYPRESS"
                        )
                      }
                    ),
                    a!columnLayout(
                      contents: {
                        a!integerField(
                          label: "product",
                          labelPosition: "ABOVE",
                          value: ri!integerOUT,
                          saveInto: {
                            ri!integerOUT,
                            a!save(
                              ri!integerOUT,
                              save!value
                            )
                          },
                          refreshAfter: "UNFOCUS",
                          readonly: true()
                        )
                      }
                    )
                  }
                )
              }
            )
          }
        )
      )
    )

Children
No Data