Skip to main content

Posts

Showing posts with the label DIRPARTYTABLE

Remove spaces from Text in Ax 2012

To Remove spaces from Text you can get idea from below code sample. Here we are update name fields which include spaces on right and left side . Dirpartytable Dirpartytable; Name Name; ; while select forUpdate Dirpartytable { ttsBegin; Name= strRTrim(strLTrim(Dirpartytable.Name)); Dirpartytable.Name = Name; Dirpartytable.doUpdate(); ttsCommit; } info("Done");

Query to get Tax Registration Number by party Name in Ax 2012

This is the Query to get Tax Registration Number by party Name in Ax 2012. Intermediate table for DirPartyTable and taxRegistration is DirPartyLocation and registrationNumber is the field to get value of tax registration Number. DirPartyTable DirPartyTable; DirPartyLocation DirPartyLocation; taxRegistration taxRegistration; select * from DirPartyTable where DirPartyTable.Name == "TestName"; select * from DirPartyLocation where DirPartyLocation.Party == dirPartyTable.RecId; select registrationNumber from taxRegistration where taxRegistration.DirPartyLocation == dirPartyLocation.RecId; info(strFmt("reg %1",taxRegistration.RegistrationNumber));

Resolved:SQL error after CU7 update to AX2012 R3 on Execution of query

Following SQL error throwing  after CU7 update to AX2012 R3 on Execution of query. Error: SQL error description: [Microsoft][SQL Server Native Client 11.0][SQL Server]String or binary data would be truncated. SQL statement: UPDATE T1 SET ACTNAME=((T2.DISPLAYVALUE+?)+T4.NAME),NONLEDGERACCOUNTNAME=T4.NAME,RECVERSION=? FROM tempdb."DBO".t12143_065EB03A5044473883A01845DF64A84A T1 CROSS JOIN DIMENSIONATTRIBUTEVALUECOMBINATION T2 CROSS JOIN VENDTABLE T3 CROSS JOIN DIRPARTYTABLE T4 WHERE ((T1.PARTITION=?) AND (T1.ACCOUNTTYPE=?)) AND ((T2.PARTITION=?) AND (T2.RECID=T1.LEDGERDIMENSION)) AND (((T3.PARTITION=?) AND (T3.DATAAREAID=?)) AND (T3.ACCOUNTNUM=T2.DISPLAYVALUE)) AND ((T4.PARTITION=?) AND (T4.RECID=T3.PARTY)) Solution: Find then Actname column in table which are currently used for query then increase then length of column as required or change Extended datatype which have more size then current. For example -Change EDT from Name to DirPartyName for particular column .