Need edit the Paragraph field when click on Edit button

Hello All,

I have the below requirement.

In section layout I need give the paragraph field for comments sections. Initially it should be show in a read only.

I need to put edit button after the comments field when click on Edit button it should come as blank and when enter the new comment it should be over written the previous comment (Initial comments will already be there as an integration with other tool). 

When update the new comment in DB it should over write the previous comment.

If you provide with code that would be really helpful.

Thanks in advance.

  Discussion posts and replies are publicly visible

Parents
  • As an example of Mike's suggestion (which I would recommend as well):

    a!localVariables(
      local!enableCommentEditing: false,
      local!CDT: {comments: "initial comments here"}, /* This will be a rule input with your comments! */
      
      {
        a!paragraphField(
          label: "Comments",
          value: local!cdt.comments,
          saveInto: local!cdt.comments,
          readOnly: not(local!enableCommentEditing),
          required: local!enableCommentEditing
        ),
        a!buttonArrayLayout(
          align: "START",
          buttons: {
            a!buttonWidget(
              label: "Edit",
              disabled: local!enableCommentEditing,
              value: true,
              saveInto: {
                local!enableCommentEditing,
                a!save(local!CDT.comments,null)
              }
            )
          }
        )
      }
    )

  • 0
    Certified Associate Developer
    in reply to Chris

    hi ,chis 

    what if what we have multiple comments in a for each . but i want to edit the same on loogedinUser basis. 

Reply Children