Monday, December 13, 2010

CDC Software Pivotal CRM 6.0: How to pass parameters from one client form to another.

This is a code example that describes how to pass parameters to another form.

Code example: open form B and send custom parameters from form A

//Form A:

TransitionPointParameter transitionParam = new TransitionPointParameter();
//Custom parameters (1 based index)
transitionParam.SetUserDefinedParameter(1, "Hello");
transitionParam.SetUserDefinedParameter(2, 123);

//Auto mapped parameters
transitionParam.AddDefaultColumn("First_Name", "Bobo");

ParameterList parameterList = (ParameterList)transitionParam.Construct();

//Open Form B and pass parameters
Globals.ShowForm("Company", null, parameterList);

//Form B:

//Close caller record
if (this.TransitionPointParameter.UserDefinedParametersNumber > 0)
{
    string message = (string)this.TransitionPointParameter.GetUserDefinedParameter(1);
    int number = (int)this.TransitionPointParameter.GetUserDefinedParameter(2);
}

No comments:

Post a Comment