1

I have a custom field in Opportunity Product called 'Unit of Measurement' and what I am trying to do is, show one value "Meter" as the default for users of one profile and "Square foot" as the default for all the other profiles. What is the best way to accomplish this in such a way that this doesn't affect reporting on that field?

Edit: In the 'Unit of Measurement' Picklist field in Opportunity Product, the default is set as 'SquareFoot'.

The use case is, when users with 'China' profile try to add a Product to Opportunity, the 'Unit of Measurement' Picklist field should default to 'Meter'. When any other profile user tries to add the Product, the default value should be 'Square Foot'. Right now since the default value is set as 'Square Foot', users with 'China' profile who forget to change the default are saving records with 'Square Foot' as Unit of measure.

9
  • Record types wouldn't fix the problem you're apparently facing.
    – sfdcfox
    Oct 15 '18 at 13:44
  • Is there another way to solve this problem?
    – Sooraj
    Oct 15 '18 at 14:39
  • 1
    As we said, I cannot think of a solution without a bit of code (not sure if flow can help, not an expert there...) . Is this a change that you want to make mandatory (i.e.: China users can ONLY save meters). If so, you could use WFR to fix the data or VR stop them entirely. Oct 15 '18 at 15:49
  • 1
    As a start, I would recommend a validation rule to "force" your China users to make this change before they can save a record. Its unfortunate you can't easily set the value for this field using using a formula based on the record owner or createdby's profileId. To do that, I think you'd need to use code for the page you're using to create the record. I don't think you could make it work with a standard detail page since it will look for a value, not a formula result. Most likely you'd need to use a workflow rule to set it based on formula result using the profileId's value.
    – crmprogdev
    Oct 15 '18 at 19:27
  • 1
    An idea that might be worth exploring. Introduce another field that will hold the square meter value. Then copy and covert the value from that field to the square foot field on change. Vice verse for changes from the sq. foor to sq. meter field. Then just show the applicable field on the page layout based on the profile. The trick will be stopping cyclic updates from one field to the next. Oct 15 '18 at 20:23
1

Expanding on my comment.

You might find it easier to maintain two separate fields. One with the square foot value and one with the square meter value. This will allow users to input values in the units they are used to working with. Plus you can use the values directly in reports without the need for an additional formula field.

If one field is updated, update the other one with the converted value. You will need to ensure you don't get into a loop of updates between the two fields.

Use the page layouts based on the profiles to ensure users are seeing the correct value for their locale.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.