1

In lwc when we use the navigation mixin to navigate to a default record modal we can use defaultFieldsValues to open the modal with some fields filled in, how can we do the same thing in the Navigate Action of a flexcard in vlocity/omnistudio?

2
  • Did you find any solution for this ? Commented Jun 26 at 4:45
  • I not find solution Commented Sep 10 at 12:49

1 Answer 1

1

This is a frustrating limitation of flexcards! Especially since this seems to be built upon the NavigationMixin, but just doesn't provide the options in the builder to pass in these parameters.

A possible workaround is to perform the same thing using a URL Hack. Please note the name hack - it's not officially documented / endorsed functionality.

Use this solution at your own risk

Setup a Navigation Action with:

  • Target = "Web Page"
  • URL = /lightning/o/{ObjectName}/new?defaultFieldValues={FieldName1}={Value},{FieldName2}={Value}

Substitute {ObjectName} with the Object API name After defaultFieldValues you can provide a comma-separated list of field/value pairs.

For example, to create a new Account with default values for Rating = Hot and Type = Other: /lightning/o/Account/new?defaultFieldValues=Rating=Hot,Type=Other

To make this more dynamic, you could also use Flexcard Merge Syntax in the URL: /lightning/o/Account/new?defaultFieldValues=Rating={Rating},Type={Type}


This is a useful intro to URL Hacking - which I recommend using sparingly where more offical 'navigation' methods are possible: https://www.salesforceben.com/salesforce-url-hacking-for-lightning-tutorial/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .