web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Set default values

(2) ShareShare
ReportReport
Posted on by 22
I have a requirement to set default values for a field called ship location based on a field called shape. Now this is being set by a business rule but then it is also preventing users from manually entering values in the Ship location. Even if one changes it, it is reverting back to default value as soon as I save. 
But the client also requires to be able to edit it manually. The ship location field is a lookup field, wherein we have 10 records, and 5 out of them aren't default values for any shape value. So, the user is not able to set anything other than the default values.

I tried adding an extra check in the business which is ship location should be set to default only when it is empty but then it was not updating once I was changing the shape because the criteria won't meet.
 
Can anyone please suggest how I can achieve the below criteria without any JavaScript or coding in CRM:

1. The ship location should set to default based on shape
2. The ship location should update once I change the shape
3. The user can also add values in ship location other than defaults, and that shouldn't be overriden.
 
Quick response would be appreciated as this is my client's environment.
I have the same question (0)
  • Suggested answer
    Daivat Vartak (v-9davar) Profile Picture
    7,835 Super User 2025 Season 2 on at
    Hello CU05020752-0,
     

    Right now, the easiest way I know to automatically update the "Ship Location" field (without using any code) is with a real-time workflow (not Power Automate).

    You can create a workflow that says, "Whenever the 'Shape' field changes, update the 'Ship Location' field with a specific value." This lets users change the "Ship Location" manually, but if they change the "Shape" field, the "Ship Location" will automatically go back to the value you set in the workflow.

     
    If my answer was helpful, please click Like, and if it solved your problem, please mark it as verified to help other community members find more. If you have further questions, please feel free to contact me.
     
    Best Regards,
    Daivat Vartak
  • Suggested answer
    Amit Katariya007 Profile Picture
    10,409 Super User 2025 Season 2 on at
    Using JavaScript to update the field may lead to issues when distinguishing between user-entered values and default values that need to be populated. If the user updates the field again, it becomes challenging to determine which values should be removed or retained.
     
    Manually updating the field alongside automation is not an ideal approach. It’s better to use one method consistently.
     
    A possible solution is to display the ship details in a Quick View form when a record is selected in Shape. If the user needs to add any extra values, they can update the field; otherwise, it remains unchanged.
  • Suggested answer
    Ali Hamza Profile Picture
    170 on at
    Hi, 
     
    You can use both Real Time Workflow or Power Automate FLOW (user will need to manually refresh the form). I believe in Real Time Workflow the logic you need to put is not Ship Location is empty (does not contain data), but that the value in the ship location is default or not. 
     
    From your question description I can conclude that each shape have certain default ship locations. So you in real time workflow you need to check.
     
    Register WF on create & change of shape field.
    WF Condition<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>
    If Ship Location does not contain data OR if Ship location equals Ship Location.IsDefault equal True
    WF Action<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>
    Update Ship location with default ship location value for this shape
     
    I am assuming there is some parameter on Ship location to detect its default location or not. If this is not the case you will need to individually match each ship location value by filling the  lookup i.e.
     

    WF Condition<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>
    If Ship Location does not contain data OR if Ship location equals Ship Location <A> OR if Ship location equals Ship Location <B> OR if Ship location equals Ship Location <C>
    WF Action<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>
    Update Ship location with default ship location value for this shape
     
    There is one problem with WF is that when you deploy to another CRM environment the lookup values will break. To fix this you will need to use XrmToolbox record cloner to replicate same GUIDs across your environment. If this production environment then it may work for now but in future deployments this workflow will cause issue and you will need to manually open WF and fill lookup values. 
     
    Sample WF with conditions (this may not related to our problem, but this is how conditions will be put)
     
     
     
    Regards
    Ali
     
  • CU05020752-0 Profile Picture
    22 on at
    @Ali Hamza@Daivat Vartak (v-9davar)

    I tried creating the workflow, but the only problem I am facing is the default values aren't reapplying if I come back and change the shape , until I am manually clearing the ship location field. I believe there is no inbuilt functionality in workflows to check if the shape field was changed, so update to the default.
    However, it is updating if I am clearing the ship location field manually. My client doesn't approve of it. He suggested to clear the field once the user updates the shape field, and then it should also take the default value.

    I added extra checks and actions in the existing conditions , but it is running into an infinite loop, as we are updating the same field and also clearing it. I think Power automate would be a better option here. Or is there anyway out through CRM workflows?
  • Ali Hamza Profile Picture
    170 on at
     
    Please focus on these conditions, the WF will update the value of shipping location in case of default value filled. 
     
    Register WF on create & change of shape field.
    WF Condition<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>
    If Ship Location does not contain data OR if Ship location equals Ship Location.IsDefault equal True
    WF Action<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>
    Update Ship location with default ship location value for this shape
     
     
    I am assuming there is some parameter on Ship location to detect its default location or not. If this is not the case you will need to individually match each ship location value by filling the  lookup i.e.
     
     
    WF Condition<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>
    If Ship Location does not contain data OR if Ship location equals Ship Location <A> OR if Ship location equals Ship Location <B> OR if Ship location equals Ship Location <C>
    WF Action<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>
    Update Ship location with default ship location value for this shape
     
    Can you share screenshot of your WF conditions and Update Action. 
     
    Regards
    Ali
  • Verified answer
    Daivat Vartak (v-9davar) Profile Picture
    7,835 Super User 2025 Season 2 on at

    Hi @CU05020752-0,

    I'm not sure I understand the complicated logic you're describing.

    Let's look at a simple example.

    Imagine the "Shape" field is a list of options (Round, Square, Rectangle, Pentagon).

    And the "Ship Location" field (which could be a dropdown, a lookup, etc.) has values A, B, C, D, E, F, G, and H.

    Let's say each shape has a default "Ship Location":


    • Round -> A

    • Square -> C

    • Rectangle -> E

    • Pentagon -> G


    •  

    Users can change the "Ship Location" manually whenever they want. But, if they change the "Shape," the "Ship Location" will automatically go back to its default value (as we'll set up in the workflow).

    The workflow will only run when the "Shape" field is changed.

    Hopefully, this example makes the logic clearer so you can set up the workflow.

    Regards,
    Daivat Vartak

     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 170 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 61

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 52 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans