Join Account to Sub Account - acumatica

I am trying to create a GI to retrieve a list of GL Accounts with each associated Sub Account value. I have looked in the database and found the GroupMask column which ties the Account and Sub tables together with a bit relationship but I don't know how to join them in the GI. Is there another resolution table I can use to link the two entities?

The only thing I find in standard Acumatica is screen GL403000 (Account by Subaccount). This screen is an inquiry into historical GL data. Although I may be wrong, I believe accounts and subaccounts are defined as separate entities and then become a legitimate combination when used together. For instance, a sub account might be mapped to a department and an inventory account mapped to the item. Material issued to the department would result in the reportable combination of account and subaccount. That means you would have to look for historical usage of an account/subaccount to get the list. That's what GL403000 appears to be doing.
I can't tell you for sure that this is proper, but see if you can find what you need from:
GL.Account -> GL.GLHistory -> GL.Sub
Join Account to GLHistory via AccountID and GLHistory to Sub via SubID. You will want to aggregate the results to unique combinations or filter by period.
The actual code behind GL403000 is:
PXSelectBase<GLHistoryByPeriod> cmd = new PXSelectJoinGroupBy<GLHistoryByPeriod,
InnerJoin<Account,
On<GLHistoryByPeriod.accountID, Equal<Account.accountID>, And<Match<Account, Current<AccessInfo.userName>>>>,
InnerJoin<Sub,
On<GLHistoryByPeriod.subID, Equal<Sub.subID>, And<Match<Sub, Current<AccessInfo.userName>>>>,
LeftJoin<GLHistory, On<GLHistoryByPeriod.accountID, Equal<GLHistory.accountID>,
And<GLHistoryByPeriod.ledgerID, Equal<GLHistory.ledgerID>,
And<GLHistoryByPeriod.branchID, Equal<GLHistory.branchID>,
And<GLHistoryByPeriod.subID, Equal<GLHistory.subID>,
And<GLHistoryByPeriod.finPeriodID, Equal<GLHistory.finPeriodID>>>>>>,
LeftJoin<AH, On<GLHistoryByPeriod.ledgerID, Equal<AH.ledgerID>,
And<GLHistoryByPeriod.branchID, Equal<AH.branchID>,
And<GLHistoryByPeriod.accountID, Equal<AH.accountID>,
And<GLHistoryByPeriod.subID, Equal<AH.subID>,
And<GLHistoryByPeriod.lastActivityPeriod, Equal<AH.finPeriodID>>>>>>>>>>,
Where<GLHistoryByPeriod.ledgerID, Equal<Current<GLHistoryEnqFilter.ledgerID>>,
And<GLHistoryByPeriod.accountID, Equal<Current<GLHistoryEnqFilter.accountID>>,
And<GLHistoryByPeriod.finPeriodID, Equal<Current<GLHistoryEnqFilter.finPeriodID>>,
And<
Where2<
Where<Account.accountID,NotEqual<Current<GLSetup.ytdNetIncAccountID>>,And<Where<Account.type, Equal<AccountType.asset>,
Or<Account.type, Equal<AccountType.liability>>>>>,
Or<Where<GLHistoryByPeriod.lastActivityPeriod, GreaterEqual<Required<GLHistoryByPeriod.lastActivityPeriod>>,
And<Where<Account.type, Equal<AccountType.expense>,
Or<Account.type, Equal<AccountType.income>,
Or<Account.accountID,Equal<Current<GLSetup.ytdNetIncAccountID>>>>>>>>>>>>>,
Aggregate<
Sum<AH.finYtdBalance,
Sum<AH.tranYtdBalance,
Sum<AH.curyFinYtdBalance,
Sum<AH.curyTranYtdBalance,
Sum<GLHistory.finPtdDebit,
Sum<GLHistory.tranPtdDebit,
Sum<GLHistory.finPtdCredit,
Sum<GLHistory.tranPtdCredit,
Sum<GLHistory.finBegBalance,
Sum<GLHistory.tranBegBalance,
Sum<GLHistory.finYtdBalance,
Sum<GLHistory.tranYtdBalance,
Sum<GLHistory.curyFinBegBalance,
Sum<GLHistory.curyTranBegBalance,
Sum<GLHistory.curyFinYtdBalance,
Sum<GLHistory.curyTranYtdBalance,
Sum<GLHistory.curyFinPtdCredit,
Sum<GLHistory.curyTranPtdCredit,
Sum<GLHistory.curyFinPtdDebit,
Sum<GLHistory.curyTranPtdDebit,
GroupBy<GLHistoryByPeriod.ledgerID,
GroupBy<GLHistoryByPeriod.accountID,
GroupBy<GLHistoryByPeriod.subID>>>>>>>>>>>>>>>>>>>>>>>>>(this);
As you can see, it joins Account to GLHistoryByPeriod and then Sub to GLHistoryByPeriod. AH inherits from GLHistory.

Account and Subaccount entities are separate entities without a relationship between each other. GroupMask field is not about their relationship, it is about access restriction. Please correct your question and explain what do you really need? Note that Account and Subaccount are only connected in the scope of some transactional or historical entities, such as GL Transactions (GLTran), AR/AP Documents (ARRegister, APRegister) and many many others.

As it was already mentioned Account and sub account doesn't have direct link between them. If you still want to have some kind of connection between them, then consider adding custom column(s). Before doing this, give an answer on this question:
What will be relationship between account and sub account?
One to one, one to many, or many to many?
What kind of rules regarding defaulting of sub accounts be applied?
As an option if some account is selected on some entity, what sub account should be picked?
Opposite to 4, if some sub account is selected at some entity, what Account should be selected.
And so on. Then you can build customization package which will provide an answer on relationshops.

Related

Assignment of legal entity to roles for users via dmf

I m in need to find the data entity which will help to assign legal entity to a role in bulk through dmf. The below link provides information for manual and organization hierarchy for the same process.
https://alexdmeyer.com/2020/01/07/options-for-configuring-user-legal-entity-restrictions-in-d365fo/
Kindly help.
TLDR
You are looking for entity "System security user role organization" (SystemSecurityUserRoleOrganizationEntity).
Note that there is a second entity with the technical name SystemSecurityUserRoleEntity (without Organization) that unfortunately uses the same label. Make sure you use the correct one.
Also note that this entity exists since version 10.0.11.
DIY
To find this information yourself in case you have a similar "What is the entity for x?" question in the future, here is the details of what I did to find the entity:
First, I followed the instructions from the link you provided to the form of the "Assign organizations" function. There, I checked what table is used as the data source for the grid in the lower part of the form where records are created when the "Grant" function is used. This told me that table OMUserRoleOrganization stores the data where legal entities are assigned to the roles of a user.
Next, I opened up Visual Studio, navigated to the table in the application explorer and used the context (right click) menu to find the references of the table. A bit down the list, you will notice that several entries start with dynamics://*. These are metadata references (e.g. a data source in a form) instead of code references. In this case, you are looking for a metadata reference that starts with dynamics://DataEntityView/*. This identifies data entities where the table is used, usually as a data source in the query of the entity. In this case, only one entity is found, SystemSecurityUserRoleOrganizationEntity. If you look at the fields of this entity, they match your requirement of specifying a user, a role and a legal entity.
To test the entity, I assigned an user's role to an organization (Contoso data doesn't seem to have this) and created an export project with the entity. This gives me the following result:

Restrict Customer Item Pricing in Netsuite

Good afternoon,
We've had a question come up which I can't find the answer to, in relation to the Item Pricing sublist on Customer Records in Netsuite.
Basically we want to know if it is possible to Restrict Access to this sublist, so anyone who has access to Customer Records can View the sublist, but only Users with certain Roles can actually Edit the sublist.
Is there any native functionality, or possibly customisation, that could do this?
I haven't been able to find anything in Role Permissions, but I could be overlooking something.
Appreciate your help, thank you!
Potentially a UserEvent with N/serverWidget or last resort will be JQuery.
I'm assuming this has been sorted out by now, but I have done something similar to this.
One of our clients did not want their sales reps to have access to the information on the pricing of an item.
To achieve this, I made a custom form that was the exact same as the standard, except I removed the pricing sublist from the form on creation.
Then on the role record under the forms subtab, the item sublist, I ticked only that customised form for inventory parts.
This meant all with that role can only see that inventory part form. ie, no pricing information.

How do we make a crystal report print only specific fields based off of the user running the report?

We use a construction software, Viewpoint. We need a report to print the GL Accounts associated only with the user running the report. I was wondering if anyone had any ideas on how I could easily and efficiently achieve this? My "last-resort alternative" is just creating separate reports for each GL that pulls only that GL's info.
It depends on how the accounts are associated to the user. If there is a link, you can simply create a user parameter that asks for the user name. Then in the record select of the report you only pull accounts that match the user name in the parameter.
So, for example your parameter is called {?userName}. In the Record Select the formula would something like {Accounts.Salesman} = {?userName}, where {Accounts.Salesman} would be the field that links the user with the account.
You can get the current user name and use it to filter the records in your report. There are 2 ways to do this :
create a parameter, hide it and automatically fill the value. You
will need a special viewer for this scenario. Let me know if this is
what would you prefer I can give you some links. If you leave the
parameter visible the user can insert any value and view any records
use an UFL . For example this one:
http://www.viksoe.dk/code/u2lwin32.htm provides a function LoginName
which will return currently logged user. There are other UFLs which
support similar functionality, check if your company is already
using something . This one is free. You need to register the UFL on
each system which will run the report . Once registered the
available functions will become available for formulas.
I personally prefer the viewer solution because it is more flexible and will cover other scenarios too. However if you need just the username UFL will be a better approach.

CRM 2011 Filtering view on related record type

I want to create a new view for the activities entity. My aim was to show only the activities that were related to a record of a certain type eg account. But when i was creating it i saw that aside from saying if it contains data or not, and for specific records, there isnt an option for entity type.
I can understand why this isnt an option in the list, as its not really something people would need to do, but is this possible at all?
Thanks
Create an Advanced Find and specify the following criteria:
Look for: Activities
Related > Regarding (Account)
This will get you all activities which are related to an account.

SSAS Dynamic Dimension Security based on another dimension attribute

In my project I have to apply security based on a dimension attribute.
I think the best way to explain my scenario is with an example, if you need more info please request me and I'll love to told you if it will help me find a solution.
I have some main dimension, the dimcustomer, dimseller, fact, data and geographic.
The fact table are related with dimseller ids, the dimcustomer is related to the dimseller based on one dimseller specific attribute(CNPJ)(another dimensions that i didnt described are related the same way).
So my goal is to apply a role security based on the dimseller CNPJ, so then when the user related with that seller trys to browse data he will be allowed to view only the data that are related to his seller CNPJ.
Table example:
DIM Seller: DIM Customer FactTable
id name cnpj id name dimseller.cnpj dimseller.id dimcustomerid measure
1 ME 1234 1 guest1 1234 1 1 50,00
2 you 5678 2 guest2 5678 2 2 100,00
So if i login as ME i will be able to se that i have the customer guest1 with one sold product that was sold by 50 bucks.
Got my point?
What is the best way of doing it?
For now I'm considering the following guide: Claim Authentication with dynamic dimension security, but at that way I should define it attribute by attribute.
Is there a way that i can define this security need? I can easy filter the data using sql statements, but i have no ideia how i can apply this kind of security in the ssas.
Thank you guys anyway!
To apply security within a dimension, you need to use roles. For each roles, you can then specify which element in the cubes/dimensions that are available to that role. So, what you got to do is to create a role by CNPJ that will be able to view only their CNPJ.

Resources