Create New Service Request add Fields to Second Object

Hi,

I’ve added some additional fields into the Create New Service Request presenter in central and I wanted to use them in a host to prepopulate a second object linked with a one to one relationship.

In the create_new_service_request API function I added the additional fields and set the field to match with the relationship set to save but it doesn’t actually save the fields. I also added the link to see if that would force the creation of the second object but it still won’t save.

I checked and the correct data is going through and if I save it to a field in Case it works.

Does anyone know if it’s possible to create and prepopulate the second object or do I have to save it all in case then copy it with a rule?

Would you be able to add a screenshot of the API config? It sounds correct to me from your description but I find it easier to parse an image over a description personally.

Looks like this

both with and without link ticked

From the “Link” and “Save” help text it seems like it should work if you have “Link” ticked for the row you want to base the link on. Did you try it with link and link required ticked? Were there any errors in the API response?

With link required it errors out
“Unable to save a record. Required linked record does not exist or more than one record found.”

With just link it doesn’t save the data

I created a workaround saving all the data to a text, multi lines in case as JSON then running this in “Case form ongoing”
if(case_type == ‘EDS Warning’ && !started){

cs.log('EDS Warning')

let warningJson = JSON.parse(caseRecord.get(cs.ref('field_case_warning_json')))

cs.log('warningJson')

cs.log(warningJson)

caseRecord.set(cs.ref('field_case_warning_name'),warningJson.client_name)

caseRecord.set(cs.ref('field_case_warning_dob'),warningJson.client_date_of_birth)

caseRecord.set(cs.ref('field_case_warning_ethnicity'),warningJson.client_ethnicity)

caseRecord.set(cs.ref('field_case_warning_gender'),warningJson.client_gender)

caseRecord.set(cs.ref('field_case_warning_address'),warningJson.current_address)

caseRecord.set(cs.ref('field_case_warning_phone'),warningJson.telephone_numbers)

caseRecord.set(cs.ref('field_case_warning_language'),warningJson.client_language)

}
It’s like it’s not creating warning until after the API but Case Form Ongoing shows that warning has an ID before it goes to the warning creation page so I’m at a loss