Question

How to create dynamic folder programatically

Hello Everyone,



Hope all are fine and healthy,



I have a scenario where I have to take the users through few (let's say 2-3 ) preconfigured pages where they will fill values in fields displayed on the pages (for ex. A = true, B= false, Country = Australia) and once they submit on the last page, then they should be redirected to the section page and a dynamic folder should be automatically created having the filled in values by the users as filter conditions (A = true, B= false, Country = Australia).



Can anyone suggest an approach to this scenario.



I have checked that whenever we create a folder with filter confitions a record will be created in table "ObjectFolder" where In "SearchData" column our applied filter condition will be stored as bytes.

But still not getting any Idea on how to approach this problem.



Thanks you very much for your time.

Like 0

Like

4 comments

I have an article that shows the opposite, how to read the filter conditions from a folder and use in an ESQ. https://customerfx.com/article/programmatically-using-section-folder-fi…

Perhaps you could work backwards from there to do the opposite? It appears you could just form the ESQ filters as JSON, then use System.Text.Encoding.GetBytes to get the JSON as a byte array and write back to SearchData using the entity class SetBytesValue function.

Hope this helps get you started.

Ryan

Hi Ryan,

 

My code looks like below so far 

 

As per your Instructions, I have created ESQ filters but didn't know how to convert them to JSON.

 

Please help !

 

Hi Ryan Farley,

 

I try to write and run below code 

 

And it is giving me below error : 

Newtonsoft.Json.JsonSerializationException: Self referencing loop detected for property 'Provider' with type 'Terrasoft.Core.ManagerProvider'. Path 'Manager.DataValueTypeManager.Provider.AppConnection.LicManager'

 

Any help please !

Hi Team,

 

Any help in this case please.

Show all comments