Creating a relation

Hi All,

I have taken 2 tabls called “enquiry” and “Task” , for these 2 tables i have created Card & List forms …

In d Enquiry table i have 2 fields like “Status” and " task" , so i wanna change these fields from d “task-card form”.

when i change d task every time, instead of modyfying d Existing Status , it shd add a new record corresponding for each enquiry…

My req is just like a Relation between Customer&Customer-Ledg-entrys forms. As in Nav , frm each customer-record in d cust-list , we have access to cust-ledgr-entrys.

Wht i mean is , i am openg a cust-ledgr-entrys card form , where i can change some fields of d Customer-rec. As i change some fields , it shd add a new record in d cust-ledgr-entrys -List , instead of modyfying d existing one…At d same time , these changes shd also be reflected in Cust-card.

I Hope u people get clearly my req…

Pl z help me in solving my prob…

Regards

Venu

Check the properties on the form for the sub-table.

Have you written any code in the table or in the form triggers?

Hi Venu,

I’m not sure i get your request…

You have 1 table called enquiry.
In this table you have x records, each have a Task assigned, and a status (which i guess is inherittated from the Task-table).
Say you have 5 records in enquiry, that have task-code XPQ assigned, that all have status = Draft, because that’s inheritted from the Task.
Now you change the Status in the Task to Active, and that should result in 5 new records in Enquiry-table, all with Task XPQ, and status = Active.
So now you have a total of 10 records in Enquiry-table with the Task-code XPQ. 5 with status = Draft. 5 with status = Active.

Is that correct?

In enquiry table d Status & task are optional fields , vth default values of Active . As u said i have 5 records in d Enquiry table .

Say for 1st enquiry , i wanna change task field from d Task-card form , when i save tht record , it is updating d Task field in d task-List for tht enquiry , but i wanna add a new record in d Task-List , as i change d task field…

In the Task-Id -Onvalidate trigger , am checkng a cond tht ,

task rec.setrange(taskrec.taskid,rec.taskid);

if taskrec.task <> rec.task then

exit(rec);

In d ONINSERT of Task table

new task := rec;

rec.insert;

I am not sure is it write or not , but am tryng in this way…

Hi Venu,

I’m still a little confused.

If my understanding of your request is correct, i think you only need to press F3 in the Task-card, instead of changing the task-code in an existing record.
Given that the correct table-relations and runform-link’s have been defined.

What i don’t quite understand though, is if an enquiry can have more than 1 task assigned, then why do you have a task-field on the enquiry-table,
I think you need a 3. table to store the enquiry/task. Because as i understand it, 1 enquiry can have more task’s, and 1 task can be assigned to more enquiry’s.
Then of course you can make a “Next Task”-field in the enquiry-table, that looks up the enquiry/task-table for the first task with status Active.