Hi all
We have the following situation. We have accounts, and related accounts (daughter account), To show daughter account or related accounts we add a Tab in the detail section of the Master Account.
To explain it, the main accounts we have called mother accounts and related accounts, we call them daughter accounts. A Mother can have zero, one or more daughters, but a daughter can NEVER have a daughter.
We need to restrict to users to create a related account from a daughter account (a daughter account from a daughter account). When we create the first daughter account we copy the data from mother, but when one mother have at least one daughter account, the sister is created by a copy from the newest one (we got this using a LastDaughterAccountID field in Accounts Table)
To implement this we add two fields to the accounts table:
1.- The Id of the Mother Account (this field is filled only on daughter accounts)
2.- The Id of the last daughter account (this field is only filled on the mother account)
The problem we have is that we need restrict to create daughter account form a daughter account, to do this we hide the tab in the init method when the account is a daughter account (in this way we hide the new button), this tab is only visible if LastDaughterAccountID had data (means the record is mother), when we create a daughter account the Tab hides, but when we save and close the daughter account and returns to mother account the tab remains closed, how can we do to show the tab?, I we did a refresh (F5) it solves, but this is not the way we need to resolve this.
Thanks in advance,
Julio Falcón, from Chile