Jump to content

Fallen

Members
  • Posts

    4
  • Joined

  • Last visited

Fallen's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Why dont you try to use IF condition ? Is there any condition to use ?
  2. Hi Ingolme, Here is my code : function callRetrievePList() { var field = Xrm.Page.data.entity.attributes.get("new_taxincl"); if ((field == null) || (field.getValue() == null) || (field.getValue()[0] == null) || (field.getValue()[0].id == null)) return; var plistfield = Xrm.Page.data.entity.attributes.get("pricelevelid"); if (plistfield != null && plistfield.getValue() != null) return; var options = "$select=PriceLevelId,Name&$filter=new_vergidahil/Id eq (guid'" + (field.getValue()[0]).id + "')"; SDK.REST.retrieveMultipleRecords("PriceLevel", options, retrievePListCallBack, errorCallBack, completeCallBack);}function retrievePListCallBack(retrievedStock) { var kdvgost = Xrm.Page.data.entity.attributes.get("new_taxincl"); var deger = kdvgost.getValue(); if (deger == "0") { var plistfield = Xrm.Page.data.entity.attributes.get("pricelevelid"); if (plistfield != null && plistfield.getValue() != null) return; for (var i = 0; i < retrievedStock.length; i++) { var stock = retrievedStock[i]; var lookupReference = []; lookupReference[0] = {}; lookupReference[0].id = stock.PriceLevelId; lookupReference[0].entityType = "pricelevel"; lookupReference[0].name = stock.Name; plistfield.setValue(lookupReference); } }}function errorCallBack(errorObject) {}function completeCallBack() {}
  3. Hello! im so new to javascript, my situation is beginner of the beginner But i have to write a code on mscrm 2011 order entity. i have two field, pricelevelid and new_taxincl(radio button). I want to change value in pricelevelid field based on selection of new_taxincl field. If user select ''yes'' i want to fill pricelevelid field with ''USD -Tax Included-'', ''no'' ''USD -without tax-''. This have to run onChange event. I could not write the correct code so far. Any help will be fine for me. Thanks.
×
×
  • Create New...