Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Answered

Possible to map a value from the user creating a record to the record created?

Posted on by 5

Hi there,

We have an 'office' lookup on a custom entity that's created quite often by our users. 

Most of our users will always use the same office when creating this record and I was hoping to add the same 'office' lookup to the systemuser object with a mapping to set the 'office' lookup on custom entity to that of the user creating it, but when I go to the N:1 relationships, I don't have an option to create mappings between the custom entity and the createdby user.

I feel like I'm missing something obvious. Is there a way to default fields on records created by a user to values set on the user's systemuser record without having to revert to javascript?

Thanks.

Edit: a clarification - I was looking for a way to pre-populate the field at form-load, rather than on-save. Looks like the only option is indeed javascript.

  • Verified answer
    LuHao Profile Picture
    LuHao 40,872 on at
    RE: Possible to map a value from the user creating a record to the record created?

    Hi Jarrad,

    Yes, you have to use javascript.

  • Jarrad Profile Picture
    Jarrad 5 on at
    RE: Possible to map a value from the user creating a record to the record created?

    Thanks for the suggestion on workflows, Hao. But a workflow will only run after the user clicks save. Sorry I wasn't clear in the OP, but I'm looking for a solution to set the field when the form loads, rather than on save, similar to the relationship mapping functionality.

    While users will usually set the field to the same value (hence the desire to default it for them), they'll sometimes need to set it to a different one. So the goal is to default the field to their usual office, while still giving them the opportunity to change it if needed.

    I appreciate I can set the workflow to set the field only if they leave it blank, but we want to give them the visual reminder of what it will be set to by default.

    So I'm guessing the only option here is to go with javascript.

  • Suggested answer
    LuHao Profile Picture
    LuHao 40,872 on at
    RE: Possible to map a value from the user creating a record to the record created?

    Hi Jarrad,

    I would recommend you use workflow.

    Go to Settings > Processes, new a workflow for custom entity.

    pastedimage1590396980947v1.png

    Start When: Record is created. Scope: Organization.

    pastedimage1590397043753v2.png

    Update the custom entity record. Use Create By (User)'s office lookup field value to populate the custom entity's office lookup field.

    pastedimage1590397215011v3.png

  • Jarrad Profile Picture
    Jarrad 5 on at
    RE: Possible to map a value from the user creating a record to the record created?

    Hi Hao,

    Sorry, I should've said - we're on-premise, so Flow isn't an option.

    Any other options -- other than custom javascript/plugins -- that you're aware of?

    If not, it would seem to be a missed opportunity, not being able to set per-user-default-values for fields.

    Thanks.

  • LuHao Profile Picture
    LuHao 40,872 on at
    RE: Possible to map a value from the user creating a record to the record created?

    Hi Jarrad,

    The most suitable solution is to use Flow.

    First of all, we need to know whether your D365 is online or OP, because Flow only supports Online environment.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans