AnsweredAssumed Answered

Navigate by script to Portal in tab

Question asked by PeterDowns on Aug 25, 2011
Latest reply on Aug 29, 2011 by philmodjunk


Navigate by script to Portal in tab



thanks for all your advice in previous postings it has been tremendous.

I have a parent layout "Record Detail - Projects" with a series of tabs containing portals. This is all good. What I am trying to achieve is on tab1 -  portal 1 I have projected costings for future activities. On tab 2 - portal 2 as the activites occur they type in their actual costings. So to promote laziness and avoid user frustration I have set up a script that copies a record from the projected costings and puts it into the actual costings records. This script is activated by a button from a record in portal 1.

I have tried it 2 ways - 


I did a Copy Record/Request and then set the fields with all the values.

Copy Record / Request
Set Field [Project_RelatedTasks::Name_Task; ProjectedCosts::Name_Task] 
Set Field [Project_RelatedTasks::Qty; ProjectedCosts::Q] 
Set Field [Project_RelatedTasks::Task_Cost; ProjectedCosts::ItemCost] 
Set Field [Project_RelatedTasks::Description; ProjectedCosts::Description]  
Commit Records / Requests [Skip Data entry validation] 

This worked perfectly except it copied the values over the first existing record in the actuals list in portal 2, rather than in a new record.

2nd way

I used this Script:
Set Variable [$TaskName; Value:ProjectedCosts::Name_task]
Set Variable [$Q; Value:ProjectedCosts::Qty]
Set Variable [$Cost; Value:ProjectedCosts::ItemCost]
Set Variable [$Descript; Value:ProjectedCosts::Description]
Go To Layout ["Record Detail - Projects"(Projects)]
Go to Field [Project_RelatedTasks::Name_Task]
Go to Portal Row [Select; Last]

New Record / Request
Set Field [Project_RelatedTasks::Name_Task;$TaskName]
Set Field [Project_RelatedTasks::Qty;$Q]
Set Field [Project_RelatedTasks::Task_Cost;$Cost]
Set Field [Project_RelatedTasks::Description;$Descript] 
Go to Portal Row [Select; Last] 

This worked well and put it in portal 2 but created a whole new project record rather than in the existing portal record.

Because both portals are on different tabs they are still both on the same layout - "Record Detail - Projects"
So I need some help in placing the data into a new record in portal2 in the existing project. Any ideas??