Home » Developer & Programmer » Forms » I want to do following (how to create a form like this)
I want to do following (how to create a form like this) [message #641562] Tue, 18 August 2015 03:37 Go to next message
manisngpl
Messages: 42
Registered: December 2014
Location: Faisalabad, Pakistan
Member

Dear Members,

I have two Tables (Master and Detail) in database. In form level I have separated Detail table into two blocks and want to do the following.

please let me provide solution to do this. I use relationship using join condition but only one record in third detail block is inserted

Regards,

Usman


[MERGED by LF]
  • Attachment: PROBLEM1.JPG
    (Size: 59.54KB, Downloaded 1027 times)

[Updated on: Wed, 19 August 2015 00:14] by Moderator

Report message to a moderator

Re: I want to do following [message #641581 is a reply to message #641562] Tue, 18 August 2015 08:15 Go to previous messageGo to next message
CraigB
Messages: 386
Registered: August 2014
Location: Utah, USA
Senior Member
Quote:
In form level I have separated Detail table into two blocks and want to do the following.

Do "What" following? You don't give any details about what you are trying to do? Based solely on the attached image, it appears you have more items to display than you have "Width" of your canvas to hold, so you have stacked the items above and below each other. I think you would be better off only having 1 Detail data block, instead of 2, and simply arrange the items so they are stacked - like in your attached image file. By having 2 separate Data Blocks based on the same table, Forms will attempt to perform DML on both instances of the table. This could be the reason the data in one of the detail blocks is the only one being saved.

As to copying values from the Master block to the Detail block, take a look at the "Copy Value from Item" property of your Detail Block item.

I hope this helps, but to be honest, we need more information about how you have your Form configured in order to give you a better answer.

Craig...
Re: I want to do following [message #641593 is a reply to message #641581] Tue, 18 August 2015 22:55 Go to previous messageGo to next message
manisngpl
Messages: 42
Registered: December 2014
Location: Faisalabad, Pakistan
Member

Thanks Dear CraigB for you keen help. I'm really very sorry for incomplete information. However, detailed problem have clearly been described in new topic created today for your review and help please.

Regards,

Usman
Pakistan

How to create form Like this [message #641594 is a reply to message #641562] Tue, 18 August 2015 23:27 Go to previous messageGo to next message
manisngpl
Messages: 42
Registered: December 2014
Location: Faisalabad, Pakistan
Member

Respected Members Junior / Seniors,

I would like to create form like as shown below:

http://s30.postimg.org/a6q8fgndd/PROBLEM5.jpg

It looks like simple Master / Detail Form but I would like to create logic behind it that, when user enter data in this form (Cash Code in Master) and (Ac Code, Narration & Amount in Detail) then data inserted in database table should be as give below:

http://s15.postimg.org/6zpmey5aj/DATABASE.jpg

Please let me help in the matter.

Regards,
Muhammad usman
Re: How to create form Like this [message #641596 is a reply to message #641594] Wed, 19 August 2015 00:03 Go to previous messageGo to next message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Due to restrictions which apply over here, I'm unable to view images located on services like the one you use. Please, attach those images directly into your next message. In order to do that, don't use "Post Quick Reply" but "Reply" button (bottom right corner of every message) and - while in there - use [img] tags.
Re: How to create form Like this [message #641597 is a reply to message #641596] Wed, 19 August 2015 00:24 Go to previous messageGo to next message
manisngpl
Messages: 42
Registered: December 2014
Location: Faisalabad, Pakistan
Member

First File
  • Attachment: PROBLEM5.jpg
    (Size: 73.67KB, Downloaded 974 times)
Re: How to create form Like this [message #641598 is a reply to message #641596] Wed, 19 August 2015 00:25 Go to previous messageGo to next message
manisngpl
Messages: 42
Registered: December 2014
Location: Faisalabad, Pakistan
Member

Second File
  • Attachment: DATABASE.jpg
    (Size: 10.21KB, Downloaded 987 times)
Re: How to create form Like this [message #641600 is a reply to message #641598] Wed, 19 August 2015 01:19 Go to previous messageGo to next message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
So, for every record you enter into a form, you want to create two records in a database. Is that correct?

If so, one option is to create a database trigger which would create additional record. Another one is to do that in the form (POST-INSERT trigger, perhaps?).

Any approach you choose, think about the following: what will you do if someone modifies stored values (i.e. performs EXECUTE QUERY in the form or even do that manually in SQL*Plus) or delete some records - beware of discrepancy.
Re: How to create form Like this [message #641604 is a reply to message #641600] Wed, 19 August 2015 01:40 Go to previous messageGo to next message
manisngpl
Messages: 42
Registered: December 2014
Location: Faisalabad, Pakistan
Member

Thanks, but did you have any example of EXECUTE QUERY in the matter.
Re: How to create form Like this [message #641606 is a reply to message #641604] Wed, 19 August 2015 01:49 Go to previous messageGo to next message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Sure; once you're in a form, press the "Execute query" button in the form toolbar or press the Fx key on the keyboard (such as F11 or any other key that is mapped to that function) and it'll fetch records into a form.
Re: How to create form Like this [message #641610 is a reply to message #641606] Wed, 19 August 2015 02:01 Go to previous messageGo to next message
manisngpl
Messages: 42
Registered: December 2014
Location: Faisalabad, Pakistan
Member

thanks LF
Re: How to create form Like this [message #641721 is a reply to message #641610] Fri, 21 August 2015 00:35 Go to previous messageGo to next message
manisngpl
Messages: 42
Registered: December 2014
Location: Faisalabad, Pakistan
Member

I've inserted two records in database successfully using Post Insert trigger but when would I execute query in form it shows all the record in the table where master transaction code = detail transaction code

But I would like to show record as inserted. Please let me guide in the matter.

[Updated on: Fri, 21 August 2015 00:36]

Report message to a moderator

Re: How to create form Like this [message #641725 is a reply to message #641721] Fri, 21 August 2015 00:54 Go to previous messageGo to next message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Do those records (you inserted "manually" using a trigger) have the same transaction code as master block's transaction code? If not, they don't fit into master-detail relationship so you can't display them in that form.
Re: How to create form Like this [message #641727 is a reply to message #641725] Fri, 21 August 2015 01:51 Go to previous messageGo to next message
manisngpl
Messages: 42
Registered: December 2014
Location: Faisalabad, Pakistan
Member

It is compulsory for me to remain master block transaction coode = detail block transaction code. Is there any other solution?
Re: How to create form Like this [message #641728 is a reply to message #641727] Fri, 21 August 2015 02:12 Go to previous messageGo to next message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Ah, sorry, I misunderstood the question. You, actually, see those two records among all records that satisfy master-detail relationship, whereas you'd like to see only the newest two. Is that correct?

If so, there *is* a way to do that, only if you know how to distinguish newly created records from the ones that previously existed. You'd then use SET_BLOCK_PROPERTY and create ONETIME_WHERE which would contain condition that fetches only those two records.
Re: How to create form Like this [message #641729 is a reply to message #641728] Fri, 21 August 2015 02:35 Go to previous messageGo to next message
manisngpl
Messages: 42
Registered: December 2014
Location: Faisalabad, Pakistan
Member

Please see the attached Screen Short of problem:

In detail block there are duplicate records which I would not like to see when I execute query.

Is there any solution of this problem.
  • Attachment: PROBLEM2.jpg
    (Size: 64.94KB, Downloaded 838 times)
Re: How to create form Like this [message #641730 is a reply to message #641729] Fri, 21 August 2015 02:42 Go to previous messageGo to next message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Which items make master-detail relationship? At first glance, it is the ACC item. If that's so, detail block displays records whose ACC items are different from master block's ACC item value so I'd say that something is wrong (i.e. master-detail relationship isn't correctly set).
Re: How to create form Like this [message #641731 is a reply to message #641730] Fri, 21 August 2015 02:49 Go to previous messageGo to next message
manisngpl
Messages: 42
Registered: December 2014
Location: Faisalabad, Pakistan
Member

Relationship between Master and Detail block are set correctly. Please check the FMB File of module.

  • Attachment: MODULE1.fmb
    (Size: 120.00KB, Downloaded 1265 times)
Re: How to create form Like this [message #641736 is a reply to message #641731] Fri, 21 August 2015 04:12 Go to previous messageGo to next message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
What would I do with the FMB? I can't run it (as I don't have your tables nor data). I don't even know which Forms version you use (so I might not even be able to open the FMB).
Re: How to create form Like this [message #641737 is a reply to message #641736] Fri, 21 August 2015 04:30 Go to previous messageGo to next message
manisngpl
Messages: 42
Registered: December 2014
Location: Faisalabad, Pakistan
Member

Ok, actually I just would like to execute query in detail block where Detail Block Account Code (ACC) not equal to master block Account Code (ACC).
Re: How to create form Like this [message #641738 is a reply to message #641737] Fri, 21 August 2015 04:37 Go to previous message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
You can't (as I already told you). Those detail records' ACC doesn't match master record's ACC and can't be displayed in a master-detail form which has that relationship correctly set.

Think it over: what is the purpose of a master-detail form if you want to display - in the detail block - records that don't match its master? It just doesn't make sense.
Previous Topic: Need Help
Next Topic: WNRI
Goto Forum:
  


Current Time: Thu Apr 25 17:37:35 CDT 2024