Recommendations on achieving a create and edit with app links

From what I have read and seen while testing, for app settings or app links, if you pass data mappings, the platform assumes you are looking for an existing record. If you don’t pass data mappings AND the entry form is Detail or Header Detail, it will open a new record.

Right now, I have an app link where I have data mappings. How I want it to work is the following:

  • If my mappings are not empty (i.e. those fields are populated on my initiating app), then I want to open the existing record associated with those values in my mini-app.
  • If my mappings are empty (i.e. those fields are NOT populated on my initiating app), then I want to open a new record in the mini-app.

Given how the platform works, I think the only way to achieve this is through the following options, but I wanted to see if there are better options available.

Option 1: Worktable

  • Have my app link to an application over a worktable and continue to pass those mappings. On form init, add logic to retrieve the matching record (using the values passed via mappings) and populate the fields (so it looks like the record is getting edited); if none is found, no fields are populated, and it looks like you are creating a new record. On save, you have logic to then insert or update the record in the relevant table.

Option 2: Dynamic Application Links

  • Create two different application links, one where you have mappings and one where you don’t. Then create two different dynamic application with those app links. I would have a field that I populate based on whether the fields in my initiating app are populated, and then use that to determine the app to launch. For creating a new record, open the link with no mappings, for editing an existing, open the link with mappings.

Any better recommendations?

One other idea would be to create both app links (one with the mappings and one without), then create a Logic Block with a conditional action to check if your source fields are populated, and use the Queue App Link action to take the appropriate app link. Then you would just hook up that logic block to whichever action you’re that currently executes the app link.

3 Likes