public void lookup()
{
Query query = new Query();
QueryBuildDataSource queryBuildDataSource;
QueryBuildRange queryBuildRange;
SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(CustPaymFee), This);
;
//2daydate = today();
sysTableLookup.addLookupField(fieldNum(CustPaymFee, FeeId));
sysTableLookup.addLookupField(fieldNum(CustPaymFee, Description));
sysTableLookup.addLookupField(fieldNum(CustPaymFee, LedgerJournalType));
queryBuildDataSource = query.addDataSource(tableNum(CustPaymFee));
queryBuildDataSource.addRange(fieldNum(CustPaymFee, PSMFromdate)).value("<"+SysQuery::value(today()));
//queryBuildRange.value('<='+SysQuery::value(today())); <= its not working
queryBuildDataSource.addRange(fieldNum(CustPaymFee, PSMtodate)).value(">"+SysQuery::value(today()));
//queryBuildRange.value('>='+SysQuery::value(today())); >= its not working
sysTableLookup.parmQuery(query);
// Perform lookup
sysTableLookup.performFormLookup();
}
All Archives in this blog may be used for the Junior,Dummies or someone who just started for career at Dynamics Ax ... A Place Where U can Start ur Code - right here ...
Senin, 29 Juni 2020
Senin, 22 Juni 2020
How to get last Approval
static void dtGetLastApproverName(Args _args)
{
WorkflowTrackingStatusTable workflowTrackingStatus;
WorkflowTrackingTable workflowTrackingTable;
WorkflowTrackingCommentTable workflowTrackingCommentTable;
UserInfo userInfo;
select firstFast RecId, User from workflowTrackingTable
order by RecId desc
join workflowTrackingCommentTable
where workflowTrackingCommentTable.WorkflowTrackingTable ==
workflowTrackingTable.RecId
join UserInfo where UserInfo.id == WorkflowTrackingTable.User
exists join workflowTrackingStatus
where workflowTrackingTable.WorkflowTrackingStatusTable ==
workflowTrackingStatus.RecId
&& workflowTrackingStatus.ContextRecId == _salesRecId //PurchRecID
&& workflowTrackingStatus.ContextTableId == tableNum(SalesTable) //SalesTable
&& workflowTrackingTable.TrackingType == WorkflowTrackingType::Approval;
if (workflowTrackingTable.RecId > 0)
{
info(strFmt(“%1 – %2 “,userInfo.name, workflowTrackingCommentTable.RecId));
}
}
You can get this code from : https://allaboutax.blogspot.com/2018/06/retrieve-last-approver-name-for-workflow.html?showComment=1592880782308#c5936258997657022271
{
WorkflowTrackingStatusTable workflowTrackingStatus;
WorkflowTrackingTable workflowTrackingTable;
WorkflowTrackingCommentTable workflowTrackingCommentTable;
UserInfo userInfo;
select firstFast RecId, User from workflowTrackingTable
order by RecId desc
join workflowTrackingCommentTable
where workflowTrackingCommentTable.WorkflowTrackingTable ==
workflowTrackingTable.RecId
join UserInfo where UserInfo.id == WorkflowTrackingTable.User
exists join workflowTrackingStatus
where workflowTrackingTable.WorkflowTrackingStatusTable ==
workflowTrackingStatus.RecId
&& workflowTrackingStatus.ContextRecId == _salesRecId //PurchRecID
&& workflowTrackingStatus.ContextTableId == tableNum(SalesTable) //SalesTable
&& workflowTrackingTable.TrackingType == WorkflowTrackingType::Approval;
if (workflowTrackingTable.RecId > 0)
{
info(strFmt(“%1 – %2 “,userInfo.name, workflowTrackingCommentTable.RecId));
}
}
You can get this code from : https://allaboutax.blogspot.com/2018/06/retrieve-last-approver-name-for-workflow.html?showComment=1592880782308#c5936258997657022271
Langganan:
Postingan (Atom)
Erorr CS1963 - An expression tree may not contain a dynamic operation.
Kali ini saya mendapatkan erorr dengan code CS1963, padahal sebelumnya saya sudah mendefinisikan 'var item in Model' di @foreach(var...
-
My code here is to copy Purchase Agreement line from reference Purchase Agreement to new Purchase Agreement. static void PSMCopydirecttoag...
-
If you want to try custom your notification, AX Standard can bring the user to the form where the information exist but when the form was...
-
"Error while setting server report parameters. Error Message: The item ´/DynamicsAx/PurchPurchaseOrderreport.Report4´ cannot be found ...