Subject Re: knowledgebase help
From Akshat Kapoor <akshat.kapoor@kapoorsons.in>
Date Wed, 9 Oct 2019 15:33:46 +0530
Newsgroups dbase.getting-started

On 09/10/2019 14:58, prem shah wrote:
> If I have undermentioned table
>   Purchase.dbf
> Fields
> 1.Pcode … 10.(n) … pcode stand for particular party linked with supplier(purchase_partylist).dbf in which we store the details of supplier and in purchase with the help of data-module fetch and replace the details of supplier in purchase.dbf.
> 2.Item code … 10..(n) item code stands for all the item in stock.dbf in which we store all the details of item stock  i.e. item code , item description, Purchase rate,Sales rate, item unit,(item),qty, (qty= unit*qty means total qty),opening stock,purchase qty,sales qty, balance which Is next opening stock (here only one field will do but for the purpose of calculating and showing years opening stock separately,) etc.

The above lines relate to table structure and hence no comment is required.

> 3.If I purchase some item from a supplier in the same bill …and I want to enter each item separately in the same bill how I can enter it in a form ( I need example). And at the same time if I save the purchase.dbf record  I want to replace the item purchase_qty in purchase.dbf and stock.dbf in resected fields... how I can do these? I don’t prefer look up table or line-item entry or edit. But the other-way by codding .
Option 1
I will tell you some commands and brief descriptions, Go to the help
file for detailed description.
findkey() , applylocate() These are used to find a particular record in
the rowset. findkey() uses an index to find the row applylocate()
doesnot require an index.
Once you have located the particular record use beginedit() to change
the required values and save() to save the changes.

Option 2
Use xdml commands
use table
goto / seek
replace
All these commands work the same way as in old dbase.

Option 3
Use a sql command
update table set field1 = field1+Qty where keyfield = "key field"

> 4.And also the concern amount in related party_account or other account(various amount,and account like SGST amount,CGST amount or IGST Amount(various taxes),discount,intrest,charges, net to pay etc) .  .. the same style of code or you can give example)
> 5.My thinking codding at the time of custom component toolbar (in Save) the codding should be there or in form creating with data-module .
> 6.I am stuck here.
> 7.And codding I am stuck.

Have you gone through Ken's Tutorial. Please read and develop that code.
You will learn how to set up entry fields. If you just read through the
lines you will forget how things are done.

Data modules just open all your tables for you.
For eg. the tables required in invoice form and print invoice are the
same. So using a datamodule makes sense. The same datamodule is reused
in the report.

I will recommend starting from a small form with only 1 table involved
so that you get a hang of how things work. When you go in for purchase
entry or sales entry forms, they require multiple tables and hence a
little bit more cumbersome.


And if you are stuck in some coding send us the form and related tables
with specific problem.You will get help

Regards
Akshat