Home » Developer & Programmer » Forms » Master Detail Problem
Master Detail Problem [message #136068] Mon, 05 September 2005 21:11 Go to next message
samit_gandhi
Messages: 226
Registered: July 2005
Location: Hong Kong
Senior Member

Dear Sir,

I have a master detail form. In detail form i have two records in it. Now i want to insert the another one record in the same detail block. It gives me error for unable to insert the record. How to solve the problem.

Another thing i have done is i have put one repeat column which will be incremented each time when other detail item has been inserted then it will inserting all three rows in the database. I need only one row which i have just added in the detail block.

How is it possible?? It is urgent pls help asap.

Samit Gandhi
Re: Master Detail Problem [message #136071 is a reply to message #136068] Mon, 05 September 2005 21:46 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
You say
Quote:

I have a master detail form. In detail form i have two records in it. Now i want to insert the another one record in the same detail block. It gives me error for unable to insert the record. How to solve the problem.


Did you use the master-detail wizard to build and link your blocks? If not, then I suggest that you rebuild your form using the wizard. Bascially, the detail block is not getting its values populated properly by the master block.

You say
Quote:

Another thing i have done is i have put one repeat column which will be incremented each time when other detail item has been inserted then it will inserting all three rows in the database. I need only one row which i have just added in the detail block.


I expect that you are repopulating an already populated field. This is probably your 'sequence number' field. Always test that the field is 'null' before you populate it.

David

[Updated on: Tue, 06 September 2005 01:56]

Report message to a moderator

Re: Master Detail Problem [message #136098 is a reply to message #136071] Tue, 06 September 2005 01:43 Go to previous messageGo to next message
samit_gandhi
Messages: 226
Registered: July 2005
Location: Hong Kong
Senior Member

Dear David,

I am taking one master detail form as a calling form of an another form and taking the global values from the main form as the execute_query field. When i am using the master detail form as separate than it works properly but when i am using it as a calling form than it gives unable to insert error.

samit
Re: Master Detail Problem [message #136104 is a reply to message #136098] Tue, 06 September 2005 01:59 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Because you already have the records locked for update in the first form.

What is your objective with opening the form a second time on the SAME record? You should not try to update the same record in two places - the logic becomes very messy.

David
Re: Master Detail Problem [message #136107 is a reply to message #136104] Tue, 06 September 2005 02:17 Go to previous messageGo to next message
samit_gandhi
Messages: 226
Registered: July 2005
Location: Hong Kong
Senior Member

Dear David,

I have tab canvas issue and return. this both are master-detail. When some issue is done the entry has been made in issue form. At the time of return the material comes return and there are some possibility to issue again some material on the same order. So i have created one another form subform which is a calling form at the time of return.

Now when i am using the subform as it is than there is no problem in record but when i am using subform at the return time it is not allowed me to enter record.

this is the scenerio i am facing since 7 days.

pls help me.

samit
Re: Master Detail Problem [message #136235 is a reply to message #136107] Tue, 06 September 2005 19:29 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Okay ... I want you to try this ... move your tab canvas down the window by changing its 'origin properties' and put a new content canvas for the top third of the screen.

Put the master block on the content canvas and only have the detail blocks on the two tabs of the tab canvas. This means that you only have three blocks in your form - master block, issue block, and return block. Therre will be two relationships defined to link the two detail blocks to the master block.

Samit, please try this in a new form. Using a COPY of your current form may take longer than starting from scratch.

Get back to me as soon as you can with any issues this raises.

David
Re: Master Detail Problem [message #136260 is a reply to message #136235] Wed, 07 September 2005 02:43 Go to previous messageGo to next message
samit_gandhi
Messages: 226
Registered: July 2005
Location: Hong Kong
Senior Member

Dear David,

I have done as per your instruction than also there is a same problem.

Samit Gandhi
Re: Master Detail Problem [message #136261 is a reply to message #136235] Wed, 07 September 2005 02:48 Go to previous messageGo to next message
samit_gandhi
Messages: 226
Registered: July 2005
Location: Hong Kong
Senior Member

Dear David,

Instead of tab canvas i have created two forms issue and detail. Now what i am doing i am putting a radio button in detail form asking need more issue or not. If not than it saves the record and if issue require than i am calling for issue. At calling time i am taking the primary key value in the global and in issue form i am assigning the primary key value to the issue forms primary key value and execute_query for getting the earlier records.

Everthing is doing but execute_query is not doing. I dont know why?

Pls reply immediately.

Samit
Re: Master Detail Problem [message #136388 is a reply to message #136261] Wed, 07 September 2005 20:49 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Try doing an 'enter-query', then assign the 'global' values to the fields, then do 'execute-query'.

Alternatively, use 'new_form' instead of 'call_form', that way you will only have one form accessing your master block at any one time.

David
Re: Master Detail Problem [message #136402 is a reply to message #136388] Wed, 07 September 2005 21:53 Go to previous messageGo to next message
samit_gandhi
Messages: 226
Registered: July 2005
Location: Hong Kong
Senior Member

Still there is no effect. The form work like as it is.

Pls help me immediately.

samit gandhi
Re: Master Detail Problem [message #136403 is a reply to message #136402] Wed, 07 September 2005 21:57 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
How many forms do you have?

How many blocks are in your form? Give names.

What triggers do you have on your blocks?

Answer and I will ask more.

David
Re: Master Detail Problem [message #136405 is a reply to message #136403] Wed, 07 September 2005 22:13 Go to previous messageGo to next message
samit_gandhi
Messages: 226
Registered: July 2005
Location: Hong Kong
Senior Member

In My issue form i have three blocks:

1)issue :
Block level Trigger :
on-populate-details
on-check-delete_master
post-update

2)issue-detail :
post-insert
when-new-record-instance
post-update

3) control :(it is a control block)

In my return form i have four blocks :

1) RETURN_MASTER :
Block level Trigger :
on-populate-details
on-check-delete_master
post-update

2) RETURN_DETAIL
post-insert
when-new-record-instance
post-update

3) ISSUE (this block is used for fetching the issued records) i have made the manual relation with return_master)

post-insert
when-new-record-instance
post-update

4) CONTROL (It is a control block)

Samit Gandhi
Re: Master Detail Problem [message #136406 is a reply to message #136403] Wed, 07 September 2005 22:39 Go to previous messageGo to next message
samit_gandhi
Messages: 226
Registered: July 2005
Location: Hong Kong
Senior Member

At the time of calling form, i am only able to insert the record in detail block. I can not change the master block as well as the records which are already inserted in the detail block.

Please reply immediately i am waiting for that.

Samit Gandhi
Re: Master Detail Problem [message #136407 is a reply to message #136405] Wed, 07 September 2005 22:50 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
In your 'issue' form, what code do you have in your post-update and post-insert triggers? Where do you create your primary key?

In your second form, you say 'i have made the manual relation with return_master'. It it possible to use the 'relations' wizard to 'link' them? Again, for this second form, what code do you have in your post-update and post-insert triggers? Where do you create your primary key for return-master and return-detail?

David
Re: Master Detail Problem [message #136412 is a reply to message #136407] Wed, 07 September 2005 23:08 Go to previous messageGo to next message
samit_gandhi
Messages: 226
Registered: July 2005
Location: Hong Kong
Senior Member

in my post-update trigger i am updating the updated_by,updated_date and time nothing much. In my post-insert i am inserting one more row in the another table for maintaining the stock.

In my second form the relation is made to get the record of issued material and it is a database block. and it is also possible to make the relation directly.

samit
Re: Master Detail Problem [message #136416 is a reply to message #136412] Wed, 07 September 2005 23:22 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
If you are placing the 'updated_by, updated_date and time' information into fields in your block then do it in a 'pre-' trigger. If you are using an update statment then I suggest you use non-display fields in the block instead.

Second time: When do you create your primary key?

In another copy of your form please try using the wizard to create the relation between 'return_master' and 'issue'.

David
Re: Master Detail Problem [message #136417 is a reply to message #136416] Wed, 07 September 2005 23:34 Go to previous messageGo to next message
samit_gandhi
Messages: 226
Registered: July 2005
Location: Hong Kong
Senior Member

i have tried to make it with wizard also. And the updated_date,time and updated_by is not selected in the database block but it is still in teh database so i am updated it manually in post-update trigger. I have no primary key in return detail table.

samit
Re: Master Detail Problem [message #136419 is a reply to message #136417] Wed, 07 September 2005 23:42 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
You say "i have tried to make it with wizard also." DID THE WIZARD SUCCESSFULLY CREATE THE RELATIONSHIP? Yes or no?

I suggest that you 'select it' into the database block and populate it in the pre-update. This will half the number of updates to your table.

What is the primary key of the 'return' table? How do you populate it? And how do you get it into the 'return_detail' table entry?

David
Re: Master Detail Problem [message #136422 is a reply to message #136419] Wed, 07 September 2005 23:54 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
In a previous post I said:
Quote:

Alternatively, use 'new_form' instead of 'call_form', that way you will only have one form accessing your master block at any one time.


Have you tried this yet? If not, please give it a go. And by 'master' block I should have said 'issue' block.

David
Re: Master Detail Problem [message #136435 is a reply to message #136422] Thu, 08 September 2005 01:05 Go to previous messageGo to next message
samit_gandhi
Messages: 226
Registered: July 2005
Location: Hong Kong
Senior Member

Dear Sir,

I am confused with this. Can u correct my form i can send u both the fomrs pls confirm.

Hoping for the positive reply.

thanks in advance

samit
Re: Master Detail Problem [message #136436 is a reply to message #136435] Thu, 08 September 2005 01:12 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
I'm truly sorry but I am not permitted by the installation at which I work to download anything except Word documents and flat files.

What I am asking you to do is to change the 'call_form' to a 'new_form' and then instead of doing an 'exit' from the called form, write a second 'new_form' to go back to restart the first form. You can either use parameters or continue using the globals that you have been using.

Also, please answer, 'What is the primary key of the 'return' table? How do you populate it? And how do you get it into the 'return_detail' table entry?'

David

Re: Master Detail Problem [message #136445 is a reply to message #136436] Thu, 08 September 2005 01:54 Go to previous messageGo to next message
samit_gandhi
Messages: 226
Registered: July 2005
Location: Hong Kong
Senior Member

The primary key is item_no in issue master and foreign key for issue detail. The primary key in return master is also item_no and the foreign key for return detail.

samit

Re: Master Detail Problem [message #136447 is a reply to message #136436] Thu, 08 September 2005 02:04 Go to previous messageGo to next message
samit_gandhi
Messages: 226
Registered: July 2005
Location: Hong Kong
Senior Member

Dear Martin

i have tried with the new_form but there is no effect in the form.

I think u r also tired from me for this que. Sorry but i am in big problem with this form as every thing is stuck due to it.

If possible try to come online on yahoo or msn. my ids are :
samit_gandhi@yahoo.com
samit_gandhi@hotmail.com

Waiting for your reply.

samit
Re: Master Detail Problem [message #136449 is a reply to message #136445] Thu, 08 September 2005 02:08 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Okay you answered the first question 'What is the primary key of the 'return' table'. It's 'item_no'.

Now, please answer, 'How do you populate it? And how do you get it into the 'return_detail' table entry?'

What I want to know is, how do you get the 'item_no' from the master record to the detail record? You have to populate the 'item_no' in the detail entry so that it 'is associated' with the entry in the master record. It doesn't matter whether it is 'issue' or 'return'. I believe that the lack of populating of this field is the cause of your problems.

David
Re: Master Detail Problem [message #136460 is a reply to message #136449] Thu, 08 September 2005 02:38 Go to previous messageGo to next message
samit_gandhi
Messages: 226
Registered: July 2005
Location: Hong Kong
Senior Member

in the detail table i have given the reference key of master table i.e. issue_no only and for issue block i have given another field design_no which is comman & unique though out the process of the material. like wise i have created the relation between the blocks and populating the detail blocks.

samit gandhi
Re: Master Detail Problem [message #136463 is a reply to message #136460] Thu, 08 September 2005 02:43 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Samit,

I have to go. Please prepare a Word document with the table definitions for your application, some sample data (screen shots are okay - make sure they are 256 colour only), and attach it to your reply. I will look at them tomorrow.

David
Re: Master Detail Problem [message #136465 is a reply to message #136463] Thu, 08 September 2005 02:45 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Or use the URL feature of this system to point me to the thread in which you previously defined your data structure.

David
Previous Topic: FRM-40039 Cannot attach library webutil
Next Topic: Scrollbars
Goto Forum:
  


Current Time: Thu Sep 19 22:37:23 CDT 2024