Advertisement
Guest User

Pull Info from Related Record in CRM 2011

a guest
Feb 27th, 2012
466
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function Form_onload(){
  2. var store = Xrm.Page.data.entity.attributes.get("new_store").getValue();
  3. if (store != null)
  4. {
  5. var new_storeid = Xrm.Page.getAttribute("new_store").getValue()[0].id;
  6. var retrieveResult = null;
  7. retrieveResult = CrmServiceHelper.Retrieve("new_store", new_storeid, ["new_tax"]);
  8. Xrm.Page.getAttribute("new_tax").setValue(parseFloat(eval(retrieveResult.attributes.new_tax.value)));
  9. }
  10. else if (store != null)
  11. {
  12. Xrm.Page.getAttribute("new_tax").setValue(0);
  13. }
  14. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement