Cross tenant updates of Databases on tables separated by companyID - acumatica

I have a table that has a CompanyID column.
Lets say I have the following 2 records
CompanyID KeyValue Descr
2 00000001 This is the record in tenant 2
3 00000005 This is the record in tenant 3
Can I use something like PXDatabase.Update to update the CompanyID = 3 record (change the description to "This was updated from tenant 2") from some process running in the context of tenant 2?

You can't because all the database operations you do will be constrained to the current tenant by BQL. If you want to update something in another tenant, you have to initialize a PXLoginScope.

Related

How can I compare the properties of a vertice, to the properties of another vertice

I'm using Gremlin to interact with a Graph in CosmosDB.
I have some data about employees, data they have access to and departments where both originate from. See below for an example.
I want to retrieve information from my graph about which employees have access to data, but doesn't belong in their department. Basically, I want to see where the department columns are not equal, but the column data_access and data_id are equal, for every database the employee has access to. From the example below I would return information employee_id 1 and 2.
employee_id
name
department
data_access
1
john
A
4
2
rick
B
5
3
nick
A
5
dataset_id
name
department
4
apples
B
5
oranges
A
So far I tried to construct queries using traversal steps like "has", "as", "where" but I couldn't achieve the result I want. I'm very new to Gremlin, so I have no idea if what I'm doing is even the right way to do it.

SSAS: cell data security for multiple measures

I have multiple measures, i want to restrict each individual measure.
department measure1 measure2 measure3
A NULL 1 NULL
B 1 1 1
C NULL 1 NULL
can i do this with cell data restrictions?
essential this is a combination of roles
Role 1 - only give access to measure2
Role 2 - only allow department B to see all measure
Role 3 - would be the intersect of both
Role 1:
The SSAS Role setting actually allows you to set restrictions based on Measurement in the Dimensional Data page. so unselect all others and only leave "measure2" for users in "Role1" to read.
Role 2:
Similarly, go to the Dimensional Data page, zoom into the department dimension, select only the "department B".
Role 3:
Repeat the above settings together in the Dimensional Data page of "Role3".
And keep in mind, SSAS Access is additive, means if there is any user existing in both "Role1" or "Role2", basically there is no restriction for it at all.

Shoudl I create seperate column family if I want to query on many columns ? or use composite PK?

I have a column family like
object
(
obect_id,
company-id,
group_id,
family_id,
description,
..
);
I want to query that based on object id, company id ,group id and any combination of these.
My question is
should i make composite primary key
(object id, company id ,group id)
or create seperate column familis ?
only object id is unique in CF, company id can repeat in multiple rows, but group iddoes not repeat in many rows
You may well want to duplicate your data in multiple CFs depending on your query patterns. This is quite common practice.
If a common query is "Get all objects by company_id" then you might want to store all objects with in a CF with partitioned just by company_id as a row key. If you need to do individual object lookups as well, then you store that data duplicated in another CF - each object partitioned by object_id. If groups are always a subset of a specific company, perhaps you want to row key by company, but then cluster by group.
You should be designing your Cassandra schema based on the queries you need to run, rather than the data that needs to go in it.

Azure table storage store multiple types

What do you recommend in the following scenario:
I have an azure table called Users where as columns are:
PrimaryKey
RowKey
Timestamp
FirstName
LastName
Email
Phone
Then there are different types of tasks for each user let's call them TaskType1 and TaskType2.
Both task types have common columns but then have also type specific columns like this:
PrimaryKey (this is the same as the Users PrimaryKey to find all tasks belonging to one user)
RowKey
Timestamp
Name
DueDate
Description
Priority
then TaskType1 has additional columns:
EstimationCompletionDate
IsFeasible
and TaskType2 has it's own specific column:
EstimatedCosts
I know I can store both types in the same table and my question is:
If I use different tables for TaskType1 and TaskType2 what will be the impact in transactions costs? I will guess that if I have 2 tables for each task type and then I will issue a query like: get me all tasks where the task Primarykey is equal to a specific user from Users table PrimaryKey then I will have to run 2 queries for each types (because users can have both tasks type) that means more transactions ... instead if both tasks are in the same table then it will be like 1 query (in the limit of 1000 after pagination transactions) because I will get all the rows where the PartitionKey is the user PartitionKey so the partition is not split that means 1 transaction right?
So did I understood it right that I will have more transactions if I store the tasks in different tables .. ?
Your understanding is completely correct. Having the tasks split into 2 separate tables would mean 2 separate queries thus 2 transactions (let's keep more than 1000 entities out of equation for now). Though transaction cost is one reason to keep them in the same table, there are other reasons too:
By keeping them in the same table, you would be making full use of schema-less nature of Azure Table Storage.
2 tables means 2 network calls. Though the service is highly available but you would need to take into consideration a scenario when call to 1st table is successful however call to 2nd table fails. How would your application behave in that scenario? Do you discard the result from the 1st table also? By keeping them in just one table saves you from this scenario.
Assuming that you have a scenario in your application where a user could subscribe to both Task 1 and 2 simultaneously. If you keep them in the same table, you can make use of Entity Group Transaction as both entities (one for Task 1 and other for Task 2) will have the same PartitionKey (i.e. User Id). if you keep them in separate tables, you would not be able to take advantage of entity group transactions.
One suggestion I would give is to have a "TaskType" attribute in your Tasks table. That way you would have an easier way of filtering by tasks as well.

membershipgroupid value

I have two different websites created with the same web template on two different web applications.$
On one, my visitor membershipgroupid = 6
On the other, 7.
How is it possible ?
Thank you by advance
Since different webapps as a rule have different databases they do not share ids for web and site specific objects. if there were 5 records in a table X in database A and 6 records in a table X in database B then after creation of a new record in database A in table X its id would be incremented to 6 and after creation a new record in table X in database B the id of a new record would be incremented to 7.

Resources