SSA field and on change script

Is it possible to use an on change script with a search select advanced field?  When I attempt this, I loose my SSA selection list.

Based on the selection in the SSA field (which is an address record), I want to populate the value of other fields on the screen.

This is on an opportunity record.  The SSA field represents a project location id.  Therefore, I want to populate the project address in other fields (address, city, state, zip).

What is the best way to achieve this?

Any assistance would be greatly appreciated.  Thank you!

Parents
  • Michele

    Are you denormalizing the data?  Do you need to copy down the Address lines to child record?  Could you get a way with simply displaying the data on the screen?

  • Currently, I have a table level script that populates the opportunity record with the address information when the opportunity is inserted or updated.

    However, they want to see the address populate the address fields as the record is being inserted or updated while the record is in "Edit" mode.  Since I am currently using a table level script, I have removed the address fields from the screen while the record is in "Edit" mode because I have not been able to get the SSA field to show data if I put script in the OnChange box.

    If the data in the SSA field is changed, they want the related data to automatically update in the other fields.

    We are entering an opportunity record.  The SSA field is an address record.  The address represents a project site.  On the address record, there is a field that represents the project site through a text field.  The text field is what is used to display the project site through the SSA field.

    On the opportunity record, the user selects this project location from the SSA field.  When this occurs, they want the project location address fields to populate on the opportuntiy detail screen.  The project location field is located on the web picker screen.

    Related fields are as follows:

    oppo_opportunityid

    oppo_projectsiteid <--- is the Address record id (SSA field "displays" the text (addr_projectsite) for selection)

    oppo_projectaddress  <--- populate field from address record

    oppo_projectcity  <--- populate field from address record

    oppo_projectstate  <--- populate field from address record

    addr_addressid <--integer for project site record

    addr_projectsite <--text identfier for project site

    I don't know how to make this work if I cannot use the OnChange box with an SSA field.

    I hope what I have explained above makes sense.  The company uses something other than the address to identify the project site.

    An example would be if you wanted to represent "lots" in a community development.

    You might have a community called All My Houses (AMH), with the following lots.

    Site             Address

    AMH01  -  1231 My Street, Indianapolis, IN

    AMH02  - 1232 My Street, Indianapolis, IN

    AMH03  - 1233 My Street, Indianapolis, IN

    They want to pick the Site and have the address populate.

    Thank you for your assistance!  It is greatly appreciated!!!

Reply
  • Currently, I have a table level script that populates the opportunity record with the address information when the opportunity is inserted or updated.

    However, they want to see the address populate the address fields as the record is being inserted or updated while the record is in "Edit" mode.  Since I am currently using a table level script, I have removed the address fields from the screen while the record is in "Edit" mode because I have not been able to get the SSA field to show data if I put script in the OnChange box.

    If the data in the SSA field is changed, they want the related data to automatically update in the other fields.

    We are entering an opportunity record.  The SSA field is an address record.  The address represents a project site.  On the address record, there is a field that represents the project site through a text field.  The text field is what is used to display the project site through the SSA field.

    On the opportunity record, the user selects this project location from the SSA field.  When this occurs, they want the project location address fields to populate on the opportuntiy detail screen.  The project location field is located on the web picker screen.

    Related fields are as follows:

    oppo_opportunityid

    oppo_projectsiteid <--- is the Address record id (SSA field "displays" the text (addr_projectsite) for selection)

    oppo_projectaddress  <--- populate field from address record

    oppo_projectcity  <--- populate field from address record

    oppo_projectstate  <--- populate field from address record

    addr_addressid <--integer for project site record

    addr_projectsite <--text identfier for project site

    I don't know how to make this work if I cannot use the OnChange box with an SSA field.

    I hope what I have explained above makes sense.  The company uses something other than the address to identify the project site.

    An example would be if you wanted to represent "lots" in a community development.

    You might have a community called All My Houses (AMH), with the following lots.

    Site             Address

    AMH01  -  1231 My Street, Indianapolis, IN

    AMH02  - 1232 My Street, Indianapolis, IN

    AMH03  - 1233 My Street, Indianapolis, IN

    They want to pick the Site and have the address populate.

    Thank you for your assistance!  It is greatly appreciated!!!

Children
  • Can you not get onchange to work on an Search Select Advanced field?  You can pop this on a onChange script

    crm.infoMessage(CurrentUser.user_displayname + " changed me");

    For something like 'oppo_primarypersonid' in the Opportunity Web Picker and it fires when it should.

    Once you have the event fire you can use the crm.sdata() method to do an AJAX fetch of the data from the address table.