Thursday, May 31, 2018

Payment OR Pre payment of SO


To make Payment OR Pre payment of SO follow the steps below:
1-      First, create Sales Order
2-      Go to Payment journals (Accounts receivable/Common/Payments/Payment journals)
3-      Select Button Payment journal then click New Button for create new payment.
4-      Select new payment and click Enter Customer Payments Button.
5-      Fill Enter Customer Payments form and click Button Save in journal.
-          Payment reference: it is Sales Order number.
6-      When you select the customer , system show all of open orders.you can select to pay.
7-      Finally, post it.
8-      For see and check amount of Prepayment,go to All Sales Order and select SO then select Action oane sell and click Prepayment Button.

Regards
Hossein Karimi

Wednesday, May 30, 2018

Create Sales Order (SO)


To make Sales Orders follow the steps below:
1-      Go to all sale orders (Accounts receivable/Common/Sales orders/All sales orders)
2-      Select Button Sales order and fill the form and click OK.
3-      Form Sales order has two state (Header View & Line View)
4-      Header View: in Header View state you can fill the total features relate to SO. for instance Site and Warehouse,Delivery Address,Currency,Price include sales tax,Financial Dimensions , …
5-      Line View: in Line View state you can fill the features relate to Sales Order Lines. for instance Unit Price of each SO Line,Discount,Tax, …
6-      Finally Save SO (CTRL+S)
Regards
Hossein Karimi

lookupReference method in my ReferenceGroup

I override this lookupReference method in my ReferenceGroup. 
public Common lookupReference()
{
//FormReferenceControl _formReferenceControl;
SysReferenceTableLookup sysTableLookup = SysReferenceTableLookup::newParameters(tableNum(myTable), this);
Query testQuery;
QueryBuildDataSource qbds;
QueryBuildRange qbr;
Common selectedRecord;
str test;
// Display the coulmns fields in the lookup form.
testQuery= new Query();
//test = strFmt('(%1 == Final)',fieldStr(myTable, ProductTypeID));
//sysTableLookup.addLookupfield(fieldNum(myTable, RecId));
// sysTableLookup.addLookupfield(fieldNum(myTable, ProductTypeName));
sysTableLookup.addLookupfield(fieldNum(myTable, ProductTypeID));
// Create a custom Query
qbds = testQuery.addDataSource(tableNum(myTable));
qbds.addRange(fieldnum(myTable, ProductTypeID)).value('Final');
sysTableLookup.parmQuery(testQuery);
selectedRecord = sysTableLookup.performFormLookup();
return sysTableLookup.performFormLookup();

//return sysTableLookup.performFormLookup();
}

Creating purchase line using x++ code

void clicked()
{
    PurchTable  purchTable;
    PurchLine   purchLine;
    InventDim   inventDim;
    NumberSeq   numberSeq;
 
    //add by fanddy
    AxPurchTable    axPurchTable;
    AxPurchLine     axPurchLine;
    PurchFormLetter purchformLetter;
    //END
 
   //create PO Header
   purchTable.clear();
   purchTable.initFromVendTable(VendTable::find(TECPOGroupHeader.VendAccount));
   purchTable.DefaultDimension = InventTable::find(POGroupLine.ItemId).DefaultDimension;
 
   axPurchTable = axPurchTable::newPurchTable(purchTable);
   axPurchTable.parmPurchId(NumberSeq::newGetNum(PurchParameters::numRefPurchId()).num());
   axPurchTable.parmPurchaseType(PurchaseType::Purch);
   axPurchTable.parmDocumentStatus(DocumentStatus::PurchaseOrder);
   axPurchTable.parmAccountingDate(systemDateGet());
   axPurchTable.parmDeliveryDate(systemDateGet());
   axPurchTable.parmPurchStatus(PurchStatus::Backorder);
   axPurchTable.save();
 
   info(strFmt('Create PO %1', Purchtable.PurchId));
 
   //create PO Line
   purchLine.clear();
   purchLine.initValue();
   purchLine.initFromPurchTable(purchTable);
   purchLine.initFromInventTable(InventTable::find(POGroupLine2.ItemId));
   axPurchLine = AxPurchLine::newPurchLine(purchLine);
   axpurchLine.parmItemId('YOUR ITEMID');
   axPurchLine.parmPurchQty(YOUR QTY);
   axPurchLine.parmPurchPrice(YOUR PRICE);
   axPurchLine.parmInventDimId('YOUR INVENTDIMID');
   axPurchLine.save();
 
}

Sunday, May 27, 2018

How to Search X++ Code Using Dynamics AX Model Database(SQL Server Query)

In MorphX IDE, the ‘Find’ functionality is ‘decent’ and works best if you are searching within an object, like a Class or Table, but if you want to find something across all objects – meaning the entire AOT, it’s probably going to take a long time to search. I lost my patience after waiting for couple hours for the search below to finish…


‘What If’ you could query the Dynamics AX Model Database to find a string across all objects? Well, using the simple SQL Query below, you can. Here’s how to search X++ code using Dynamics AX model database:

SELECT RootHandle.Name RootElementName,
    ElementHandle.Name ElementName,
    ElementTypes.ElementTypeName Type,
    CAST(Sources.SourceText AS nvarchar(MAX)) SourceText
FROM Sources Sources
    JOIN ModelElement ElementHandle
ON Sources.SourceHandle     = ElementHandle.ElementHandle
    JOIN ModelElement RootHandle
ON RootHandle.ElementHandle = ElementHandle.RootHandle
    JOIN ElementTypes ElementTypes
ON ElementTypes.ElementType = ElementHandle.ElementType
WHERE CAST(Sources.SourceText AS nvarchar(MAX)) LIKE '%h.karimi%'



The ‘Where’ clause in the query above can be modified to better fit the text comparison you are looking for, using one of the following SQL operators: =, <>, >, >=, <, <=, IN, BETWEEN, LIKE, IS NULL or IS NOT NULL.
If your requirement is to not look for a string in a method, but instead where the object has been used – ‘Cross Reference’ system in Dynamics AX allows you to see the relationships between objects. For example, you can get a list of every piece of code that uses a particular method, or you can see which forms use a particular table field. You can also get information about where labels are used in the application, but we can’t use the cross reference to look for a string inside a method.
Regards,
Hossein Karimi

Configure the Firewall on the Enterprise Portal Server

After you install Enterprise Portal, enable Web Server (HTTP) in Windows Firewall. If you do not enable the web server in Windows Firewall...