Discussion:
Auto populate multiple fields from related table
(too old to reply)
Gustho
2010-04-28 00:41:02 UTC
Permalink
Hi there ,

I have Incident entity which has 1:N relationship with a Custom table (Part
Master). Lookup field is created on Part # on the Incident form, When I
open a new Incident , on entering the Part # I would like to display whole
bunch fields on the Incident form from the related Part Master. Also would
like to assign some of these fields to the Incident record.

Any ideas how can this be done ? Any help is appreicated.

Thank you in advance.

Gustho
Patrick
2010-04-28 08:47:01 UTC
Permalink
To do this you will need to write a javascript for the part onchange event to
call the CrmWebservice retrieve the selected entity and update the field on
the incident field.
Calling the webservice for javascript can be done using
http://crmtoolkit.codeplex.com/releases/view/39228, this is a library which
simplifies the soap calls. There is a link available with some samples.
--
Patrick Verbeeten (MCPD)
CRM/.NET Consultant

Tools for CRM Developers and Administrators
http://www.patrickverbeeten.com/Tools.aspx
Post by Gustho
Hi there ,
I have Incident entity which has 1:N relationship with a Custom table (Part
Master). Lookup field is created on Part # on the Incident form, When I
open a new Incident , on entering the Part # I would like to display whole
bunch fields on the Incident form from the related Part Master. Also would
like to assign some of these fields to the Incident record.
Any ideas how can this be done ? Any help is appreicated.
Thank you in advance.
Gustho
Dave
2010-04-28 15:05:03 UTC
Permalink
Post by Gustho
Hi there ,
I have Incident entity which has 1:N relationship with a Custom table (Part
Master).  Lookup field is created  on Part # on the Incident form, When I
open a new Incident , on entering the Part # I would like to display whole
bunch fields on the Incident form from the related Part Master.  Also would
like to assign some of these fields to the Incident record.
Any ideas how can this be done ? Any help is appreicated.
Thank you in advance.
Gustho
Gustho,
Firtst, I believe you have a N:1 relationship, as a 1:N relationship
creates a lookup on the N side. (And, a left nav bar entry on the 1
side that shows the Many in a grid form.) For you, this means that a
Part# from Part Master can be found on many Incidents, but each
Incident can only have 1 Part# from Part Master. If this is NOT
correct, then you probably have a N:N relationship between the two,
which complicates matters. Assuming you have an N:1, tho:

1) To display a bunch of fields, the best/easiest way is to create an
iFrame on its own tab on the Incident page that dsplays the Part
Master Associated View (search the net for this, there are at least 3
solutions out there - I like Stunnware's...) (Note that this won't
work exceptionally well if you have many more fields than can easily
be seen while scrolling in the Associated view, so start with
modifying that view to contain all of the desired fields, and make the
go/nogo decision from that.) I'd probably create an onLoad
Javascript function that checks to see if a value is in the Part#
field, and if so, activates the iFrame. (If not, then hide that
tab.) I'd then call that function from the onChange event on the
Part# field, so that if you change it, the new data will display.

2) To assign some fields to the incident record involves:
a) Creating those attributes on the incident record, and placing them
on a form (I'd suggest the same iFrame page, so they only appear after
you select a Part#).
b) Adding more onChange Javascript to your Part# field. (This would
be tougher coding.) I typically use some sort of wrapper around the
call to simplify it, but basically you would query the Part Master
entity with the GUID of the Part# selected, and assign the incident
attributes the desired values from the Part Master entity.

There is quite a bit to this, but a combination of dispaying fields
from the Associated View and assigning values to custom incident
attributes should get you what you're looking for. Good luck,
Dave

-------------------------------------------
David L. Carr, President
Visionary Software Consulting, Inc.
Cell: 503-351-4207
Email: ***@earthlink.net
http://www.vscrm.com

Loading...