Row Action on Contact Model to Create New Order with default values

Hi, Questions

I have a few models on my page
Account (form) - getting the page param id
Contact (Table) - showing the related contacts - with Row Action - create new row
Order (Form) - to create a new order passing multiple info from Account Model and I need the Contact Model to pass the Contact ID a order lookup field [REFERENCE (Contact)] called - Order Contact

But it’s not working I tried multiple versions of it in the Row Action - Add default value

Order_Contact__c → id, {{id}}, {{{id}}}, ContactId, {{ContactId}}, {{{ContactId}}}
Order_Contact__r.Id → ContactId, {{ContactId}}, {{{ContactId}}}, id, {{id}}, {{{id}}}

I also had an issue for the record type - Default Value. The only way I got it to work was to hard code the Record Type ID which I don’t like. What should I do for this one?

Also tried multiple version with the ID or Name or Developer Name

PS - next I need to work on the page 2 of the wizard to add line items so this too is not working

Thank you, Dominique

Hi Dominique,

Question One
So it sounds like you have a Contact table with a row action that should create a new order with related to that contact, correct?

  1. Make sure the Contact model includes the Id field.
  2. Make sure the Order model includes the reference field, sounds like this is Order_Contact__c.
  3. Now in your row action on the Contact table set the default value for Order_Contact__c to {{Id}} this should pull in the Id field from the Contact row.

Question Two
For the order record type default value, should this always be the same record type?

  1. Makes sure the RecordTypeId field is included in the Order (normally this is included automatically)
  2. To create an order with a default record type, you do need to have the default value for the RecordTypeId hard coded to the actual Id number in the Composer. This way the new order should be created with that default record type.
  3. If you populate the RecordTypeId field with the correct Id number, the new order should be created in that record type and at runtime the user should see the name (not the Id number).

However, sometimes with lookup fields the Id is populated but the field name doesn’t show. In this case, you can also populate the default value for RecordType.Name to the name of the default record type.

Does this make sense? Let me know if this is helpful.

Take care.

Thank you Anna - For Question 1 - I see that I was not entering Id without a capital “I”. Now that I changed it it works! Thank you

For Question 2 I did Hardcode the 15 or 18 digit Salesforce ID in the action > Default values. And it’s working well! I was just wondering if using the 15 or 18 digits is a best practice.

Hi Dominique,

Based on what I found online, using the 18 character ID is Salesforce best practice. The 15 character ID is case-sensitive and so some external systems aren’t case sensitive.

Typically within Salesforce both IDs should work. Occasionally when working with Salesforce records (not sure where off the top of my head) I’ve ran into places where reference fields will only take/return one or the other.

Merge Syntax in Skuid

  • {{Id}} will return the 18 character Id field
  • {{{Id}}} with triple brackets will return the raw, 18 character Id
  • {{Id15}} raw 15 character Id

Note that Id15 isn’t a separate field that you need to add to your model, it’s accessible automatically.

With lookup fields

  • {{Lookup__c}} will return the hyperlinked related record name
  • {{{Lookup__c}}} will return the raw 18 character Id of the related record


Internally, Salesforce uses a case-sensitive 15 digit ID for all records because everything is in control of salesforce but… there are applications like Access or Excel which do not recognize that 50130000000014c is a different ID than 50130000000014C, the case-safe 18 character ID was introduced, 18-character IDs can be safely compared for uniqueness by case-insensitive applications, and can be used in all API calls when creating, editing, or deleting data.

Thank you Anna for the information.

1 Like