Topic: help with my app

when i make new invoice from order and save that invoice in table invoice some fields are empty? what i do wrong ?

Post's attachments

Attachment icon IGMAapp.zip 951.92 kb, 34 downloads since 2025-03-19 

2 (edited by k245 2025-03-20 06:20:06)

Re: help with my app

Please show a screenshot where it is happening (I did not find the "Invoice" and "Order" tables). If this is a new feature, then to create a new record based on records in another table, you will need a script with an SQL query. And an explanation of where in the interface you want to add this and which tables to use.

Визуальное программирование: блог и телеграм-канал.

Re: help with my app

Hi,

sorry, here are some pics

Post's attachments

Attachment icon Picture 1.jpg 392.83 kb, 12 downloads since 2025-03-20 

Re: help with my app

picture 2

Post's attachments

Attachment icon Picture 2.jpg 305.1 kb, 12 downloads since 2025-03-20 

Re: help with my app

picture 3

Post's attachments

Attachment icon Picture 3.jpg 270.12 kb, 10 downloads since 2025-03-20 

Re: help with my app

Hello Igor, Konstantin,
Although you have created relationships in your Data Schema between the tables Racuni / Nalozi and Racuni / Kupci, you are not actually populating values for these relationships on FormNoviRacun.
Depending on your process flow / logic, MVD normally populates these relationships for you (I think Kupci > Nalozi > Racuni would be the expected process flow).  But because your processing logic is not like this, you need to populate values for the relationships yourself by using a small script (see the attachment).
If you use a utility like SQLiteStudio, you would be able to see where various relationships were not being populated.  Alternatively (and just while you are developing your application), you could create a form with tablegrids that show all the fields in every table;  this would also show you where the problems could be. 
On FormNoviRacun, I have added Combobox1 and Combobox2 and these are filled with relevant IDs to the Kupci and Nalozi tables;  the relevant columns on FormRacuni should now be populated and showing in the tablegrid.  There may well be other parts of your project where you are having similar issues.

As mentioned in an earlier post, I would suggest you review the whole processing logic of your project as the flow from form to form seems (at least to me) to be overly complicated and disjointed.  This, in turn, will likely lead to more problems as you further develop your project.
Regards,
Derek.

Post's attachments

Attachment icon IGMAapp a.zip 948.46 kb, 40 downloads since 2025-03-20 

Re: help with my app

Thank you for advice
When i make
Kupci>Nalozi>Računi relationship i got error on screenshot and all Kupci(Customers) are on same Račun(Invoice).
Can you give me example how should i make relationship correctly?
I appreciate any help

Thank you

Post's attachments

Attachment icon IGMAapp1.jpg 289.79 kb, 17 downloads since 2025-03-22 

Re: help with my app

Hi
I am unable to replicate your error.
You need to attach the latest version of your project and explain the exact actions you take up to the point that you get the error.
Also, was it working before and you changed something or has it always given this error.
The more information you can give, the better any help that you receive will be - otherwise it's not much more that guessing.
Derek.

Re: help with my app

Hi,

i try, like you say, remake relationship but when i try to save Invoice i get error.
Can you please try my app and advice me what i do wrong.
now relationship is Customer>Order>Invoice

Thank you

Post's attachments

Attachment icon IGMA005.zip 951.04 kb, 19 downloads since 2025-04-04 

Re: help with my app

Hi Igor,
The error message is because you have not created a relationship between the 'customer' and 'invoice' tables.
You also need to populate 'FormUnosNovogNaloga.ComboBox1' (line 11 in the script).
This will fix the error that you are getting.
However, there are a lot of other things that are not correct with your project.
As I understand it, your project should, at its most basic
1. add / edit / delete customers
2. add / edit / delete an order for a customer;  this order can have one or more order line
3. add / edit / delete an invoice for one or more order lines that have been delivered to a customer.
As I have mentioned before in earlier posts, until you have this basic functionality working correctly, you should forget about features like coloring grid lines, product images, messages, database backups etc etc;  they can all be added later.
I would also strongly suggest you rewrite - at the very least - FormUnosNovogNaloga and use two separate forms instead (one for orders and one for invoices).
Derek.

Re: help with my app

Hi,

thx for reply, i will try to go from start and make it simply,.But i got stuck again in start of making simply app.
Why on TableGridOrderItems shows all items instead of selected?

Igor

Post's attachments

Attachment icon IGMAnew.zip 342.03 kb, 12 downloads since 2025-04-14 

Re: help with my app

Hi Igor,
Have a look at the attachment which, I believe, does the basics of what you need your application to do.  As mentioned earlier, if this is working, then you can add extra features later on.
The example allows
1.  clients can have multiple orders
2.  clients can have multiple invoices
3.  orders / invoices can have multiple order / invoice lines
4.  orders / invoices can initially be created with no lines if that is a requirement
5.  order lines can be partially invoiced
6.  order lines from different orders can appear on the same invoice
If your requirement was only for one order line = one invoice line, the data schema would be more straightforward but I don't know if that's the case.
Regards,
Derek.

Post's attachments

Attachment icon igor.zip 447.58 kb, 19 downloads since 2025-04-19