Module Creating/Retrieve dynamic field Value

Posted by Community Admin on 03-Aug-2018 06:20

Module Creating/Retrieve dynamic field Value

All Replies

Posted by Community Admin on 21-Jan-2011 00:00

Hi,

I have already created Dynamic Data field with values like or used below API 

sf.Documents().GetManager().Provider.SuppressSecurityChecks = true;
                sf.Document().CreateNew().Do(item =>
                
                    item.Parent = sf.DocumentLibraries().Where(l => l.Title == ModuleName).Get().FirstOrDefault();
                    item.Title = title;                    
                    item.UrlName = title + "_Application";
                    item.SetValue("id", id);
                    item.SetValue("FullName", "SitefinityCMS");
                ).Publish();

and i want to retrieve the FullName Column value i.e SitefinityCMS using API.
Please let me know how to get those values as soon as possible.

Posted by Community Admin on 21-Jan-2011 00:00

Hi Mohammad,

There is DataExtension method GetValue that you can use to get the value of your custom field.

Greetings,
Ivan Dimitrov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 21-Jan-2011 00:00

Hi 
Thanks for valuable reply.

Please explain me little more with syntax then i can understand well.

Posted by Community Admin on 21-Jan-2011 00:00

Hello ,

Here is a sample

var manager = LibrariesManager.GetManager();
var id = new Guid("6e8230d5-9ba6-43ed-9aaa-4fc7de1c76c3");
var item = manager.GetItem(typeof(Image), id) as Image;
var value = item.GetValue("FullName");


Regards,
Ivan Dimitrov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 21-Jan-2011 00:00

Hi

If i try that code i am getting the following error.

var item = manager.GetItem(typeof(Image), id) as Image; this line gives 
You are trying to access item that no longer exists. The most probable reason is that it has been deleted by another user.

Please solve my problem
Thanks

Posted by Community Admin on 21-Jan-2011 00:00

Hello Mohammad,

Most probably you are not passing an valid ID of the item.

Kind regards,
Ivan Dimitrov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 21-Jan-2011 00:00

HI
Thanks for your express reply.
I got the solution

 

Posted by Community Admin on 03-Feb-2011 00:00

Hi

I can get value dcs.GetValue("ID").Equals("IDvalue")

is it possible to do 

dcs.GetValue("Date").  =< (Equals or Greater then) ("DateValue")


Posted by Community Admin on 13-Feb-2011 00:00

Hello Jmr,

GetValue returns an object and this is why you can use Contains directly. To make comparison by other parameters you need to cast the object ( for instance to string) and then use proper expressions.

Best wishes,
Ivan Dimitrov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 07-Apr-2011 00:00

Hi,

If you have a ContentItem how to you retrieve a dynamicfield for it?

Cheers,

Seth

Posted by Community Admin on 07-Apr-2011 00:00

Hello ,

There is extension method GetValue("yourfield") of the content item .You should have reference to DataTelerik.Sitefinity.Model.

Regards,
Ivan Dimitrov
the Telerik team


Posted by Community Admin on 11-May-2011 00:00

Hi Ivan,

I tried to use:

var manager = LibrariesManager.GetManager();
var id = new Guid("6e8230d5-9ba6-43ed-9aaa-4fc7de1c76c3");
var item = manager.GetItem(typeof(Image), id) as Image;
var value = item.GetValue("FullName");


However I can't find the GetValue method in the Image.
Also tried this:
DataExtensions.GetValue(item, "FieldName");

And it doesn't like the fact that item is not type of IDynamicFieldsContainer.

Can you please advise?

Thanks,
Evan 

Posted by Community Admin on 13-May-2011 00:00

Hello ,

Have you added using Telerik.Sitefinity.Model;

Best wishes,
Ivan Dimitrov
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed