locked
populate text field from lookup RRS feed

  • Question

  • Hi 

    I would like to auto populate a text field from a lookup.

    The Lookup is called Contract Currency with two options, either Pound Sterling or US Dollars.

    The text field is called Charges. I would like this field to produce the correct symbol, either £ or $, when the currency is selected from the lookup

    Please could someone help me

    many thanks


    Friday, November 16, 2012 12:05 PM

Answers

  • hi davep,


    if(Xrm.Page.getAttribute("lookupFieldLogicalName").getValue()!=null)

    {

    var currencyName=Xrm.Page.data.entity.attributes.get("lookupFieldLogicalName").getValue()[0].name; if(currencyName=="Pound Sterling") { Xrm.Page.data.entity.attributes.get("textFieldLogicalName").setValue("£"); } else if(currencyName=="US Dollars") { Xrm.Page.data.entity.attributes.get("textFieldLogicalName").setValue("$"); }

    }




    Thanks and Regards. Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.


    • Edited by Ravitheja J Friday, November 16, 2012 12:20 PM
    • Marked as answer by davep123 Friday, November 16, 2012 1:58 PM
    Friday, November 16, 2012 12:19 PM