Thank you very much Jim, that accomplished what I was looking for.
-Ted
________________________________
From: jckinneman <jckinneman@...>
To: vantage@yahoogroups.com
Sent: Wednesday, September 14, 2011 7:05 PM
Subject: [Vantage] Re: LaunchFormOptions
// something like this goes in the program that has the information you want to pass to the other form
// this could be used to pass it over to a form being called by this form
// or used to pass/return something as this form exits.
      Epicor.Mfg.Core.Session Session = (Epicor.Mfg.Core.Session)CustomerEntryForm.Session;
      String SessionID = Session.SessionID;
      System.Text.StringBuilder envPassVariableName = new System.Text.StringBuilder();
      // session id in 9 has characters that we don't want so only use letters and numbers, still will be unique
      // in this case the id is just the session id, you could
      for (int i=0; i< SessionID.Length; i++)
      {
         if (char.IsLetterOrDigit(SessionID[i]))
         {
            envPassVariableName.Append(SessionID[i]);
         }
      }
      System.Environment.SetEnvironmentVariable(envPassVariableName.ToString(),
         WhatyouWantToPassGoesHere,
         EnvironmentVariableTarget.Process);
// now call the launchform
// something like this goes into the form that you need to get information into, for forms being launched typically the load event
      //using the session id as an environmental variable name, you could add a prefix or suffix if you like
      Epicor.Mfg.Core.Session Session = (Epicor.Mfg.Core.Session)CustomerEntryForm.Session;
      String SessionID = Session.SessionID;
      System.Text.StringBuilder envPassVariableName = new System.Text.StringBuilder();
      // session id in 9 has characters that we don't want so only use letters and numbers, still will be unique
      for (int i=0; i< SessionID.Length; i++)
      {
         if (char.IsLetterOrDigit(SessionID[i]))
         {
            envPassVariableName.Append(SessionID[i]);
         }
      }
      String variable = String.Empty;
      if (DoesEnvironmentVariableExist(envPassVariableName.ToString(),
         EnvironmentVariableTarget.Process))
      {
         variable = System.Environment.GetEnvironmentVariable(envPassVariableName.ToString(),
            EnvironmentVariableTarget.Process).ToString();
      }
      // we have a copy, now get rid of the original
      System.Environment.SetEnvironmentVariable(envPassVariableName.ToString(),
         String.Empty,
         EnvironmentVariableTarget.Process);
Thanks,
Jim Kinneman
Encompass Solution, Inc
-Ted
________________________________
From: jckinneman <jckinneman@...>
To: vantage@yahoogroups.com
Sent: Wednesday, September 14, 2011 7:05 PM
Subject: [Vantage] Re: LaunchFormOptions
// something like this goes in the program that has the information you want to pass to the other form
// this could be used to pass it over to a form being called by this form
// or used to pass/return something as this form exits.
      Epicor.Mfg.Core.Session Session = (Epicor.Mfg.Core.Session)CustomerEntryForm.Session;
      String SessionID = Session.SessionID;
      System.Text.StringBuilder envPassVariableName = new System.Text.StringBuilder();
      // session id in 9 has characters that we don't want so only use letters and numbers, still will be unique
      // in this case the id is just the session id, you could
      for (int i=0; i< SessionID.Length; i++)
      {
         if (char.IsLetterOrDigit(SessionID[i]))
         {
            envPassVariableName.Append(SessionID[i]);
         }
      }
      System.Environment.SetEnvironmentVariable(envPassVariableName.ToString(),
         WhatyouWantToPassGoesHere,
         EnvironmentVariableTarget.Process);
// now call the launchform
// something like this goes into the form that you need to get information into, for forms being launched typically the load event
      //using the session id as an environmental variable name, you could add a prefix or suffix if you like
      Epicor.Mfg.Core.Session Session = (Epicor.Mfg.Core.Session)CustomerEntryForm.Session;
      String SessionID = Session.SessionID;
      System.Text.StringBuilder envPassVariableName = new System.Text.StringBuilder();
      // session id in 9 has characters that we don't want so only use letters and numbers, still will be unique
      for (int i=0; i< SessionID.Length; i++)
      {
         if (char.IsLetterOrDigit(SessionID[i]))
         {
            envPassVariableName.Append(SessionID[i]);
         }
      }
      String variable = String.Empty;
      if (DoesEnvironmentVariableExist(envPassVariableName.ToString(),
         EnvironmentVariableTarget.Process))
      {
         variable = System.Environment.GetEnvironmentVariable(envPassVariableName.ToString(),
            EnvironmentVariableTarget.Process).ToString();
      }
      // we have a copy, now get rid of the original
      System.Environment.SetEnvironmentVariable(envPassVariableName.ToString(),
         String.Empty,
         EnvironmentVariableTarget.Process);
Thanks,
Jim Kinneman
Encompass Solution, Inc
--- In vantage@yahoogroups.com, Ted Koch <tkoch77@...> wrote:
>
> Thanks Jim, could you give me an example of how to use the Get and Set EnvironmentalVariable?
>
>
>
> ________________________________
> From: jckinneman <jckinneman@...>
> To: vantage@yahoogroups.com
> Sent: Tuesday, September 13, 2011 7:49 PM
> Subject: [Vantage] Re: LaunchFormOptions
>
> An alternate that I use from time to time is to pass a value via a local environmental variable using the SetEnvironmentVariable and GetEnvironmentVariable methods.  I take the session id and maybe a fixed identifier to build a name for the variable so that both the caller and callee know what the name will be and no conflict with another session the user might have running. It is local, doesn't run into any directory or file naming issues and nothing to clean up.
>
> I've used both the file approach and the environmental approach.
>
> Jim Kinneman
> Encompass Solutions, Inc
>
> --- In vantage@yahoogroups.com, Waffqle <waffqle@> wrote:
> >
> > This should do the trick:
> >
> >
> > // Compose a string that consists of three lines.
> > string lines = "First line.\r\nSecond line.\r\nThird line.";
> >
> > // Write the string to a file.
> > System.IO.StreamWriter file = new System.IO.StreamWriter("c:\\test.txt");
> > file.WriteLine(lines);
> >
> > file.Close();
> >
> >
> > On Tue, Sep 13, 2011 at 5:48 PM, Ted Koch <tkoch77@> wrote:
> >
> > > **
> > >
> > >
> > > Jose,
> > > If
> > > you have time could you give me an example of how to write to a temp
> > > file. Never done that before but seems like it could be useful here and
> > > probably in the future.
> > >
> > > Thanks,
> > > Ted
> > >
> > > ________________________________
> > > From: Jose Gomez <jose@>
> > > To: vantage@yahoogroups.com
> > > Sent: Tuesday, September 13, 2011 3:50 PM
> > > Subject: Re: [Vantage] LaunchFormOptions
> > >
> > > Not that I know of, you could Hack it and write it to a Temp File or write
> > > it to Character01 on whatever module you called it fromm.
> > >
> > > *Jose C Gomez*
> > > *Software Engineer*
> > > *
> > > *
> > > *checkout my new blog <http://www.usdoingstuff.com> *
> > > *
> > > *T: 904.469.1524 mobile
> > > E: jose@
> > > http://www.josecgomez.com
> > > <http://www.linkedin.com/in/josecgomez>Â <
> > > http://www.facebook.com/josegomez>
> > >Â Â <http://www.google.com/profiles/jose.gomez> <
> > > http://www.twitter.com/joc85>
> > >Â Â <http://www.josecgomez.com/professional-resume/>
> > > <http://www.josecgomez.com/feed/>
> > >Â Â <http://www.usdoingstuff.com>
> > >
> > > *Quis custodiet ipsos custodes?*
> > >
> > > On Tue, Sep 13, 2011 at 3:38 PM, tkoch77 <tkoch77@> wrote:
> > >
> > > > **
> > > >
> > > >
> > > > I am using a button on a form to launch the Project Entry form. When the
> > > > Project
> > > > Entry form is loaded it generates a new Project ID automatically. Is
> > > there
> > > > a way
> > > > to pass this new Project ID back to the form that called it after the
> > > > Project
> > > > Entry form is closed?
> > > >
> > > >
> > > >
> > >
> > > [Non-text portions of this message have been removed]
> > >
> > > ------------------------------------
> > >
> > > Useful links for the Yahoo!Groups Vantage Board are: ( Note:Â You must have
> > > already linked your email address to a yahoo id to enable access. )
> > > (1) To access the Files Section of our Yahoo!Group for Report Builder and
> > > Crystal Reports and other 'goodies', please goto:
> > > http://groups.yahoo.com/group/vantage/files/.
> > > (2) To search through old msg's goto:
> > > http://groups.yahoo.com/group/vantage/messages
> > > (3) To view links to Vendors that provide Vantage services goto:
> > > http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links
> > >
> > > [Non-text portions of this message have been removed]
> > >
> > >Â
> > >
> >
> >
> >
> > --
> > *Waffqle Driggers*
> > *High End Dev, System Design, Profit Drinking
> > *
> > *:: 904.962.2887*
> > *:: waffqle@*
> > *:: NO FAXES*
> >
> > *
> >
> > *
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
>
>
>
> ------------------------------------
>
> Useful links for the Yahoo!Groups Vantage Board are: ( Note:Â You must have already linked your email address to a yahoo id to enable access. )
> (1) To access the Files Section of our Yahoo!Group for Report Builder and Crystal Reports and other 'goodies', please goto: http://groups.yahoo.com/group/vantage/files/.%c2%a0
> (2) To search through old msg's goto: http://groups.yahoo.com/group/vantage/messages
> (3) To view links to Vendors that provide Vantage services goto: http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links
>
>
>
> [Non-text portions of this message have been removed]
>
------------------------------------
Useful links for the Yahoo!Groups Vantage Board are: ( Note:Â You must have already linked your email address to a yahoo id to enable access. )
(1) To access the Files Section of our Yahoo!Group for Report Builder and Crystal Reports and other 'goodies', please goto: http://groups.yahoo.com/group/vantage/files/.%c2%a0
(2) To search through old msg's goto: http://groups.yahoo.com/group/vantage/messages
(3) To view links to Vendors that provide Vantage services goto: http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links
[Non-text portions of this message have been removed]