Skip to main content

Notifications

Dynamics 365 general forum

Auto-fill fields before save

Posted on by 20

Hi,

In opportunities, I have a lookup field: 'Sales Owner' (different to 'Owner') that I want populated from 'Created by'.

I have created a business rule that works, but it only fills it on refresh. I have also tried it with 'if Topic contains data' and it still didn't work.

I would like the the field to be populated before save.

Sales-Owner-from-Created-by.PNG

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Auto-fill fields before save

    Hi,

    As suggested above, Created By field won't populate unless the record is created. You could use the JavaScript to set the logged in user.

    Below thread contains the javascript method which you can use-

    community.dynamics.com/.../247188

    Hope this helps.

  • Suggested answer
    Kalpavruksh D365 CoE Profile Picture
    Kalpavruksh D365 CoE 2,545 on at
    RE: Auto-fill fields before save

    Hi,

    As all the system fields of any entity like "created by" gets saved in the database once the record is saved, this can not be achieved using a business rule/javascript before save. If it is any custom field which gets auto-populated before save, the business rule will work. There is one option to populate this field. Using javascript, get the logged in user and pre-populate this lookup as logged in user who will create the record will be stored as Created by for that record.

    Please mark as verified if the answer has helped you to resolve the issue.

  • Yazz99 Profile Picture
    Yazz99 20 on at
    RE: Auto-fill fields before save

    I have also tried a workflow and that works on 'save' but I really need to get it to work before 'save'.

    Thank you!

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans