function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
EKnott.ax1331EKnott.ax1331 

What type of variable to pass to a required master-detail relationship..

....field in a custom object using a record create element?

 

I have created a custom object and a flow through the cloud flow designer.  I would like the flow to take place of the current user input UI through out partner portal. The problem is that in building/testing my custom object, I created a master-detail relationship field called OS Project.  This field is of course required so when I go to run my flow I will need to populate that custom object field with something.  I have tried populating it with a variable that is user selected from a dynamic choice in the flow and I receive the following error:

 

---------- Forwarded message ----------

From: FlowApplication <info@salesforce.com>

Date: Wed, Jun 6, 2012 at 7:12 AM

Subject: Unhandled process fault from OutSell Consulting : Log_a_Day_UI_Screen : interaction.sfdc.adapter.rules.SalesforceRuleBrokenException: UPSERT --- UPSERT FAILED --- ERRORS : (FIELD_INTEGRITY_EXCEPTION) OS Project: id value of incorrect type: a0BA000000OI2VoMAL --- for SFDC record with ID : null,

To: "ga@outsellconsulting.com" <ga@outsellconsulting.com>

 

 

Encountered unhandled fault when running process Log_a_Day_UI_Screen/301A0000000GnWh exception by user/organization: 00DA0000000HmMF/{4}

 

interaction.sfdc.adapter.rules.SalesforceRuleBrokenException: UPSERT --- UPSERT FAILED ---  ERRORS :  (FIELD_INTEGRITY_EXCEPTION) OS Project: id value of incorrect type: a0BA000000OI2VoMAL ---  for SFDC record with ID : null,

 

caused by element : Data update.Create_Log_A_Day

 

caused by: interaction.sfdc.adapter.rules.SalesforceRuleBrokenException: UPSERT --- UPSERT FAILED ---  ERRORS :  (FIELD_INTEGRITY_EXCEPTION) OS Project: id value of incorrect type: a0BA000000OI2VoMAL ---  for SFDC record with ID : null,

 

Salesforce Error ID: 1712039429-66216 (-1219417188)

 

**************************************************************************************************************************************

So I determined that the OS Project field was receiving a record type and needed text, so I created a new field in the custom object called Project which is just a text field (The user selected dynamic choice from the flow is a text value),  and tried to pass the user selected dynmaic choice to that field.  However, b/c the master-detail relationship filed is required the flow does not complete b/c nothing is being passed to that field in the custom object and I receive the following error:

 

---------- Forwarded message ----------

From: FlowApplication <info@salesforce.com>

Date: Wed, Jun 6, 2012 at 7:34 AM

Subject: Unhandled process fault from OutSell Consulting : Log_a_Day_UI_Screen : interaction.sfdc.adapter.rules.SalesforceRuleBrokenException: UPSERT --- UPSERT FAILED --- ERRORS : (REQUIRED_FIELD_MISSING) Required fields are missing: [OS_Project__c] --- for SFDC record with ID : null,

To: "ga@outsellconsulting.com" <ga@outsellconsulting.com>

 

 

Encountered unhandled fault when running process Log_a_Day_UI_Screen/301A0000000GnWw exception by user/organization: 00DA0000000HmMF/{4}

 

interaction.sfdc.adapter.rules.SalesforceRuleBrokenException: UPSERT --- UPSERT FAILED ---  ERRORS :  (REQUIRED_FIELD_MISSING) Required fields are missing: [OS_Project__c] ---  for SFDC record with ID : null,

 

caused by element : Data update.Create_Log_A_Day

 

caused by: interaction.sfdc.adapter.rules.SalesforceRuleBrokenException: UPSERT --- UPSERT FAILED ---  ERRORS :  (REQUIRED_FIELD_MISSING) Required fields are missing: [OS_Project__c] ---  for SFDC record with ID : null,

 

Salesforce Error ID: 137134272-69211 (105618478)

*****************************************************************************************************************************

Thus - what type of data can I pass to that required OS Project master-detail relationship field in the custom object from a record create element in the flow just to get the flow to completion and actually creating a record with in the object - and how do I do this? 

 

Thank you! ~Emily

RajaramRajaram

If you are using choices and want to store the users selection in to the database, the engine used the "Stored Value" specified in the choice. You can get more from my blog here. If you want to store the FK reference (OS Project ID), make sure the stored value is the "ID" field.

 

So, if  you are using a screen whcih uses a dynamic choice from your master object and then creating the child record and want to set the master record selected by the user, make sure the dynamic choice resource has the Stored Value set to the "ID" field.

 

Hope this helps..

EKnott.ax1331EKnott.ax1331

If I set the resource stored value to the ID field, then, in another text screen where I call the variable selected by the user for verification, the Screen output lists the record id, not the name.  For example, it would list the OS Project record ID, not the name of the OS Project, say AVIS.  

 

Also, I am still unable to create a record.  In a custom object, where there is a field that is a master - detail relationship, what data types can that field be populated with from the flow? Is it just the record ID? I set the stored value to ID and it still wont create the record?

 

Thank you! ~Emily

EKnott.ax1331EKnott.ax1331

Following is the error I receive when I change the stored value field to ID.......

****************************************************************************************************************

Subject: Unhandled process fault from OutSell Consulting : Log_a_Day_UI_Screen : interaction.sfdc.adapter.rules.SalesforceRuleBrokenException: UPSERT --- UPSERT FAILED ---  ERRORS :  (FIELD_INTEGRITY_EXCEPTION) OS Project: id value of incorrect type: a0BA000000OI2VoMAL ---  for SFDC record with ID : null,

 

 

Encountered unhandled fault when running process Log_a_Day_UI_Screen/301A0000000GnXz exception by user/organization: 00DA0000000HmMF/{4}

 

interaction.sfdc.adapter.rules.SalesforceRuleBrokenException: UPSERT --- UPSERT FAILED ---  ERRORS :  (FIELD_INTEGRITY_EXCEPTION) OS Project: id value of incorrect type: a0BA000000OI2VoMAL ---  for SFDC record with ID : null, 

 

caused by element : Data update.Create_Log_A_Day

 

caused by: interaction.sfdc.adapter.rules.SalesforceRuleBrokenException: UPSERT --- UPSERT FAILED ---  ERRORS :  (FIELD_INTEGRITY_EXCEPTION) OS Project: id value of incorrect type: a0BA000000OI2VoMAL ---  for SFDC record with ID : null, 

 

Salesforce Error ID: 903495726-36 (-1219417188)

RajaramRajaram

In the DB when creating the child record you need to specify the ID (Text in flow) of the master record at the time of creation.