Multi-Line Order Form

Multi-Line Order Form

  

This might be pretty easy and I'm just tired, or it's just not possible...

I've been trying to create a purchase order form which:

1. Saves general informaiton about the purchase order in entity1

2. Related products that need to be ordered in entity2

not too bad so far... BUT...

3. Being able to dynamically add a new line to add more products (every order can have between 1-30 products) without having each purchase order form displaying 30 empty rows...


Screenshot of a similar form attached for clarification...


Thanks, guys!

Hello Elmar,

You said what you're trying to do, but not how or what's the problem.

In order to us to be of more help, please, stated how are you trying to do this and what is happening.

This way, instead of giving a solution that may not be the beat one, we can point you in the right direction and help you understand what's going on, which is much better.

By the way, it is perfect possible to do what you want.

Cheers.

Thank you for the reply, Eduardo!

I managed to get something working with an editable table. However, when accessing the "Purchase Order"screen, and navigating to the detail of a purchase order, each purchase order displays ALL of the purchase order products, instead of just the ones that are related to this specific purchase order.

The screen preparation includes a "get purchase orders" aggregate, and a "get purchase order products" aggregate. The later has as source the "purchase orders" entity, as well as the "purchase  order products" entity, with a filter: "PurchaseOrderProducts.PurchaseOrderId = PurchaseOrdersId".

Variables seem to be assigned properly on save, as the PurchaseOrderProducts entity shows the correct PurchaseOrderID from which it was created. Source for the products table is 

GetPurchaseOrderProducts.List


How can I get only the products related to a purchase order to display in the detail screen, instead of ALL product on every purchase order screen?

File attached, any help highly appreciated!!!

Solution

Hi Elmar,


After analyzing the code I found that the filter which you have mentioned in your explanation "PurchaseOrderProducts.PurchaseOrderId = PurchaseOrdersId" is not the one which you have did in the actual filter 

SyntaxEditor Code Snippet (Actual implemented filter expression)

PurchaseOrderProducts.PurchaseOrderId = PurchaseOrders.Id


if you replace it with the filter which you have mentioned it will work as per desired


SyntaxEditor Code Snippet (required filter expression)

PurchaseOrderProducts.PurchaseOrderId = PurchaseOrderId


Regards,

Benjith Sam

Solution

Adding to that solution by Benjith Sam, I also want to show you how easy it was to create master detail forms.

After you scaffolding the Purchase Order detail screen, just drag and drop PurchaseOrderProducts entity right below the Master Form.


Final screen:


That's it, no manual aggregates and filter.

Benjith Sam wrote:

Hi Elmar,


After analyzing the code I found that the filter which you have mentioned in your explanation "PurchaseOrderProducts.PurchaseOrderId = PurchaseOrdersId" is not the one which you have did in the actual filter 

SyntaxEditor Code Snippet (Actual implemented filter expression)

PurchaseOrderProducts.PurchaseOrderId = PurchaseOrders.Id


if you replace it with the filter which you have mentioned it will work as per desired


SyntaxEditor Code Snippet (required filter expression)

PurchaseOrderProducts.PurchaseOrderId = PurchaseOrderId


Regards,

Benjith Sam


Works like a charm! Thank you so much... I should probably stop with the "late-night-tired-mind" kind of projects lol minor detail, big solution! Highly appreciated!