Struggling with populating fields into related custom objects

  • 1
  • Question
  • Updated 4 years ago
Most of the examples here are based on standard salesforce objects, and we use mostly custom objects and so trying to take an example for populating the address on a new contact from an account and apply to our scenario is somewhat confusing for newbees to the product. We have a custom object called Service_Type__c and we have a related list for cases. UI looks great works great, etc. but when we create a new case from the Service, none of the fields populate. When we create a new case from the table, the related service ID does populate, critical to linking the case to the service. My question is simply, how do we pre-populate more than just the service ID when creating a record inline? We have a field on the Service called Client Number that we would like to fill when inline creation of documents?
Any assistance would be greatly appreciated!
Photo of Ben

Ben

  • 780 Points 500 badge 2x thumb

Posted 4 years ago

  • 1
Photo of Pat Vachon

Pat Vachon, Champion

  • 44,396 Points 20k badge 2x thumb
Here are a couple easy options.
  1. Create Conditions on the Case Model to automatically take on values from other models or URL params.
  2. Instead of Using inline record creation on the table, switch to using a Global Action. You can use the action "Create new row" in order to select values using merge syntax.
Photo of Ben

Ben

  • 780 Points 500 badge 2x thumb
Pat,
Thanks but I am not getting the dialog you reference above. When I select a new global action, Create new row, the only options are Place Row.. and of course the icon and label. 
Photo of Pat Vachon

Pat Vachon, Champion

  • 44,396 Points 20k badge 2x thumb
You need to click on the "+".

Photo of Pat Vachon

Pat Vachon, Champion

  • 44,396 Points 20k badge 2x thumb
Also, what version of Skuid do you have?
Photo of Ben

Ben

  • 780 Points 500 badge 2x thumb
Most recent
Photo of Ben

Ben

  • 780 Points 500 badge 2x thumb
Here is the condition I have, and when I create a new case, the Service_c (Service Number) populates into a field on the case, but am trying to get it to do that for more fields that just the service__c field. Seems simple but am just not getting it.
Photo of Pat Vachon

Pat Vachon, Champion

  • 44,396 Points 20k badge 2x thumb
First click on the Multiple Actions option and then Actions.
Photo of Pat Vachon

Pat Vachon, Champion

  • 44,396 Points 20k badge 2x thumb

Photo of Ben

Ben

  • 780 Points 500 badge 2x thumb
Thank again. So, I created the following, expecting the ClientNum value to come into the ClientNum field on the case (from the service model) but no go. I get the Service__c but no client number.
Photo of Pat Vachon

Pat Vachon, Champion

  • 44,396 Points 20k badge 2x thumb
Why do you need to copy the ClientNum__c into the Case record. As soon as it's related, you can then display the value on the case. ie. Service__r.ClientNum__c
Photo of Ben

Ben

  • 780 Points 500 badge 2x thumb
That is actually a bad example. We have the related field Service__c which is the reference number to the service (obviously necessary to link the case) and we also have a related field Account that is related to the account record for the client. So, Service gets populated with say 2576656 (relating it to the service and Account gets populated with BankAmerica as it is related to that account. Using clientnum above to get my head around the syntax but a bad example.
Photo of Ben

Ben

  • 780 Points 500 badge 2x thumb
Actually just added a new model for the Account called AccountData, with two fields, Id and Name. Then created the following and still does not populate the Account Related field. I am sure it something really simple. 
Photo of Pat Vachon

Pat Vachon, Champion

  • 44,396 Points 20k badge 2x thumb
Does AccountData have a row in it? 
Photo of Ben

Ben

  • 780 Points 500 badge 2x thumb
No, just 2 fields and a condition and none of the rows in the table where I am creating this from has either field in it. I enter a subject, save, look at it, see the service number but no account name.
Photo of Pat Vachon

Pat Vachon, Champion

  • 44,396 Points 20k badge 2x thumb
Is this still not working?
Photo of Ben

Ben

  • 780 Points 500 badge 2x thumb
Well we are able to add from a table row, and populate the necessary fields. The problem that I have come to find out, is that when in edit mode the conditions act as defined values from the existing object, but when in read mode, they are conditions and act to control what you can see. By using the conditions, if someone blanks out a value used in the conditions and saves the record, well although the record does get created, they cant see it. For instance, we have a service that may or may not have a username and email address. When a client calls to create a case, sometimes it is the user that created the service and sometimes not. If we populate a field in the table with these values and they are blank when saved, the case disappears from the service, although you can still see it when using standard SF views. A little confusing but our app is quite complex and uses mostly custom objects. Guess we have to try and send using a url with the parameters to set the fields in the url.
Photo of Pat Vachon

Pat Vachon, Champion

  • 44,396 Points 20k badge 2x thumb
Merge syntax is certainly the way to go for your use case and should work without issue. Something isn't setup properly if the merge syntax isn't providing default values.

Conditions can also be used, but you'd have to activate and deactivate them before and after creating the row.
Photo of Pat Vachon

Pat Vachon, Champion

  • 44,396 Points 20k badge 2x thumb
asdf
Photo of Pat Vachon

Pat Vachon, Champion

  • 44,396 Points 20k badge 2x thumb
asdf