Quantcast
Channel: Forum CRM Development
Viewing all articles
Browse latest Browse all 1000

Correct way to follow relationships in plugin using strongly typed objects

$
0
0

Hi, I am new to plugins and have been following tutorials, etc.

I have a plugin that I am playing with. I have got strongly typed objects and understand that the target can be an entity depending on the message, etc. I also understand about preimages and postimages.

What I am looking at in simple terms is this:

when a user updates an account, I want to get the data fort eh account and it's primary account entity and send this to a web service.

I can get a strongly typed Account object and understand that casting the target to Account will only have the data that is being updated. I have also cast the preImage to a strongly typed Account object. With the preImage object, even though the record has a primary contact set (this was saved previously), when I try preImage.account_primary_contact I get a null reference error.

Am I doing soemthing wrong here? My other thought was to manually load the Account object to test the data that way. How do I retrieve a full Account record using the guid to a strongly typed object? should I use service.retrieve?

One I have a full Account object, will the properties for relationships be populated - ie will theAccount.account_primary_contact have a populated Contact object? or do I need to do something else? it seems that following the relationships using dot notation should work?

thanks in advance for the help!

james




Viewing all articles
Browse latest Browse all 1000

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>