Thursday 17 April 2014

How do I refresh AIF service schema after the Query is refreshed?

Go to AOT/Forms. Locate the AifService form. Select your particular service and simply click refresh.
Also make sure that in your outbound port, go to Data policies and make sure your newly added fields are marked Enabled otherwise they would not show up on the form.

Jobs that must be running for EDI documents in AX 2012

Four tasks that must be running periodically as a batch job in order for the EDI processing to occur are as below. Note that the order of their execution matters. If these jobs are not in Waiting state, then the Queue manager will show your document in Ready state and will never process it.

The four services that move documents through the gateway queue are:
  1. AIFGatewayReceiveService – This service communicates with the adapters, receives messages from their external source locations, and puts them into the gateway queue to wait for processing.
  2. AIFInboundProcessingService – This service takes incoming messages from the gateway queue and then processes the documents according to the rules that are specified by the inbound port.
  3. AIFOutboundProcessingService – This service processes an outbound document according to the rules that are specified by the integration port and then adds the envelope XML code to create a fully-formed AIF message. The service then places the message into the gateway queue to send.
  4. AIFGatewaySendService – This service sends the messages to the correct external destinations.
These services must run in a specific order because they depend on each other. For example, the gateway receive service must run before the inbound processing service. Otherwise, the inbound processing service will have no data to process. The order in which these services must run is the order in the previous list.

Tuesday 15 April 2014

Configure an AOS instance to print [AX 2012]

A great technet article explaining how can you set up printers for printing business documents in AX 2012.

http://technet.microsoft.com/en-us/library/aa569633.aspx

Tuesday 8 April 2014

Job to import customer contact information- Logistics electronic address

static void CustomerContactInformationJob(Args _args)
{
#File
    CommaTextIo        commaTextIo;
    FileIOPermission   permission;
    container          containFromRead;
    int                x;
    int                cols;
    int rowNum;

    str Customer,Description,Type,Locator;
    int Done,UnDone;

    CustTable custTAble;
    DirPartyContactInfoView DirPartyContactInfoView;
    DirParty dirParty;
    List locatorList;
    ListEnumerator locatorListEnumerator;
    SysDictEnum dictEnum;
    int         enumValue;

    ;
    permission = new FileIOPermission(@'C:\Users\Administrator\Desktop\Data\CustomerContacts.csv',#io_read);
    permission.assert();

    commaTextIo = new CommaTextIO(@'C:\Users\Administrator\Desktop\Data\CustomerContacts.csv','R');

    rowNum = 0;
    Done= 0;
    UnDone= 0;

    containFromRead = commaTextIo.read();

    dictEnum = new SysDictEnum(enumNum(LogisticsElectronicAddressMethodType));

    While(containFromRead)
    {
        if(rowNum>0)
        {
            Customer= any2str(conpeek(containFromRead,1));
            Description= any2str(conpeek(containFromRead,2));
            Type= any2str(conpeek(containFromRead,3));
            Locator= any2str(conpeek(containFromRead,4));

            custTable =CustTable::find(Customer);

    if(custTable)
        {
            dirParty = dirParty::constructFromPartyRecId(custTAble.Party);

            locatorList = strSplit(Locator, ";");
            locatorListEnumerator = locatorList.getEnumerator();

            while ( locatorListEnumerator.moveNext())
            {

                DirPartyContactInfoView.Locator = locatorListEnumerator.current();
                DirPartyContactInfoView.Type =   dictEnum.name2Value(Type);

                DirPartyContactInfoView.Party =   custTable.Party;
                DirPartyContactInfoView.LocationName = Description;
                dirParty.createOrUpdateContactInfo(DirPartyContactInfoView);

                DirPartyContactInfoView.clear();
                Done++;

            }



        }
        else
        {
            info("Customer not found " + Customer);
            UnDone++;
        }


        }
        containFromRead = commaTextIo.read();
        rowNum++;
    }
    commaTextIo = null;

    info(strFmt("Inserted : %1 Not inserted: %2", Done, UnDone));
}

tags: Ax 2012 Customer contact information ; Logistics Electronic address; importing contacts from csv using x++;