Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all 175888 articles
Browse latest View live

Permissions query from Management Reporter performing poorly

$
0
0

This is on Dynamics AX 2012 R2, on SQL 2012 SP2. 

The below query is executing every 5 minutes, and from the looks of it, returns the security/permissions for Management Reporter.  The issue with the query is that it has a 25 sec execution time.  

select T.USERKEY, T.NAME, T.ALIAS, T.DOMAIN, T.SECURITYID, MAX(T.GENERALLEDGERROLETYPE) GENERALLEDGERROLETYPE, T.COMPANYKEY, T.ISENABLED
from (    select UI.RECID USERKEY, UI.NAME, UI.NETWORKALIAS ALIAS, UI.NETWORKDOMAIN DOMAIN, SID SECURITYID,        CASE st.AOTNAME            WHEN 'SysSecSecurityMaintain' THEN 5            WHEN 'LedgerBalanceSheetDimMaintain' THEN 4            WHEN 'LedgerFinancialJournalReportBGenerate' THEN 3            WHEN 'LedgerBalanceSheetDimPrintGenerate' THEN 3            WHEN 'LedgerViewFinancialStatement' THEN 2        END GENERALLEDGERROLETYPE, l.RECID COMPANYKEY, UI.ENABLE ISENABLED        from [MicrosoftDynamicsAX]..USERINFO UI        inner join [MicrosoftDynamicsAX]..SECURITYUSERROLE sur on UI.ID = sur.USER_ and UI.PARTITION = sur.PARTITION        inner join [MicrosoftDynamicsAX_Model]..SECURITYROLE sr on sur.SECURITYROLE = sr.RECID            and (GETUTCDATE() between sur.VALIDFROM and sur.VALIDTO OR                (sur.VALIDFROM = '1/1/1900' and sur.VALIDTO = '1/1/1900'))        inner join [MicrosoftDynamicsAX]..SECURITYUSERROLECONDITION c on c.SECURITYUSERROLE = sur.RECID and c.PARTITION = sur.PARTITION        inner join (SELECT T1.SECURITYTASK AS SECURITYTASK                        ,T2.SECURITYROLE AS SECURITYROLE                    FROM [MicrosoftDynamicsAX_Model]..SECURITYROLETASKGRANT T1                    CROSS JOIN [MicrosoftDynamicsAX_Model]..SECURITYROLEEXPLODEDGRAPH T2                    WHERE (T1.SECURITYROLE = T2.SECURITYSUBROLE)                    GROUP BY T1.SECURITYTASK                        ,T2.SECURITYROLE) v on v.SECURITYROLE = sr.RECID        inner join [MicrosoftDynamicsAX_Model]..SECURITYTASKEXPLODEDGRAPH g on g.SECURITYTASK = v.SECURITYTASK        inner join [MicrosoftDynamicsAX_Model]..SECURITYTASK st on g.SECURITYSUBTASK = st.RECID        inner join (Select l.RECID, l.PARTITION, CI.DATAAREA from [MicrosoftDynamicsAX]..LEDGER l            inner hash join [MicrosoftDynamicsAX]..DIRPARTYTABLE CI on CI.PARTITION = l.PARTITION and l.PRIMARYFORLEGALENTITY = CI.RECID) l on UI.PARTITION = l.PARTITION and l.DATAAREA = c.DATAAREA    Where        UI.EXTERNALUSER = 0 AND        UI.[SID] != '' AND        UI.[ACCOUNTTYPE] = 0 AND        sur.ASSIGNMENTSTATUS = 1 AND        st.AOTNAME in (        'SysSecSecurityMaintain',        'LedgerBalanceSheetDimMaintain',        'LedgerFinancialJournalReportBGenerate',        'LedgerBalanceSheetDimPrintGenerate',        'LedgerViewFinancialStatement')    union all    -- get users and their assigned tasks for all companies where the task hasn't been constrained to a company    select UI.RECID USERKEY, UI.NAME, UI.NETWORKALIAS ALIAS, UI.NETWORKDOMAIN DOMAIN, SID SECURITYID,        CASE st.AOTNAME            WHEN 'SysSecSecurityMaintain' THEN 5            WHEN 'LedgerBalanceSheetDimMaintain' THEN 4            WHEN 'LedgerFinancialJournalReportBGenerate' THEN 3            WHEN 'LedgerBalanceSheetDimPrintGenerate' THEN 3            WHEN 'LedgerViewFinancialStatement' THEN 2        END GENERALLEDGERROLETYPE, l.RECID COMPANYKEY, UI.ENABLE ISENABLED        from [MicrosoftDynamicsAX]..USERINFO UI        inner join [MicrosoftDynamicsAX]..SECURITYUSERROLE sur on UI.ID = sur.USER_ and UI.PARTITION = sur.PARTITION        inner join [MicrosoftDynamicsAX_Model]..SECURITYROLE sr on sur.SECURITYROLE = sr.RECID            and (GETUTCDATE() between sur.VALIDFROM and sur.VALIDTO OR                (sur.VALIDFROM = '1/1/1900' and sur.VALIDTO = '1/1/1900'))        inner join (SELECT T1.SECURITYTASK AS SECURITYTASK                        ,T2.SECURITYROLE AS SECURITYROLE                    FROM [MicrosoftDynamicsAX_Model]..SECURITYROLETASKGRANT T1                    CROSS JOIN [MicrosoftDynamicsAX_Model]..SECURITYROLEEXPLODEDGRAPH T2                    WHERE (T1.SECURITYROLE = T2.SECURITYSUBROLE)                    GROUP BY T1.SECURITYTASK                        ,T2.SECURITYROLE) v on v.SECURITYROLE = sr.RECID         inner join [MicrosoftDynamicsAX_Model]..SECURITYTASKEXPLODEDGRAPH g on g.SECURITYTASK = v.SECURITYTASK        inner join [MicrosoftDynamicsAX_Model]..SECURITYTASK st on g.SECURITYSUBTASK = st.RECID        inner join (Select l.RECID, l.PARTITION from [MicrosoftDynamicsAX]..LEDGER l            inner hash join [MicrosoftDynamicsAX]..DIRPARTYTABLE CI on CI.PARTITION = l.PARTITION and l.PRIMARYFORLEGALENTITY = CI.RECID) l on UI.PARTITION = l.PARTITION    Where        UI.EXTERNALUSER = 0 AND        UI.[SID] != '' AND        UI.[ACCOUNTTYPE] = 0 AND        sur.ASSIGNMENTSTATUS = 1 AND        st.AOTNAME in (        'LedgerBalanceSheetDimMaintain',        'LedgerFinancialJournalReportBGenerate',        'LedgerBalanceSheetDimPrintGenerate',        'LedgerViewFinancialStatement',        'SysSecSecurityMaintain')        and not exists (select 1 from SECURITYUSERROLECONDITION c where c.SECURITYUSERROLE = sur.RECID and c.PARTITION = sur.PARTITION)    union all    -- get all administrators for all companies where the admin's aren't limited to specific companies    select UI.RECID, UI.NAME, UI.NETWORKALIAS, UI.NETWORKDOMAIN, SID, 5 RoleType, l.RECID, UI.ENABLE ISENABLED        from [MicrosoftDynamicsAX]..USERINFO UI        inner join [MicrosoftDynamicsAX]..SECURITYUSERROLE sur on UI.ID = sur.USER_ and UI.PARTITION = sur.PARTITION        inner join [MicrosoftDynamicsAX_Model]..SECURITYROLE sr on sr.RECID = sur.SECURITYROLE            and (GETUTCDATE() between sur.VALIDFROM and sur.VALIDTO OR                (sur.VALIDFROM = '1/1/1900' and sur.VALIDTO = '1/1/1900'))        inner join (Select l.RECID, l.PARTITION from [MicrosoftDynamicsAX]..LEDGER l            inner hash join [MicrosoftDynamicsAX]..DIRPARTYTABLE CI on CI.PARTITION = l.PARTITION and l.PRIMARYFORLEGALENTITY = CI.RECID) l on UI.PARTITION = l.PARTITION        where            UI.EXTERNALUSER = 0 AND            UI.[SID] != '' AND            UI.[ACCOUNTTYPE] = 0 AND            sur.ASSIGNMENTSTATUS = 1 AND            AOTNAME in ('SysSecSecurityAdministrator')    )    T    Group by T.USERKEY, T.NAME, T.ALIAS, T.DOMAIN, T.SECURITYID,  T.COMPANYKEY, T.ISENABLED    order by T.COMPANYKEY


I've narrowed the issue down to the middle query of the three, and specifically, the actual statement:

inner join (Select l.RECID, l.PARTITION from [MicrosoftDynamicsAX]..LEDGER l            inner hash join [MicrosoftDynamicsAX]..DIRPARTYTABLE CI on CI.PARTITION = l.PARTITION and l.PRIMARYFORLEGALENTITY = CI.RECID) l on UI.PARTITION = l.PARTITION

If I remove the "hash" hint, the whole query completes in sub second.  I can't see where I can modify the query, thus are there any options to improving this?

What I've done already:

  • Index maintenance runs on all user databases weekly, and stats updated daily
  • Ran AxUtil Optimize tool
  • Manually updated stats


RE: Unable to see labels from new label file

$
0
0

Hi Dauvis,

Steps looks ok. Did you try to rebuild project\model ?

Unable to see labels from new label file

$
0
0

I am working in a Dynamics 365 developer environment on a VM.  I created a new package with a model.  In my project, I created a new label file, table, EDT, and a form.  I have a number of new labels added to the label file and they are used within the elements in the project.  I can see the correct label in the preview and the properties pane.  When I run the form in the debugger, none of the labels in the label file are showing (I only see the @XXX:YYY).  When I created the label file, I used the new label file wizard that you get when creating a label file.  When I added labels, I used the editor.  Is there a step that I might have missed?

RE: Need to get information about users from table.

RE: QueryBuildDatasource add range not equal to enum value

$
0
0

This also works:

this.query().dataSourceTable(tablenum(PurchTable)).addRange(fieldnum(PurchTable, InvoiceAccount)).value('!Transfer'+','+'!5050');

QueryBuildDatasource add range not equal to enum value

$
0
0

I'm in AX 2012 R3 environment.I would like to add a query range to GeneralJournalEntry table and filter out rows that have a JournalCategory value different to LedgerTransType::Purch , i try this but not works :

datasource.addRange(fieldnum(GeneralJournalEntry,JournalCategory)).value(SysQuery::valueNot(enum2str(LedgerTransType::Purch)));

Update : it works for one range ,but what if i want add multiple value to range like this :

datasource.addRange(fieldnum(GeneralJournalEntry,JournalCategory)).value(SysQuery::valueNot(LedgerTransType::Sales));
datasource.addRange(fieldnum(GeneralJournalEntry,JournalCategory)).value(SysQuery::valueNot(LedgerTransType::Purch));

In sql we have :
select * from GENERALJOURNALENTRY where GENERALJOURNALENTRY.JOURNALCATEGORY not in (2,3)

RE: How to map Dimension fields from AX to CRM using connector?

$
0
0

Hi Simon,

Can you guide me how to map Dimension attributes with CRM connector?

Regards

Deewakar

How to map Dimension fields from AX to CRM using connector?

$
0
0

I am trying to Map the Dimension field which I understand is an Array, to CRM using Dynamics Connector. I have tried using the available functions within the connector but have not managed to successfully map this field.

Regards Nilesh


Expose Default dimension attributes to CRM Connector

$
0
0

I need to map the attributes of default dimension with CRM using CRM connector.

Please help me regarding this.

With Regards

DKumar

RE: Delete Plan (Master Planning)

$
0
0

The way I understand it, Delete will delete the selected planned order records from the master plan. Delete plan will delete every record from the master schedule that was run. I run Delete plan in batch prior to a full regeneration of a new plan.

RE: Report viewing problem of Sales Quotation/Confirmation Report

$
0
0

Hi Ahmed Alam,


I have same problem, and it was solved.

you can rename your method in DP class, example:

[    SRSReportDataSetAttribute(tableStr(TableTmp)) ]
public TableTmp getDataTmp()  // rename to getDataTmpX

and then refresh your Datashet at visual studio

Report viewing problem of Sales Quotation/Confirmation Report

$
0
0

Dear Experts,

I have came across one wired problem and I haven't found any clue for this. While I am generating the Sales Quotation/Confirmation report through the AX 2012 R2. System shows me the message "Report schema already contains a dataset with name" although these reports are working fine on VS and day before.

Does anyone have idea about this type of problem.

- I have complied all the classes and all the reports are working fine.

- Services are registered accurately.

- Reporting services restarted

- AOS restarted

but no effect.

Customer payment

$
0
0

Hi All ,

AX 2012

There is business requirement that company sell material to X customer and from same X customer purchase raw material also.

In this scenario ...what are all the options available to settle these transactions and find the net amount which need to collect or pay.

Thanks in advance

RE: AX workflow assignment problem

$
0
0

Hi Armagan,

This can't be achieved with the expenditure reviewer groups.

You could test if building in a 3rd approval step that depends on the second one - that is whether the supply chain VP or the Yard Team VP needs to approve - fixes the issue. I have not used and tested such a scenario but believe that this can be achieved with the standard tools even though it might take you quite some time testing that.

If you can't make it with the workaround of using a 3rd workflow step, you will need the help of a workflow developer you can make this adjustment for you.

Best regards,

Ludwig

RE: Customer payment

$
0
0

Hi lally,

I guess that you know how to link a customer account to a vendor account in the customer master.

Is it that you sell or purchase on average more from the 3rd party?

Best regards,

Ludwig


RE: Original Document for Vendor Payment Reversal

$
0
0

Hi harry.b83,

How and where (in which form) did you reverse the check?

Can you describe this in more detail and also provide some additional information on what payment and transactions you see?

Many thanks,

Ludwig

Original Document for Vendor Payment Reversal

$
0
0

Hi everyone,

I posted a Vendor Payment using Check, then reversed the check. I am able to see the original Transaction for the Vendor Payment but NOT for the reversal.

Is this how it is in AX7/Dynamics 365? Or is this an issue in my environment

Please note i was able to see the original transaction for Payment and reversal in AX 2012. 

Thanks in advance for the Help.

RE: Warehouse Zone

$
0
0

I found the answer , you correct there is a customization, thanks for your attention.

Warehouse Zone

$
0
0

Hi everybody ,

Am trying to insert a new warehouse zone, but i can't know from where exactly, can you help me to find the path by steps .

RE: AX workflow assignment problem

$
0
0

Hi Armagan,

The hierarchy provider is taking the primary position only. With help of a customization you can create a new hierarchy provider which would be able to select position hierarchies based on other conditions.

Microsoft Dynamics 365 for Operations has now functionality to link workflows to a position hierarchy type. Then you would be able to create multiple position hierarchies for this kind of requirements.

Viewing all 175888 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>