Help with relational button script
I have two tables. Opportunities and Quotes. Opportunities has a parent key of (k_ID_Opportunity) Quotes has a child key of (kf_ID_Opportunity) These have a one to many relationship 1 opp to many quotes.
In my opportunity Record Detail, i have sucessfully inserted a portal which displays only the related quotes. Where my issue lies is i am trying to create a button which lets you create a new quote, and relate it to the current opportunity without having to manually populate the (kf_ID_Opportunity) field in the quote detail.
So far i have only been able to create a new quote, but i cant get it to populate the child key to match the opportunity which the button is pressed in the opportunity from. Here is my code, i have mixed this around with no luck. Please help me with whats wrong.
Set Variable [$ID_Opportunity; Value:Opportunities::k_ID_Opportunity
Go To Layout [Quote Detail" (Quotes)]
Set Field [Quotes::kf_ID_Opportunity; $ID_Opportunities]
Commit Records/Requests [No dialog]
Go to Next Field
im guessing the issue is in the SET FIELD section, but have tried a couple combos and cant get it to work.
THANKS FOR THE HELP!