ID and Hash in Code Studio

How exactly do I find this in CS ?

image

image1750×370 69.4 KB

isn’t in cs.context() and isn’t a cs.config(xxxxx) item either ?

I could assume it from data in cs.context() but since there would appear to be a proper configuration item for it, I should be using it instead.

You might actually be looking for the cs.url_params() option.

So if you url uses a hash that would be the id_hash option, the id might be context_record_id or ‘id’ depending on the URL content. The record_url_identifier may be another option from the url.

If the provided documentation suggests you can do something in Code Studio there should either be better information on where to go look in the code studio documentation or a proper example should be provided.

Since I need the hash anyway (if its enabled as such) I might as well just do a check on whether it exists in the cs.context() object and then construct my url accordingly.

In this scenario i’m not using cs.link() as I’m having to fix an existing AppStore component (DropZone File Uploader) and I dont want to make any fundamental changes to the way it works today.

I think it was intended to be added to cs.config() but doesn’t look like it was. I’ll check and raise a bug for it.

It could be that this is new new code studio functionality - possibly newer than the build studio original functionality and therefore I might not have a recent enough version ….

That being said I’m on 2025.2

Turns out it is available…

cs.config('RECORD_IDENTIFIER_IN_URLS');

which returns either “context_record_id” or “id_and_hash“.

Documentation will be updated to make this clear.

Ah OK - yes that works great.

Thanks again Bob.