Hello! Objective: send a book to a potentia...

references
(Benoit Gramond) #1

Hello!

Objective: send a book to a potential customer.

I have 2 tables:

1 - books 2 - customers

In my table 1 - books, I have a column “sent” and a virtual column “last email”. The virtual column is populated with the LASTROW email from 2 - customers.

When I add a customer (and select the book at this time) I want it to be sent to this customer.

My workflow to update the tables 1 - books works, when I add a customer and select the book (reference), it add + 1 to the column “sent”.

All the workflows work when I test them separately and when I add a customer it add 1 to my column “print” but this change is not taken into account and does not trigger the email.

Is it normal ?

(Philip Garrett) #2

@Benoit_Gramond

I strongly suggest that you add a third table called Order.

The Order table would contain a Ref field to the Customer who placed the order and a Ref field to the Book they ordered. The Order record would probably contain other information about the order such as the date the order was taken, the shipping status, etc.

Each time you take an order you would create a new Order record.

The workflow would be triggered by adding a new Order record.

If a customer is able to order two or more different books in a single order, then you should add an OrderDetail table. It would contain one record for each unique Book contained in the order.

To see how this works in detail, take a look at the Order Capture sample application.

(Benoit Gramond) #3

@Philip_Garrett_Appsh Good recommendation. I will do this. In that case I will be able to make a template using the related order details and book details so it will solve my problem.

(Benoit Gramond) #4

@Philip_Garrett_Appsh I created the REF with isPartOf = true so it works perfectmy. I also created a Duplicate action do create a copy of an Order. Woud it be possible to directly create the order details when I duplicate an order?