Interface with auto populating and editing the text field.

Certified Associate Developer

Hello, 

I have a requirement where the text field should get auto-populated based on the previous action. Once the text field is auto populated I have 2 possibilities. 

1. the user can click on submit without making any changes to the text field. In this case, since there is no user interaction, the value is not storing to the saveinto local variable. 

2. the user can change the text field value as per their choice. In this case, the value is saving to the local variable, but it's not reflecting in the text field, since in value parameter there is another local variable.

a!textField(
label: "File Name",
labelPosition: "ABOVE",
value: local!prepopulatedName, 
saveInto: local!docName,
refreshAfter: "UNFOCUS",

),

Here, local!docName is the variable created for storing the value for this text field. 

local!prepopulatedName is the field from where it's getting auto populated. 

Can someone please guide me here?

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    Hi  

    a!localVariables(
    local!docName,
    {
    a!fileUploadField(
    label: "Document",
    target: cons!NA_Upload_Documnet_CONS,
    maxSelections: 1,
    value: ri!document,
    saveInto: {
    a!save(ri!document, save!value),
    a!submitUploadedFiles()
    }
    ),
    a!textField(
    label: "Document Name",
    value: if(
    a!isNullOrEmpty(ri!document),
    null,
    document(documentId: ri!document, property: "name")
    ),
    saveInto: { a!save(local!docName, save!value) }
    )
    }
    )

    You Can Try This Code .

  • 0
    Certified Associate Developer
    in reply to johibd1593

    Thanks for your help. With this code, when we enter a new value in the document name it's not reflected. I used like below:
    a!fileUploadField(
    label: "Document",
    labelPosition: "ABOVE",
    target: cons!TEST_APPLICATION_DOCUMENT,
    maxSelections: 1,
    value: local!document,
    saveInto: {
    local!document,
    a!submitUploadedFiles(
    onSuccess: {
    a!save(local!sucess, true),
    a!save(
    local!documentName,
    document(index(local!document, 1), "name")
    )
    },
    onError: a!save(local!sucess, false)
    )
    },
    required: true,
    validations: {}
    )

    a!textField(
    label: "Document Name",
    labelPosition: "ABOVE",
    value: local!documentName,
    saveInto: local!documentName,
    showWhen: a!isNotNullOrEmpty(local!document),
    required: true
    )

Reply
  • 0
    Certified Associate Developer
    in reply to johibd1593

    Thanks for your help. With this code, when we enter a new value in the document name it's not reflected. I used like below:
    a!fileUploadField(
    label: "Document",
    labelPosition: "ABOVE",
    target: cons!TEST_APPLICATION_DOCUMENT,
    maxSelections: 1,
    value: local!document,
    saveInto: {
    local!document,
    a!submitUploadedFiles(
    onSuccess: {
    a!save(local!sucess, true),
    a!save(
    local!documentName,
    document(index(local!document, 1), "name")
    )
    },
    onError: a!save(local!sucess, false)
    )
    },
    required: true,
    validations: {}
    )

    a!textField(
    label: "Document Name",
    labelPosition: "ABOVE",
    value: local!documentName,
    saveInto: local!documentName,
    showWhen: a!isNotNullOrEmpty(local!document),
    required: true
    )

Children
No Data