83
Views
11
Comments
Solved
Where is scaffolding method to add image in the app in reactive app
Question

Hi everyone, I am trying to add an entity (OrderImage) in my app to have a one to one link with the delivery of my order so that I can take a picture of the delivery slip that I receive with my order delivery. I know in the normal Web App there was a method called Scaffolding under the advance menu to create an entity that takes care of the image, but I do not know how can I do the similar in my reactive app. Finally I want my app to force a picture when adding a delivery note of an order. 

MyOrderCollection.oap
Solution

Daniël Kuhlmann wrote:

Hi Badar,

There are some things that are not right:

OrderDetail screen

  1. You use a GetOrderPictures aggregate but do not filter on OrderId, you could add the OrderPicture entity to the GetOrderById aggregate with a With or Without relation, no need for 2 aggregates.
  2. The Screen is anonymous, that is valid, but I doubt if that is what you want.

OrdersCreateOrUpdate server action

  1. You have a server action OrdersCreateOrUpdate in which you call the CreateOrUpdateOrderPicture.
  2. But the Order Picture binary and the file name are not passed as input parameters to the server action.
  3. Also, you should do the CreateOrUpdateORdersPicture after the CreateOrUpdateOrders, OrderRecord, so that you can use the Id assigned to the Order Records as the Id of the Picture

I made some changes and attached the updated version.

Regards

Daniel

Hi Daniel, thanks for your help, I manage to achieve what I wanted. Much appreciated.


Hi Badar,

It is the same place as always: on the Data Tab

  1. right-click the entity to get the popup menu
  2. choose Advanced...
  3. choose Import image for 'entity name' entity

Regards,

Daniel

Hi Badar,

Just to visualize what Daniël has described:

You can mark Daniël's answer as solution.

Regards,

Nordin

Nordin Ahdi wrote:

Hi Badar,

Just to visualize what Daniël has described:

You can mark Daniël's answer as solution.

Regards,

Nordin


Hi Nordin, thanks for the illustration I manage to create the image with scaffolding method. But when I add the new delivery record then I am still not prompted to add the picture. Even though I have made the picture and file name ad mandatory? Am I doing something wrong? Please advise.

Hi Badar,

The scaffolding as explained in previous replies, only generated the entity.

See the next document for instructions (for reactive it is the same as for mobile)

https://success.outsystems.com/Documentation/11/Developing_an_Application/Design_UI/Inputs/Enable_End_Users_to_Upload_Files

Regards,

Daniel


Daniël Kuhlmann wrote:

Hi Badar,

The scaffolding as explained in previous replies, only generated the entity.

See the next document for instructions (for reactive it is the same as for mobile)

https://success.outsystems.com/Documentation/11/Developing_an_Application/Design_UI/Inputs/Enable_End_Users_to_Upload_Files

Regards,

Daniel


Hi Daniel, I followed your link, so at the time of saving the orderpicture I am stuck at the source. I am uploading my oml file. Would appriciate if you can point out where I am going wrong thanks.


MyOrderCollection.oml

Hi Badar,

Do you mind reuploading your oml so we can take a look?

Somehow it keeps showing this.

Thanks,

Nordin

Nordin Ahdi wrote:

Hi Badar,

Do you mind reuploading your oml so we can take a look?

Somehow it keeps showing this.

Thanks,

Nordin

I am uploading the oml, after what Daniel shared with me.


MyOrderCollection.oml

Hi Badar,

There are some things that are not right:

OrderDetail screen

  1. You use a GetOrderPictures aggregate but do not filter on OrderId, you could add the OrderPicture entity to the GetOrderById aggregate with a With or Without relation, no need for 2 aggregates.
  2. The Screen is anonymous, that is valid, but I doubt if that is what you want.

OrdersCreateOrUpdate server action

  1. You have a server action OrdersCreateOrUpdate in which you call the CreateOrUpdateOrderPicture.
  2. But the Order Picture binary and the file name are not passed as input parameters to the server action.
  3. Also, you should do the CreateOrUpdateORdersPicture after the CreateOrUpdateOrders, OrderRecord, so that you can use the Id assigned to the Order Records as the Id of the Picture

I made some changes and attached the updated version.

Regards

Daniel

MyOrderCollection.oml
Solution

Daniël Kuhlmann wrote:

Hi Badar,

There are some things that are not right:

OrderDetail screen

  1. You use a GetOrderPictures aggregate but do not filter on OrderId, you could add the OrderPicture entity to the GetOrderById aggregate with a With or Without relation, no need for 2 aggregates.
  2. The Screen is anonymous, that is valid, but I doubt if that is what you want.

OrdersCreateOrUpdate server action

  1. You have a server action OrdersCreateOrUpdate in which you call the CreateOrUpdateOrderPicture.
  2. But the Order Picture binary and the file name are not passed as input parameters to the server action.
  3. Also, you should do the CreateOrUpdateORdersPicture after the CreateOrUpdateOrders, OrderRecord, so that you can use the Id assigned to the Order Records as the Id of the Picture

I made some changes and attached the updated version.

Regards

Daniel

Hi Daniel, thanks for your help, I manage to achieve what I wanted. Much appreciated.


Hi Badar,

"Finally I want my app to force a picture when adding a delivery note of an order".

With regard to your comment in your first post, I have added a custom validation that verifies if a picture is uploaded upon saving an order and an Image widget to display the uploaded OrderPicture.

I have added these small adjustments in Daniël's modified version.

Regards,

Nordin

MyOrderCollection.oml

Hi,

this is mounikarani.

I am trying to add Background picture to my Application but I am unable to add so can you please help me. 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.