I'm working on sample dApp application to understand the working of multi_index table in EOS smart contract. I have defined two multi_index table. The primary key of table1 is auto incremented using "primary_key()". The table two has one column which refers to primary key of table1 (like foreign key in DB). I have a sequence where I first add an entry to table1 using eos-go and then need to create an entry in table2 with retrieving inserted primary_key in the table1. I don't find a way to fetch the auto incremented primary key after completing create transaction to table1.
Is there any way to fetch/return last inserted primary key like in sql in EOS smart contract?