hi
i am writing a plugin on "PLAN CLASS TABLE". I have another table "CLASS REQUIREMENTS". this table has a lookup field "PLAN CLASS" from PLANCLASS TABLE. i want to
read second table. please guide which is best way to do this.
hi
i am writing a plugin on "PLAN CLASS TABLE". I have another table "CLASS REQUIREMENTS". this table has a lookup field "PLAN CLASS" from PLANCLASS TABLE. i want to
read second table. please guide which is best way to do this.
Hi,
You can generate your fetch xml query from advanced find easily. Open advanced find and add below condition then click on Download fetch xml ribbon button.
Building -> Class Reuqirement Table
Employee -> Plan Class(lookup)
Now use below tool to convert your fetxh xml to c#
https://www.ashishvishwakarma.com/FetchXmlFormatter/
Now check below blog on how to use this code in your plugin class file
https://carldesouza.com/dynamics-365-fetchxml-c/
Please mark my answer verified if this is helpful!
Regards,
Bipin Kumar
Follow my Blog: xrmdynamicscrm.wordpress.com/
Have you already registered the plugin on the PLAN CLASS TABLE?
if yes then you can merge this New code with the old one. And make sure get the attribute result before your main operation so that your code will work as expected and will not provide null exception.
i performed these steps. now how i can add this code to my pre-written code. this was a part of bigger project. i want to use the value of these attributes to perform some tasks.
Just like I did above you can follow the same...that is why I have attached the screen shots for your reference.
It is very easy to understand the Fetch XML.
Line number 2 describes the Entity/table on which this query run.
Line 3 to 16 have attributes which we will get.
Line 18 to 20, it is a filter criteria that means "Where" condition...
docs.microsoft.com/.../use-fetchxml-construct-query
dynamics-chronicles.com/.../fetchxml-overview-essential-syntax
Also for the C# code you can refer below articles.
hi sir
i am beginner so dont know how to create query on table. can please explain it in details
Hello ManPreet,
As you will register your plugin on the Plan Class Table,
1. You will get the GUID of the Plan Class Table record.
2. Now Just create a query on the "Class Requirement Table" just like below.
select Class Requirement table
where Plan class Table Record guid = from step 1.
Download this Fetch XML.
3. Fetch XML will look like below.
and that is how you will get the data.
4. Replace GUID with the Dynamic GUID when your plugin will run.
Thank you,
Amit Katariya
André Arnaud de Cal... 291,419 Super User 2024 Season 2
Martin Dráb 230,492 Most Valuable Professional
nmaenpaa 101,156