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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Use Option set and text field in calculated field.

(0) ShareShare
ReportReport
Posted on by

Dear Team,

I have three field on Quote Product form as bellow.

1. FieldA (Option Set) (Values: 10, 20, 30)

2. FieldB (Default single line text field) (values : validate to input only numeric).

3. FieldC (Currency Calculated)(Values: FieldA + FieldB) (e.g. 20 + 300)

Here as we know in currency calculated- FieldC i cannot use FieldA or FieldB as they are not currency type to calculate. How can i achieve the same for FieldC.

Waiting for your precious reply AEAP.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    purwar purwar Profile Picture
    2,836 on at

    Convert string into currency:

    var days=Xrm.Page.getAttribute(new_days).getValue();

    var cost=Xrm.Page.getAttribute(new_cost).getValue();

    var Totalcost=cost*days;

    Xrm.Page.getAttribute(new_Total).setValue(parseFloat(eval(Totalcost)));

    If u are using exchange :

    msdn.microsoft.com/.../gg328355.aspx

  • Verified answer
    mscrmba Profile Picture
    on at

    Hi Abhijit,

    Minimal code approach:

    If you add a currency field (that is hidden) call it 'FieldA Currency'

    Then use a workflow (possibly a real time workflow would be best) to update the hidden field to value = 10 (if 10 is selected), 20 (if 20 is selected) and 30 (if 30 is selected)

    If there is only a limited number of options this is quite feasible.

    Add another currency field (that is hidden) call it 'FieldB Currency'

    Why did you need to make Field B a text field...?  (If it's because the currency might not be set, then I'd suggest a business rule to default the currency would be a better option.)

    Otherwise you'd need jscript/a plugin to copy the data from the text field to a currency field.  (Refer to the post directly above this for details on how to do that.)

    (You can set a Currency field based on a  Floating Point field using a business rule if that was an option for you.)

    Then you should be able to use a calculated field for FieldC  (based off 'FieldA Currency' + 'FieldB Currency')

  • Verified answer
    Abhijit Kadam Profile Picture
    on at

    Can you give me the workflow steps to update the "FieldA currency" value. As i am doing such i can input if condition but cannot write the then condition in the workflow.

  • Verified answer
    mscrmba Profile Picture
    on at

    Sure will get back to you in a few minutes - just need to take some screenshots for you.

  • Verified answer
    Abhijit Kadam Profile Picture
    on at

    I am trying to use jscript, I have bellow option set.

    FieldA OS --> Label : 12.36  Value : 1000000

                          Label : 10.36 Value  : 1000001.

    Value is taken by default while creating the label in option set.

    When i select 12.36 in option set the change event of option set revert with 1000000 value in "FieldA Currency", but i need 12.36. Please let me know the proper jscript code. My code is as bellow.

    function setOptionSetValueByText(context) {

     var options = Xrm.Page.getAttribute("new_FieldAOS").getValue();

           Xrm.Page.getAttribute("new_FieldACurrency").setValue(parseFloat(eval(options)));

    }

  • Verified answer
    purwar purwar Profile Picture
    2,836 on at

    To get label :

    Xrm.Page.getAttribute(“OptionSetSchemaName”).getText();

    To get value

    Xrm.Page.getAttribute(“OptionSetSchemaName”).getValue();

    Kindly try :

    var options = Xrm.Page.getAttribute("new_FieldAOS").getText();

    Xrm.Page.getAttribute("new_FieldACurrency").setValue(parseFloat(eval(options)));

  • Verified answer
    mscrmba Profile Picture
    on at

    Apologies for the delay - unavoidably detained....

    The workflow approach:

    Real time workflow:

    5430.Opp2.PNG

    5430.Opp2.PNG

    CurrencyA.PNG

    You could add an additional equivalent workflow that ran just before change also that decremented by the old value - to cover for the situation where they changed their mind as to the 'score'.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans