Jump to content
Salesforce and other SMB Solutions are coming soon. ×

portal loosing records


Recommended Posts

synergy46

i ave 3 tables:stock-[, stock transactions, -[option transactions.

my lo is based on stock.  there is a tab object on the lo.  on ta, with portal for eac transaction table,  

problems: if i go from browse to edit and back i loose the records in the stock transactions portal.  ?????

but if i go to a lo based on stock transactions and view in list format, the records are there???

and the summary fields sum_bt_proceeds and sum _sld proceeds don't work.  got any ideas about this?

thank you.... ron

_stoxNoptions Copy.fmp12

Link to post
Share on other sites
AHunter3

You've got your foreign key (the field fk_stik_id) set to be an auto-enter serial.  Not supposed to do that.  Auto-enter serials are for primary keys, not foreign keys.

 

  Here's what happens:

a) You make the record spring into existence by typing in the portal.  At that moment, the field fk_stik_id correctly contains the same value as pkid, your primary key field in the stock table.

b) By changing mode, or leaving the layout, or just clicking outside the portal, you commit the record.  That triggers the auto-enter options and the field fk_stik_id gets overwritten with the next auto-enter serial value, making it no longer related to the stock record you're currently sitting on.  It still exists -- which is why you see it in list view on the stock_transactions screen -- but it's no longer a child of the stock record.

 

 

Link to post
Share on other sites
synergy46

perfect!!!! i spent 3 days working the problem; and you nailed it! thank you!  the fk_stk_id is a 'lot assignment mechanism whereby each buy or sell enyrt gets a unique id number that is used to match up orders,  for example a buy order stk_id =334 would be matched with a sell order by assigning that same 234 id to the sell order.  this allows for the calculation of capital gains or losses.  Do you know of a better way? thanks again.

Link to post
Share on other sites
AHunter3

The foreign key field should have no purpose whatsoever other than to match it to its own parent record in in the stock table.  

 

I am not understanding what you mean by this:

Quote

the fk_stk_id is a 'lot assignment mechanism whereby each buy or sell enyrt gets a unique id number that is used to match up orders,  for example a buy order stk_id =334 would be matched with a sell order by assigning that same 234 id to the sell order.

In the file you uploaded there is no Orders table or any other table that is linked to stock_transactions by being connected to fk_stk_id

 

Link to post
Share on other sites
synergy46
16 hours ago, AHunter3 said:

The foreign key field should have no purpose whatsoever other than to match it to its own parent record in in the stock table.  

 

I am not understanding what you mean by this:

In the file you uploaded there is no Orders table or any other table that is linked to stock_transactions by being connected to fk_stk_id

 

fk_stk_id is simply an 'auto generated serial ' that allows(sell orders to be matched to pre existing buy orders( to determine the tax basis & capital gain)    I introduced new fk field and it works great.  thank you very much for finding the problem.   :-))

Link to post
Share on other sites
synergy46

It turns out that I should create an aggregate sum function in the parent table(stock) and simply sum the appropriate fields in stock transactions table.  

I am curious why the sum calculated field has to be in the parent???

_stoxNoptions Copy 1.fmp12

Link to post
Share on other sites
AHunter3

The parent record is the appropriate location to add together all the associated child records.  The total isn't a feature of any individual child, it's a feature of the cluster of them taken as a whole.  

 

Edited to Add:  Think of it like a test grade.  Each question gets a value if it is answered correctly.  The test score is the sum of all those numbers.  But the test score belongs to the TEST.  Not to the individual questions.  Even though the place the data comes from, the data that's being summed up, IS per the individual question.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

Terms of Use