Hi community,
i have create 2 entities : Contract entity ( with total quantity field TQ )and Quantities (with quantity field) with a relation
how to setup the business rule : Q1+Q2+...+Qn=< TQ ?
Thank you
Hi @omaranfer ,
Could you tell me:
Where do users submit data?
I assume that users submit data using canvas app.
Firstly, business rule may not be able to achieve your needs.
However, you can use the canvas app to meet your same needs.
Please refer to the steps below:
1\ This is my table 'Test 77'.
2\ This is my table 'Test 888'.
3\ Add a textinput control 'TextInput1' .This control allows the user to enter a number. The number is the value of the quantity column.
4\ Add a button control in canvas app and set its onselect property to:
If(Sum('Test 888S',quantity)+Value(TextInput1.Text)<=First('Test 77S').Total,Patch('Test 888S',Defaults('Test 888S'),{Name:"Test",quantity:Value(TextInput1.Text)}),Notify("error",NotificationType.Error))
5\ The result is as follows:
Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.
Hi,
Thank you for your answer.
Sorry but didn't give you precisio about how i submit data, I'm using a model driven apps.
When I add a new Quantity in the quantities Table, I have to verify if the TQ >= Q1 + Q2 +...+Qn if not I have to display an error message.
Regards
Hi @omaranfer ,
Business rule is difficult to achieve your needs.
You could embed the canvas app I mentioned above into the model driven app.
The user uses the embedded canvas to submit data instead of the submit button that comes with the model driven app.
Another method is flow.But it will first create a record and then judge whether the record meets the conditions.
If the record meets the conditions, the record will be kept.
If the conditions are not met, the record will be deleted automatically.
There is a disadvantage of using flow. If the user enters the wrong information and submits it, after the flow deletes the record, it cannot directly display the error message in the model driven app.
You can remind users by sending emails to users(use flow ).
You could choose one from two methods.
Then I will provide you with specific solutions.
Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.
Thank you for you anwser.
I think that the solution will not fit from the UX perspective, because the user has to submit twice the same form.
I'm thinking if I have to implement a portal solution, but I wonder if I can use a business process in a portal solution ?
Regards
User | Count |
---|---|
251 | |
248 | |
82 | |
45 | |
30 |
User | Count |
---|---|
338 | |
260 | |
123 | |
62 | |
58 |