Check if I have a document added or not

 
I have a question about how I can verify a document in the process model.
I have a form to register a user. inside there is a textfield and an update document. 
when I click send, I may have uploaded a document or not. On the other hand, I have two CDs. I
n the first cdt I enter the value of the textfield and the other where I enter the document.
the document cdt already has two rows added
(iddoc = 2, idsol = 1, document = x
iddoc = 4, idsol = 1, document = x).

my doubt comes now:
In the process, how can I do so that if I have uploaded a document I saved it in the cdt but putting the last iddoc value that there was +1 ?,
if I have not uploaded document (null). and either of the two options keep me in the cdt.

Thanks

load(
a!textField(
label: "user",
labelPosition: "ADJACENT",
value: ri!new.user,
saveInto: ri!new.user,
refreshAfter: "UNFOCUS",
required: true,
readonly: false,
validations: {
}
),

a!fileUploadField(
label: "Documentation",
labelPosition: "ADJACENT",
maxSelections: 1,
value: ri!newDoc.document,
saveInto:
{

ri!newDoc.iddoc,
ri!newDoc.idsol,
ri!newDoc.document,
},
target: cons!CPRO_CT_FLD_documentation,
validations: {}
)
)

  Discussion posts and replies are publicly visible

Parents
  • I am not 100% I understood your problem, try to explain the actual "status of the variables" and the "status after the submit"? or before entering the node and after the node finish?

    Maybe you are looking something like this? I could think this would be better on the submit of the button 

    ----a!fileUploadField(---
    ...
    saveInto:ri!newDoc.iddoc,
    ---


    ---button(----
    saveInto:
    {
    ri!newDoc.document,
    if ( isnull(ri!newDoc.document)
    {},
    {
    a!save(ri!newDoc.iddoc , max(local!variable.iddoc) + 1), /* NOTE: add the logic when the array empty*/
    a!save(ri!newDoc.idsol,1)
    }
    )
    },
    -----

    Please explain more details. 

    hope this helps

    Jose 

Reply
  • I am not 100% I understood your problem, try to explain the actual "status of the variables" and the "status after the submit"? or before entering the node and after the node finish?

    Maybe you are looking something like this? I could think this would be better on the submit of the button 

    ----a!fileUploadField(---
    ...
    saveInto:ri!newDoc.iddoc,
    ---


    ---button(----
    saveInto:
    {
    ri!newDoc.document,
    if ( isnull(ri!newDoc.document)
    {},
    {
    a!save(ri!newDoc.iddoc , max(local!variable.iddoc) + 1), /* NOTE: add the logic when the array empty*/
    a!save(ri!newDoc.idsol,1)
    }
    )
    },
    -----

    Please explain more details. 

    hope this helps

    Jose 

Children