what might be the reason for error?
Discussion posts and replies are publicly visible
Hi Kavya, looks like you have not configured target folder. Can you check whether you have configured fileuploadfiled properly or not?
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 ), {} ), "" ) } ),
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)
yes i have done it
So just because the code indicates that you're extracting a value doesn't mean to say it's getting the correct value, or even any value at all, at run time! You need to test the fragment of code you're highlighting in the environment where you encountered the error, see what the value of the folder id actually is and then see if a valid folder exists for that id
Hi Kavya, As Stewart said check if you have valid folder Id from ri!folderId_int. Try to print this value and check if its valid.
And is 43138 a valid folder id in your environment? That is: does a folder exist that has 43138 as its identifier?