HI Everyone,
I am New to the Outsystems, I don't know how to fetch multiple documents from the data base in On After Fetch.
I created List screen, When I Click name it will redirect edit state and image, Email, Phone Number Will be Coming but Name and Documents Not showing in Screen.
And One more thing if I Upload Image, then Image name will automatically set in name field.
And I am uploading My OML also, Check Logic i created.
Please Help Me on this Task.
Ok, I didn't understand why the previous solution didn’t match something, but I'm following your specific needs. I inspected your OnAfterFetch function, and I found the issue: when you change an element inside another file input field, you append it to MultipleDocument and assign NullData to TemporaryDocuments : After that, in the Save button, you are fetching data from TemporaryDocuments instead of MultipleDocuments :
Also you need some Updates Here :-
GetMultipleDocumentsByCustomerId.List.Current.MultipleDocuments.FileName and
GetMultipleDocumentsByCustomerId.List.Current.MultipleDocuments.FileContent
Hi Sagar,
In the After Fetch Action of your GetMultipleDocumentsByCustomerId aggregate, simply map the result to your local list.
Also pay attention to the warnings list. Your SaveOnClick action should only have one server action. You should perform all of this logic in one server action.
The reason, when you upload an image the of the customer is changed, is because in your upload widget you are using the Customer Name as the File Name.
Create two local variables to use in the widget, and then use its value to save the image in your Customer Entity.
Below is the updated .oml.
Hi @Beatriz Sabino ,
Name field is working properly. And Record will be creating successfully, but I need to edit existing record.
After I click Name.
Why can't you edit the record? Just change the information and click save again, are you referring to the documents? If you change a document the local list is not updated?
HI @Beatriz Sabino ,
Ya I am able to edit the record, the documents should display in same place where we uploaded that image. Like AdharCard in Upload2 Widget, PanCard in Upload3, Driving Licence in Upload4 and other documents should display in Local List.
After I get the all information properly, after Ill create 1 one column for edit document in Local list.
Hello Sagar,
The reason the name changes when you upload your image is because you have the file name property set to that field. You could leave it empty.
For the list issue, you are setting your tempory Documents instead of the MultipleDocuments. Try something like the assign below to fill up your list.
Hope this helps,
Nick
Hi @Nick Vandebriel ,
Record is creating, but I need to edit existing record.
And Thank you for point the nameing issue.
Hi @Sagar Andyal ,
As you are passing NullIdentifier as Id to the server actions in SaveOnClick for updating the record(s) you are getting error/exception.
For updating documents provide a update button beside remove button and pass the current document id for updating the files of documents list(you can use a popup for showing the document upload widget) and you have to show the file upload widgets only if the CustomerId = NullIdentifier and don't show the update button in the document list
(Reply Updated)
Hope it will resolve your issue.
Regards,
Surya.
I have made some changes to your OML. Please review the attached file below.Here is the link to the working example.Have a great day!
Hi @Iheb Maatali Riahi ,
Your Logic is different that mine, Could You please go through my Logic.
Hear, In this screen not getting other Documents in Local List.
Ill Attaching My Oml file.
Link Working fine! Please avoid using large images to prevent timeout errors. -> I’m going through your logic and have made some refactors to resolve the issues.
You made changes in On after fetch action Right.
you used list filter for that and ill used assign for upload widget and for the local list i used append.
Ill Uploaded My oml file Just check on that.
File Name and File Content Will not be appearing.
Thank you so much for your help with this task. I couldn't have done it without you.
You're very welcome! I'm glad I could help. Have a great day!
Hi @Sagar Andyal,
I have updated the OML.
One suggestion: please consolidate all the server actions into a single server action, rather than calling multiple server actions from the client action. Calling server actions directly from a client action is not considered best practice and may lead to performance issues in the future.
Hope this will help.
Thanks
Hi @Aditi Saraswat ,
I'll Appreciate For your Suggestion.
But I am New To the Outsystems, I Don't know how to call multiple server action in Single server action could you please elaborate In Simple and easy to understand.
Feel free to review it, and let me know if you encounter any issues during implementation.
Thanks.
Thank you so much for the help.
Ill Mentioned my issue in above comment.
I've updated the solution to address your issue as well—could you please take a look?
Ya But You used List filter for that and Ill used append for Multiple Documents Local List.
My Logic is different and i am getting Adharcard, pancard, and drivingLicence also but i am not getting other documents in local List.
Like ill mentioned above image. and also i uploaded my oml file check the logic i used.
I have updated your OML logic.
Please try and let me know if you encounter any issues during implementation.
Logic is same but still i am not getting file name and filecontent In local list.
Look at the Local list.