Hello,
is it possible to access fields dynamicly? For example, I want to write a
value to a field. But I know which field this is only at runtime. I think for something like
this example shows:
account testContact = new Contact();
testAccount.Fields["City"] = "Berlin";
There is no "Fields" in Contact. That's only an example to show
what I mean. Is there any possiblility to use fields in this way?
Thanks,
Kai
0
Comments
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
In that function you can use recordref and fieldref variables
You cannot do this through publishing pages as webservices.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
So, by using this method, Concurrency may become an issue.
Ahmedabad, Gujarat, India
E Mail : ravi.thakkar@hotmail.com
The bigger issue is managing transactions. Each call to a cu is a separate transaction. so you need to pay attention how transaction are committed and rolled back.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
http://blogs.msdn.com/freddyk/archive/2009/04/27/dynamic-references-to-nav-page-web-services-in-c.aspx
If you just want to assign a field through reflection you would do:
I use that in a number of places - although the above code is just written from the top of my head, so there could be spelling mistakes.
Group Program Manager, Client
Microsoft Dynamics NAV
http://blogs.msdn.com/freddyk
The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.
Really it's a nice blog which you have posted.
Really it will be helpful to many. =D>
Thanks.
Ahmedabad, Gujarat, India
E Mail : ravi.thakkar@hotmail.com
If you did fields dynamicly in webservices. then can u help me to insert and update sales order dynamicaly using C#.net Reflection namespace. I am able to read sales orders but not able to insert and update. i am not able to setvalue of propertyinfo filed and pass that property filed to insert method or update method or the web service
if you have any code sample the kindly relply to this post
:?
Thanks and Regard
Raju