I have created one process builder to check the criteria for Opportunity creation if Owner.UserRole.DeveloperName
is something then PricebookID
need to be updated.
Hence it is working fine when created Opportunity from Opportunity tab.
But When I created one Button on a custom object (Target) 'convert to opportunity' VF page attach to it having action="{!doConvert}
and in controller I am creating the opportunity.
//Opportunity Creation
newOpp = new Opportunity();
newOpp.OwnerId = target.OwnerID;
newOpp.Name = target.Name;
newOpp.Accountid = target.Target_Account__c;
newOpp.Amount = target.Target_Potential_Opportunity_Amount__c;
newOpp.CloseDate = date.today()+90;
newOpp.CampaignID = target.Target_Campaign__c;
newOpp.Opportunity_Target__c = target.Id;
newOpp.StageName = '1 - Prospecting';
insert newOpp;
return returnToOpportunity();
But when I click on this button, it shows blank screen and debug log shows error:
The flow failed to access the value for myVariable_current.Owner.UserRole.DeveloperName because it hasn't been set or assigned.