CRM Live - JScript to pull data from Account field to Opportunity field? RRS feed

  • Question

  • Hi all,
    I'm trying to find the best way to pull data from a field on an Account record, to an Opportunity record.
    I don't understand Soap and Webservice.

    Would something like this work (as OnLoad in my Opportunity)?
    If not, is there a way to correct the code so that it does grab the correct value?

    var lookupItem = new Array;
    lookupItem = crmForm.all.customerid.DataValue;


    Thanks! -matt
    Tuesday, March 10, 2009 6:32 PM


All replies

  • is this something you only need populated when you create an opportunity from an account record? - if so, there is an easier way - go into settings, customization and modify the mapping that exists on the relationship between an account and an opportunity.

    Once added and published, when you create an opportunity from an account record, the mapped information will be populated in the opportunity. (much like a company's address is mapped to any new contact created off that company record.)

    If it's something that needs to be done real-time or on an on-going basis, you will need to follow the more involved code route you're already looking at.
    Scott Sewell CustomerEffective.com
    Tuesday, March 10, 2009 7:13 PM
  • Matt -

    did this solve your question? - Mapping the attributes would certainly be the easiest method.

    I found this earlier, but didn't think of it when I was answering your question - it does access the webservice, but it could be easily 'tweaked' to fit your needs even if you wouldn't feel comfortable writing this from scratch.

    Here it is -  Jim Wang posted this excellent script that will allow you to grab values from a parent entity.

    Scott Sewell, CustomerEffective | http:\\blog.CustomerEffective.com | Twitter:@ScottSewell
    Tuesday, March 24, 2009 9:34 PM