Home > X++ stuffs > Publish Selected Fields using AIF without Send Framework

Publish Selected Fields using AIF without Send Framework

Sample example is written for publishing selected field based on AIF setup made in Data-policies form without using AxdSend framework class.

/// <summary>
///    The <c>LedgerTableRead</c> job will published the xML to the folder
///    mentioned in channel path.
///    Note: Once the job is executed sucessfully please run the AIF job 
///    to push the xML outside.
/// </summary>
public void LedgerTableRead()
{
    AifEntityKey        entityKey         = new AifEntityKey();
    AifConstraint       aifConstraint     = new AifConstraint() ;

    AifSendMode         aifSendMode       = AifSendMode::Async;

    AifEntityKeyList    entityKeyList     = new AifEntityKeyList();
    AifConstraintList   aifConstraintList = new AifConstraintList();

    LedgerTable         ledgerTable;
    ;

    select firstonly ledgerTable
        where !(ledgerTable.AccountPlType like LedgerAccountType::sum);
    {
        entityKeyList.addEntityKey(entityKey);
        entityKey.parmTableId(ledgerTable.TableId);
        entityKey.parmRecId(ledgerTable.RecId);
        entityKey.parmKeyDataMap(SysDictTable::getKeyData(LedgerTable));

        aifConstraint.parmType(AifConstraintType::Customer);
        aifConstraint.parmId(LedgerTable.AccountNum);
        aifConstraintList.addConstraint(aifConstraint);

        /* This will populate the xML based on the AIF setting for COA */
        AifSendService::submitDefault(classnum(LedgerChartOfAccountsService),
                                      entityKey,
                                      aifConstraintList,
                                      aifSendMode);
    }
}

Once the above job is executed, the record with get inserted into Queue Manager. Please execute the following AIF job to push the data outside.

public void Run_AIF_Job()
{
    ;

    new AifOutboundProcessingService().run();
    new AifGatewaySendService().run();
}

hAppies DAX 🙂

Advertisements
Categories: X++ stuffs
  1. November 10, 2010 at 11:39 am

    thanks for the blog entry.. awesome!!!

  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: