Starting a New Opportunity from One Workflow to Another

CRM 6.2.i
Let’s say I have two opportunities (prebid and postbid). Each has their own set of fields that are displayed depending on which is chosen. I’ve done this with an if statement (for example):
var oppoType = CRM.GetContextInfo("opportunity","oppo_type");
var idval = Values("key27");
if (oppoType =='ProjectPreBid' || idval == '10154')
{
Hidden=false;
}
else if(idval == '10194' || idval == '10168' || idval == '10211' || idval == '10223')
{
Hidden=true;
}
else
{
Hidden=true;
}
If a prebid opportunity is successful, there are 4 fields that need to be copied over to a new post bid opportunity.
Oppo_primarycompanyid (prebid workflow) >>> oppo_description (postbid workflow)
oppo_compeng (prebid workflow) >>> oppo_compeng (postbid workflow)
oppo_projmngr (prebid workflow) >>> oppo_projmngr (postbid workflow)
oppo_lowbidder (prebid workflow) >>> oppo_primarycompanyid (postbid workflow)
This has become a problem, because when I edit a workflow rule and click to Create Opportunity, those fields that are specific (not hidden) to the oppo_type (either Prebid or Postbid) do not show.
The second problem is that I don’t know how to point this new opportunity creation to the postbid workflow.
How can I make this workflow rule properly populate these new fields and create the opportunity in the other workflow?

  • 0

    I've taken out the code so that I can at least plug in the #oppo_variable# fields to see if it will take hold, which it does for the most part. There are two field types that I cannot figure out how to carry over: a multi-select field, and a search select advanced field.

    In addition, when I'm filling in the fields in the workflow, there's no place to put in the Company; it just assumes that the new opportunity is with the same company (which, in fact, is with another field that I'm trying to carry over).

    Lastly, this new opportunity creation doesn't allow for entry into another workflow I've created, which is obviously the biggest problem right now, haha.