question

Upvotes
Accepted
5 0 1 2

I am currently using =TR("0#JGBc1","","CH=Fd RH=IN",A2) to retrieve the current contract name ("DJGBH8") for JGBc1. How can I perform the same operation in .NET SDK?

eikoneikon-app-studio
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Understood thanks.

1 Answer

Upvotes
Accepted
38.1k 71 35 53

You can retrieve the same information from Real-time data.

0#JGBc1 is a chain RIC so you can use IRealtimeService::GetChain to get the constituents of a Realtime chain.

IRealtimeService realtime;

...
realtime.GetChain("0#JGBc1", data=>{
                    foreach (var ric in data)
                    {
                        Console.WriteLine(ric);
                    }
                }, error=>{
...
                });

After running, it will print the following.

JGBH8
DJGBH8

For more information regarding chains, please refer to Tutorial Real-time data in Chains section.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Thank you very much, that works well, but leads me to my next question: is there a way of forcing a sequential retrieval of information, instead of asynchronous? In this case, I need to pick out the current label in the chain as a RIC for a subsequent query. I would also like to know if possible in general.

Instead of using 0#JGBc1 chain you can get DJGBH8 from JGBc1, FID 6376 MBP_RIC:

IRealtimeService realtime;
...
realtime.Request("JGBc1", "MBP_RIC", mbpRic => {
			Console.WriteLine(mbpRic.ToString());
		});

But either way data retrieval is asynchronous. This API does not provide synchronous data retrieval.

Click below to post an Idea Post Idea