My problem is appearing product from another vendor is appearing with current vendor within any Purchases(orders)

Hello, For one week I am trying to create a Multi-vendors e-commerce but I have a problem with that.
My problem is, I need to help the vendor to see all products from the purchases Type(table) that are purchased from a specific user.

But the vendor when choosing any user the result is (appear all product purchases from this user for the current vendor but also appear all products for another vendor ).

I need to appear only current vendor products and already purchased from this user without appearing any purchases for another vendor product.

I get down database structure for each type:

Vendor Type:

Purchases Type:

Product Type:

Here Design Repeating Group for the Product:

Here Continue Repeating Group for the Purchases and appear from parent RG Product:

Output to choose any customer has bought from the current vendor:

Now my problem will appear here:
the Oppo78 product for current vendor but 11111 product for another vendor and need to remove it

Thanks all

If you’re doing this via searches then you must add a constraint. You could do this so that the RG only adds in data that is 'vendor=" which will ensure only the vendor chosen is the vendor data shown.

In addition, you’ll need to set this up as a privacy rule for Live Use!

I think you need to set up a privacy rule that checks that ‘this user is’ but this will not work if it’s a list!! You’ll need to have a ‘Vendor’ field in the user record to allow this and if you feel that in the future, a user can have more than one ‘vendor’ then you could make it an ‘active vendor’

Hope this vaguely helps!

By your first solution :
I was trying to create RG for Purchases and then make a constraint by

creator = Parent group’s user
Vendor contains current user

But in Vender I have an error from the bubble and tell me to do more
Check this please:

This user Type and already created vendorProfile
you meant that ?

I used this But still my problem appear :

And please tell me which one must use Privacy rules. purchases type or what?

Also, what must write condition be?

It’s a list of vendors, does it need to be a list for a purchase? If you make the purchase/order a singular Vendor then the constraint method would work a treat.

If you constrain purchases by ‘created by’ then that would work to show only purchase for the selected user. I tend to use a seperate field to created by as you may have need to add a record manually or for someone else to do it for someone else potentially, so I normally add in a ‘user’ into a record as a separate list. That will also help with privacy and giving you the change to move purchases to different users

It maybe worth looking at the structure,

In my mind:

A Purchase/Order has a list of Purchase/Order Lines, with a singular reference to the ‘Customer/User’, no link to Vendor (if multi vendor purchases per order) or Vendor reference (If singular vendor per Order)

A Purchase Line has a singular vendor, product, customer/user, qty, unit price and line price and field back that links back to the purchase/order

You could then do a search for Orders/Purchases, that has a First Item not Empty on a search for Orders, Each Items ORder ITems, Customer/User = Selected Customer User. This will then only return the Orders/Purchases that have an order item that matches that user.

If you only want to see the items ordered/purchase lines by that user/customer, do a search for purchase lines, constrained by the user and that will return just the order items, not orders but ones relevant to the vendor.

This maybe a little more granular that you need right now.

(Don’t use count, use first item not empty, maybe really important with the upcoming WUPOCOLYPSE )

This topic was automatically closed after 70 days. New replies are no longer allowed.