In related actions ,after submitting the form ,the details are not updated in db

In related action , after submitting a form ,the form must gets closed and it must enter details in db  but after submitting the form it is not updating the details in db and the form is not getting closed 
can someone please with this

  Discussion posts and replies are publicly visible

Parents
  • Set the 'submit: true' in your button widget. Should work!

  • 0
    Certified Lead Developer
    in reply to ZAINAB

    Can you please attach the interface code, and process screenshot for more info?

  • a!localVariables(
      local!pressedButton: "cancel",
      local!getdata: rule!test_getRequestByID(ri!id),
      {
        a!sectionLayout(
          contents: 
          {
            a!boxLayout(
              label: "Audit Approval Form",
              labelSize: "MEDIUM_PLUS",
              contents: {
                a!columnsLayout(
                  columns: {
                    a!columnLayout(
                      contents: {
                        a!textField(
                          label: "Comments",
                          labelPosition: "JUSTIFIED",
                          value: local!getdata[1].requestorComments,
                          saveInto: local!getdata[1].requestorComments,
                          refreshAfter: "UNFOCUS",
                          readOnly: true,
                          validations: {}
                        ),
                        a!dateField(
                          label: "Start Date",
                          labelPosition: "JUSTIFIED",
                          value: local!getdata[1].startDate,
                          saveInto: local!getdata[1].startDate,
                          readOnly: true,
                          validations: {}
                        ),
                        a!dateField(
                          label: "End Date",
                          labelPosition: "JUSTIFIED",
                          value: local!getdata[1].endDate,
                          saveInto: local!getdata[1].endDate,
                          readOnly: true,
                          validations: {}
                        ),
                        a!textField(
                          label: "Email Addresses",
                          labelPosition: "JUSTIFIED",
                          value: local!getdata[1].emailAddresses,
                          saveInto: local!getdata[1].emailAddresses,
                          refreshAfter: "UNFOCUS",
                          readOnly: true,
                          validations: {}
                        )
                      }
                    ),
                    a!columnLayout(
                      contents: {
                        a!textField(
                          label: "Requested By :",
                          labelPosition: "JUSTIFIED",
                          value: local!getdata[1].requestorName,
                          saveInto: local!getdata[1].requestorName,
                          refreshAfter: "UNFOCUS",
                          readOnly: true,
                          validations: {}
                        ),
                        a!textField(
                          label: "Requested Email :",
                          labelPosition: "JUSTIFIED",
                          value: local!getdata[1].requestorEmail,
                          saveInto: local!getdata[1].requestorEmail,
                          refreshAfter: "UNFOCUS",
                          readOnly: true,
                          validations: {}
                        ),
                        a!dateTimeField(
                          label: "Requested On",
                          labelPosition: "JUSTIFIED",
                          value: local!getdata[1].createdOn,
                          saveInto: local!getdata[1].createdOn,
                          readOnly: true,
                          validations: {}
                        )
                      }
                    )
                  }
                )
              },
              style: "#efefef",
              shape: "ROUNDED",
              padding: "STANDARD",
              marginBelow: "STANDARD",
              showShadow: false 
            ),
            a!columnsLayout(
              columns: {
                a!columnLayout(
                  contents: {
                    a!buttonArrayLayout(
                      buttons: {
                        a!buttonWidget(
                          label: "Cancel",
                          saveInto: {
                            a!save(ri!submit, false),
                            a!save(ri!test_requests, local!getdata[1])
                          },
    
                          submit: true,
                          style: "NORMAL"
                        )
                      },
                      align: "START"
                    )
                  },
                  width: "AUTO"
                ),
                a!columnLayout(
                  contents: {
                    a!buttonArrayLayout(
                      buttons: {
                        a!buttonWidget(
                          label: "Approve",
                          saveInto: {
                           
                            a!save(local!getdata[1].auditEmail, loggedInUser()),
                            a!save(local!getdata[1].lastUpdatedOn, now()),
                            a!save( local!getdata[1].lastUpdatedBy, loggedInUser() ),
                            a!save(ri!test_requests, local!getdata[1]),
                           a!save(ri!submit, true)
                          },
                          submit: true,
                          style: "PRIMARY",
                          showWhen: ri!editable
                        ),
                        a!buttonWidget(
                          label: "REJECT",
                          value: "reject",
                          saveInto: {                 
                            a!save(local!pressedButton,"reject"),
                            a!save(local!getdata[1].requestStatus,cons!test_STATUS_TYPES[3]),
                            a!save(ri!submit, true)
    
                          },
                          submit: true,
                          style: "DESTRUCTIVE",
                          disabled: false,
                          showWhen: (ri!editable)
                        )
                      },
                      align: "END"
                    )
                  }
                )
              }
            )
          },
          showWhen: local!pressedButton= "cancel"
        ),
        a!sectionLayout(
          contents: {
            a!boxLayout(
              label: "Rejection Comments ",
              labelSize: "SMALL",
              contents: {
                a!columnsLayout(
                  columns: {
                    a!columnLayout(
                      contents: {
                        a!textField(
                          label: "Comment",
                          labelPosition: "JUSTIFIED",
                          placeholder: "Please Provide Rejection Comments",
                          value: ri!test_Requests.rejectionComments,
                          saveInto:ri!test_Requests.rejectionComments,
                          refreshAfter: "UNFOCUS",
                          validations: {}
    
                        )
                      }
                    )
                  }
                )
              },
              style: "#efefef",
              shape: "ROUNDED",
              padding: "STANDARD",
              marginBelow: "STANDARD"
            ),
            a!columnsLayout(
              columns: {
                a!columnLayout(
                  contents: {
                    a!buttonArrayLayout(
                      buttons: {
                        a!buttonWidget(
                          label: "Cancel",
                          value: "cancel",
                          saveInto: {
                            a!save(ri!cancel, false),
                            a!save(ri!test_requests, local!getdata[1]),
                            a!save(  local!pressedButton,"cancel")
                          },
                          submit: true,
                          style: "NORMAL"
                        ),
                        a!buttonWidget(
                          label: "Submit",     
                          saveInto: {
                            a!save(local!getdata[1].rejectionComments,ri!test_Requests.rejectionComments),
                            a!save(local!getdata[1].auditEmail, loggedInUser() ),
                            a!save(local!getdata[1].requestStatus,cons!test_STATUS_TYPES[3]),
                            a!save(local!getdata[1].lastUpdatedOn, now()),
                            a!save( local!getdata[1].lastUpdatedBy, loggedInUser() ),
                            a!save(local!getdata[1].completedOn,now()),
                            a!save(ri!test_requests, local!getdata[1]),
                            a!save(ri!cancel, true)
    
                          },
                          submit: true(),     
                          style: "DESTRUCTIVE"
                        )
                      },
                      align: "END"
                    )
                  }
                )
    
              }
            )
          },
          showWhen:local!pressedButton="reject"
        )
      }
    )


















    please help me with  this code,  this interface  is used for submitting the form .In the interface it is working fine but in related action in record site ,nothing it getting updated 

Reply
  • a!localVariables(
      local!pressedButton: "cancel",
      local!getdata: rule!test_getRequestByID(ri!id),
      {
        a!sectionLayout(
          contents: 
          {
            a!boxLayout(
              label: "Audit Approval Form",
              labelSize: "MEDIUM_PLUS",
              contents: {
                a!columnsLayout(
                  columns: {
                    a!columnLayout(
                      contents: {
                        a!textField(
                          label: "Comments",
                          labelPosition: "JUSTIFIED",
                          value: local!getdata[1].requestorComments,
                          saveInto: local!getdata[1].requestorComments,
                          refreshAfter: "UNFOCUS",
                          readOnly: true,
                          validations: {}
                        ),
                        a!dateField(
                          label: "Start Date",
                          labelPosition: "JUSTIFIED",
                          value: local!getdata[1].startDate,
                          saveInto: local!getdata[1].startDate,
                          readOnly: true,
                          validations: {}
                        ),
                        a!dateField(
                          label: "End Date",
                          labelPosition: "JUSTIFIED",
                          value: local!getdata[1].endDate,
                          saveInto: local!getdata[1].endDate,
                          readOnly: true,
                          validations: {}
                        ),
                        a!textField(
                          label: "Email Addresses",
                          labelPosition: "JUSTIFIED",
                          value: local!getdata[1].emailAddresses,
                          saveInto: local!getdata[1].emailAddresses,
                          refreshAfter: "UNFOCUS",
                          readOnly: true,
                          validations: {}
                        )
                      }
                    ),
                    a!columnLayout(
                      contents: {
                        a!textField(
                          label: "Requested By :",
                          labelPosition: "JUSTIFIED",
                          value: local!getdata[1].requestorName,
                          saveInto: local!getdata[1].requestorName,
                          refreshAfter: "UNFOCUS",
                          readOnly: true,
                          validations: {}
                        ),
                        a!textField(
                          label: "Requested Email :",
                          labelPosition: "JUSTIFIED",
                          value: local!getdata[1].requestorEmail,
                          saveInto: local!getdata[1].requestorEmail,
                          refreshAfter: "UNFOCUS",
                          readOnly: true,
                          validations: {}
                        ),
                        a!dateTimeField(
                          label: "Requested On",
                          labelPosition: "JUSTIFIED",
                          value: local!getdata[1].createdOn,
                          saveInto: local!getdata[1].createdOn,
                          readOnly: true,
                          validations: {}
                        )
                      }
                    )
                  }
                )
              },
              style: "#efefef",
              shape: "ROUNDED",
              padding: "STANDARD",
              marginBelow: "STANDARD",
              showShadow: false 
            ),
            a!columnsLayout(
              columns: {
                a!columnLayout(
                  contents: {
                    a!buttonArrayLayout(
                      buttons: {
                        a!buttonWidget(
                          label: "Cancel",
                          saveInto: {
                            a!save(ri!submit, false),
                            a!save(ri!test_requests, local!getdata[1])
                          },
    
                          submit: true,
                          style: "NORMAL"
                        )
                      },
                      align: "START"
                    )
                  },
                  width: "AUTO"
                ),
                a!columnLayout(
                  contents: {
                    a!buttonArrayLayout(
                      buttons: {
                        a!buttonWidget(
                          label: "Approve",
                          saveInto: {
                           
                            a!save(local!getdata[1].auditEmail, loggedInUser()),
                            a!save(local!getdata[1].lastUpdatedOn, now()),
                            a!save( local!getdata[1].lastUpdatedBy, loggedInUser() ),
                            a!save(ri!test_requests, local!getdata[1]),
                           a!save(ri!submit, true)
                          },
                          submit: true,
                          style: "PRIMARY",
                          showWhen: ri!editable
                        ),
                        a!buttonWidget(
                          label: "REJECT",
                          value: "reject",
                          saveInto: {                 
                            a!save(local!pressedButton,"reject"),
                            a!save(local!getdata[1].requestStatus,cons!test_STATUS_TYPES[3]),
                            a!save(ri!submit, true)
    
                          },
                          submit: true,
                          style: "DESTRUCTIVE",
                          disabled: false,
                          showWhen: (ri!editable)
                        )
                      },
                      align: "END"
                    )
                  }
                )
              }
            )
          },
          showWhen: local!pressedButton= "cancel"
        ),
        a!sectionLayout(
          contents: {
            a!boxLayout(
              label: "Rejection Comments ",
              labelSize: "SMALL",
              contents: {
                a!columnsLayout(
                  columns: {
                    a!columnLayout(
                      contents: {
                        a!textField(
                          label: "Comment",
                          labelPosition: "JUSTIFIED",
                          placeholder: "Please Provide Rejection Comments",
                          value: ri!test_Requests.rejectionComments,
                          saveInto:ri!test_Requests.rejectionComments,
                          refreshAfter: "UNFOCUS",
                          validations: {}
    
                        )
                      }
                    )
                  }
                )
              },
              style: "#efefef",
              shape: "ROUNDED",
              padding: "STANDARD",
              marginBelow: "STANDARD"
            ),
            a!columnsLayout(
              columns: {
                a!columnLayout(
                  contents: {
                    a!buttonArrayLayout(
                      buttons: {
                        a!buttonWidget(
                          label: "Cancel",
                          value: "cancel",
                          saveInto: {
                            a!save(ri!cancel, false),
                            a!save(ri!test_requests, local!getdata[1]),
                            a!save(  local!pressedButton,"cancel")
                          },
                          submit: true,
                          style: "NORMAL"
                        ),
                        a!buttonWidget(
                          label: "Submit",     
                          saveInto: {
                            a!save(local!getdata[1].rejectionComments,ri!test_Requests.rejectionComments),
                            a!save(local!getdata[1].auditEmail, loggedInUser() ),
                            a!save(local!getdata[1].requestStatus,cons!test_STATUS_TYPES[3]),
                            a!save(local!getdata[1].lastUpdatedOn, now()),
                            a!save( local!getdata[1].lastUpdatedBy, loggedInUser() ),
                            a!save(local!getdata[1].completedOn,now()),
                            a!save(ri!test_requests, local!getdata[1]),
                            a!save(ri!cancel, true)
    
                          },
                          submit: true(),     
                          style: "DESTRUCTIVE"
                        )
                      },
                      align: "END"
                    )
                  }
                )
    
              }
            )
          },
          showWhen:local!pressedButton="reject"
        )
      }
    )


















    please help me with  this code,  this interface  is used for submitting the form .In the interface it is working fine but in related action in record site ,nothing it getting updated 

Children