Problem with SwitchForm and assigning field values

Hi All,
I'm having problem with the following action code . The record is opened (in Read mode) as a leadForm with various fields displayed. The action button is supposed to switch the form so more fields and info are displayed, then assign a couple of values and leave it open in Edit mode so the user can add more information. The problem is that once the switchform happens, non of the fields get assigned their values.


tmperror :="This record is not a Lead."+@Char(10)+"Initiate Proposal cannot be done.";
@If(status="L";
 @Do(
 @Command([SwitchForm];"proposalForm");
 @Command([EditDocument]);
 FIELD Form := "proposalForm";
 FIELD status := "P";
 FIELD pdate := @Now;
 FIELD pauthor := @UserName;
 FIELD pname := lname;
 FIELD pepf := lfee;
 FIELD pdollar := ldollar;
 @Command([ViewRefreshFields]);
 FIELD SaveOptions :="1";
 @Command([FileSave])
  );
@Prompt([Ok];"Error";tmperror)
)

--cheers
Andrew
manta357Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

HappyFunBallCommented:
Are you using R6?  If so, try using the @UpdateFormulaContext formula just after the SwitchForm command.  

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
manta357Author Commented:
yes R6 and that fixed it.

thanks
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.