Cesium - update entity description - javascript

I have below entries in database.
DB Entries
I have used SampledPositionProperty to add these samples for each entity and then created the entity in Cesium. I want to show these entities all the time so won't be able to use availability property on each sample.
SampledPositionProperty code
Entity creation code
but I want to update the entity description based on sampled time.

Related

Add column to all database tables as predefined and append it as index to all indexes to be defined?

Currently I'm implementing a multi-tenant solution using single shared database by defining A tenant column in each database table.
I'm thinking of automating this process by adding a tenant column by default to each and every table on creation, and add the tenant as index composite with any defined index in the table.
Using Prisma and postgres, I tried to create a custom generator and adjust the options.dmmf.datamodel models, and I was thinking to overwrite the current schema with the new one. But somehow I can't generate a schema from options.dmmf.datamodel.
So, is there a function to convert options.dmmf.datamodel to string?
Is this even the right way to do so?
Another Solution would be create an event trigger ON CREATE and create that column, but this will make prisma migration out of sync with database!
For now, you would need to manually add the tenant column in new tables.
There's a Feature Request: #2506 for adding support for Inheritance which would allow you to inherit the tenant column in every table.

How to have multiple entries for custom entity?

In our Dynamics CRM online custom project - we've the default ACTIVITIES tab in a custom entity named DocProject's form
ACTIVITIES is able to take multiple entries.
Also, there is NOTES tab in the same form
NOTES is also able to take multiple entries.
Okey, this is done by Dynamics CRM guys. So far so good.
In the same form, we also have a DocProjectActivities lookup field for a custom entity DocProjectActivities
This is a lookup field, hence it has got a 1:N relationship.
Clarification: Our problem is not only about Activities. WKT Notes also behaves similarly. We just need some config which will allow us to make multiple entries for one single field
Problem:
How do one makes sure that this custom entity DocProjectActivities allows to make multiple entries as that for ACTIVITIES & NOTES?
In order to have the associated activity grid like the one in the DocProject entity, you need to enable the option Activities when you're creating the entity (this option can't be changed after the entity is created). This option will create the association with the activities entities and allow you to track all the related phone calls, task, etc.
I think that the problem that you're having is that you defined the DocProjectActivities as an activity entity and therefore you can't have this kind of relationship with the other activities entities. I recommend you to take a look to the differences between Entities and Activity Entities.
Do you mean you need multiple docprojectactivities on the form where you have the activities?
You need to create a 1:n relationship between the form and the docprojectactivities and add the subgrid on that form allowing you to create multiple records for the docprojectactivities.
A lookup field is the '1' side of the 1:n relationship and thus the wrong direction.
Go to docprojectactivities, add a new field type relationship towards the entity you are working on.
Save and publish.
Now go back to the form designer of the entity you need the entries on and go to the tab 'insert'.
Click on sub-grid and select only related records docprojectactivities (entity you are working on)
If you want your custom entity to work as an activity entity, you should have selected "Define as an activity entity" when you created it.
You cannot make a normal lookup field to multiple entities (with the exception being the possibility of creating Customer fields that was introduced in 2016.1).

CRM2011 check if notes on custom form contains data via JavaScript

Hi peeps on stackoverflow,
Product: CRM2011, should be latest roll-up
I'm currently trying to get the following to Work:
- A custom CRM form has been made. This form contain the 'Notes' tab. I would like to dynamically 'expand' this IF and only IF the 'Notes' tab contains notes data. I'm trying to do this through JavaScript loaded into 'Form Libraries'. I can easily 'expand' the notes field but I'm having serious trouble determining if the 'Notes' tab contains notes data.
I can understand that accessing the 'notes' data through the DOM is not a good idea so I've tried through XRM. Looked through https://msdn.microsoft.com/en-us/library/gg334351(v=crm.5).aspx to see my options. But I can't seem to get to one where I can access 'notes' and base the expansion of the notes field on if there is data or not in 'notes'.
Is this possible? I'm looking forward to hear from you and thank you very much.
Notes are their own entity type, entity logical name is Annotation, that is why you won't find the notes data within Xrm.Page. I'm making some assumptions here, but if you've set up this custom entity to follow standard conventions, any notes on that record will be separate Annotation records with a reference to the custom entity record. using the sdk.jquery.js script provided with the SDK you can do a query on Annotation records that reference the record you are currently on. That would be a supported way to determine if the record has notes. Using the OrganizationData.svc endpoint you would have an OData query that looks something like this
AnnotationSet?$filter=ObjectId/Id eq guid'34d19133-c0ec-e311-b39c-6c3be5bd2b14'
The guid value there would be the guid of the record you are currently on, which if you haven't already acquired within your script, you can get it pretty easily with something like this
window.parent.Xrm.Page.data.entity.getId().substring(1, 37)
or without the window.parent prefixing it

Use the auto-generated objectId or create your own Unique ID for mapping classes in Parse

We want to bulk upload data to our mobile backend in Parse. We have two classes :- Store and Product. One store can have multiple products whereas one product can only belong to one store. Now we want to bulk upload products & stores with a CSV / JSON upload.
To do this, according to our research we have two options :-
Use the JSON importer to import objects where we define the ObjectId for both classes manually according to are own IDs.
Create another column for a unique productId and storeId in each class. First upload stores, then upload products where we first lookup the randomly generated objectId for each store using the storeId and use that to generate our pointer in the product class.
Which one is a better option? Are there any drawbacks to manually generating your own objectId?
On the Parse support there is a mention about the risks of having duplicate IDs on a specific class:
Note that you'll need billions of objects before you have even a slight chance of having a duplicate. So you can probably assume that it will not happen. We simply don't enforce it when we generate it.
So I think it's reasonable to assume that you can generate your own objectId's when importing and that will have the same safety/performance as an automatically generated one.

MongoDB schema for this specific csv dataset? (for data vis. purposes)

I have a single csv file with data about schools: their locations, their names and a number of indicator values for each:
County_id, County_name, Municipality_id, Municipality_name, School_id,
School_name, Year, Indicator_1, Indicator_2, Indicator_3 [...]
I am building an interactive JavaScript visualization around this data and would like to serve it using MongoDB.
Some typical queries would be: (pseudo)
Get a list of all Schools and their respective locations
Get all Indicator_1 values for all years for schools in a specific location
Count the number of schools in a specific location
1. Based on the data given, how should I set up my MongoDB documents/collections to be able to answer queries such as the above?
(Hints on what intermediate steps I should take to import and build the schema are also welcome.)
For aggregate queries, check out MongoDB's MapReduce. This by default will create new collections based on your map/reduce functions (but can also run in-memory).
You can use mongoimport to import CSV data into the database, then leverage map/reduce to get the data you want.

Categories