Project contract creation using X++

Hi,

I need to create Project Contract using X++ code in AX 2012. Can anybody plese help me with the code???

Thanks in Advance.

Hi,

This should help - http://harish-m.livejournal.com/31981.html

Hey thanks for the link but I am not able to use it. Can you please guide.

Hi,

Not sure what issue you are facing. Please can you elaborate?

Where exactly should I use the code?? And how can I call it??

Hi,

The code sample I posted is AX job. Try the following -

  1. Create a class;
  2. Copy the code in my job and create a method in this class. If you choose to decide this method as static, then you can call this method from any where within application quite easily. You will have to pass the necessary parameters to this static method.

With the above steps, you can rapidly build a working solution.

Obviously there are other ways to build rapid solution as well. It all depends on actual requirement, your X++ experience etc.

Hi Harish

I am very very thankful for your continous support. I really appreciate it.

Can you please tell me how do I improve my X++ skills. Any book or training you can suggest??

Thanks in advance.

Hi Harish ,

Below code will help you :slight_smile:

ProjFundingSource projFundingSource;
NumberSeq numSeq;
CustTable custtable;

;

ttsBegin;
projInvoiceTable.clear();
projInvoiceTable.initValue();

custTable = CustTable::find(“Give your account number”);
numSeq = NumberSeq::newGetNum(projParameters::numRefProjInvoiceProjId(), true, true);
projinvoiceTable.ProjInvoiceProjId = numSeq.num();

projInvoiceTable.CurrencyId = “USD”;
projinvoiceTable.Description = custTable.name();

this.parmprojectcontract(projinvoiceTable.ProjInvoiceProjId);

projInvoiceTable.insert();

projFundingSource.ContractId = projInvoiceTable.ProjInvoiceProjId;

projFundingSource.CustAccount = “Account number”;
projFundingSource.FundingSourceId = CustTable.name();
projFundingSource.FundingType = ProjFundingType::Customer;
projFundingSource.PaymentTermsId = “Net8”;
projFundingSource.PaymentscheduleId = paymentform;
projFundingSource.editProjFunder(true,projFundingSource.CustAccount);

projFundingSource.insert();

projFundingRule::createDefaultFundingRule(projInvoiceTable.ProjInvoiceProjId,projInvoiceTable.RecId);

ttsCommit;

Thank you