Skip to main content
kavyam0002
April 28, 2022
Question

error

  • April 28, 2022
  • 8 replies
  • 0 views

what might be the reason for error?

    8 replies

    gopalk2865
    Participating Frequently
    April 28, 2022

    Hi Kavya, looks like you have not configured target folder. Can you check whether you have configured fileuploadfiled properly or not?

    kavyam0002
    April 28, 2022

    i have configured it 

       a!fileUploadField(
              label: "File Upload",
              labelPosition: "ABOVE",
              target: tofolder(
                ri!folderId_int
              ),
              value: index(
                fv!item,
                "docId_int",
                ""
              ),
              saveInto: {
                fv!item.docId_int,
                if(
                  rule!APN_isBlank(
                    fv!item.docId_int
                  ),
                  {},
                  a!save(
                    fv!item,
                    updatedictionary(
                      dictionary: fv!item,
                      fieldsAndValues: {
                        updatedOn_dt: if(
                          not(
                            isnull(
                              fv!item.id_int
                            )
                          ),
                          now(),
                          {}
                        ),
                        folderId_int: ri!folderId_int,
                        folderRowId_int: ri!folderRowId_int,
                        updatedBy_txt: if(
                          not(
                            isnull(
                              fv!item.id_int
                            )
                          ),
                          loggedInUser(),
                          {}
                        ),
                        updatedByRole_txt: if(
                          not(
                            isnull(
                              fv!item.id_int
                            )
                          ),
                          rule!CR_FN_getUserRole(
                            inputUser_txt: loggedInUser()
                          ),
                          {}
                        )
                      }
                    )
                  )
                )
              },
              maxSelections: 1,
              validations: {
                a!localVariables(
                  local!invalidExtensions: difference(
                    upper(
                      fv!files.extension
                    ),
                    {
                      cons!CR_CUST_FILE_EXTENSION
                    }
                  ),
                  if(
                    length(
                      local!invalidExtensions
                    ) > 0,
                    cons!CR_CUST_VALIDATION_MESSAGE[1] & index(
                      fv!files,
                      "name",
                      wherecontains(
                        local!invalidExtensions,
                        upper(
                          fv!files.extension
                        )
                      ),
                      {}
                    ),
                    ""
                  )
                ),
                if(
                  or(
                    fv!files.size > cons!CR_CUST_MAX_UPLOAD_FILE_SIZE
                  ),
                  cons!CR_CUST_VALIDATION_MESSAGE[2] & index(
                    fv!files,
                    "name",
                    where(
                      fv!files.size > cons!CR_CUST_MAX_UPLOAD_FILE_SIZE
                    ),
                    {}
                  ),
                  ""
                )
              }
            ),
         

    stewart.burchell
    April 28, 2022

    Have you established that the value you're passing in fir the folder - ri!folderId_int - contains a valid folder identifier? (Note: the id for a folder is unique in any given environment, so if you're storing/retrieveing the folder id in a reference source such as a constant or a database then if you promote this value from, say, DEV to TEST, the folder in the target environment may not have the same Id as the source envrionment)