how to calculate check number in a form.

Hello Friends,

I have one table with two fields on click of button i can add the values into that table. I want to add new field into the table and then on click of button i want to generate a cheque number on the 3rd field i have added in the table. How can i do that ? In the form i have kept 2 edit textbox where i will give the starting cheque number and count is my another text box which will specify number of checks to be generated.

eg. cheque no is 1000 and count is 2

then in db i want 1001,1002,1003 as check number n rest other records the checknumber should be displayed as blank.

Next time when i give another parameters for cheque number and count then it should start after 1003 cheque number

Thanks.

Himanshu

Hi,

Check functionality is already there in AX. In the bank account, there is a setup for creation of check numbers. The functionality is same as what you are describing.

I will suggest you to refer that.

Pranav…

hi,

I am new learner to Ax, I dont know how to access and operate and i dont have have much idea about bank n other modules of AX, I have just started learning by creating a form from AOT adding 2 textboxes and a button and kept a gird to display the records once inserted into database on click event. I would be thankful to you if you can give me the code so generate cheque numbers by adding 3rd field into database and by giving Cheque number and count as parameters to calculate cheque number and store it into DB.

I would b very thankful to you if you can give me guidance and tips as how can i start learning ax from basic with proper concepts and learn how to design, and do proper coding.

Thanks for your guidance and help.

Himanshu.

// I HAVE DONE THE CODING AND ITS WORKING FOR ME. CHECK THIS CODE.

void clicked()

{

CustTransOpen CustList1;

// decleration of variables

String30 cheque,ccount;

int i=0,chequeno,countseq=0;

int numofrows ,lastChequeNo;

// getting textbox value into variables above defiend

cheque = CheckNumber.valueStr();

ccount = CountNo.valueStr();

//converting count into int

chequeno= str2int(Cheque);//100

countseq = str2int(ccount);//3

// main logic …

lastChequeNo = chequeno + countseq-1;//102

// code to update the Table

ttsBegin ;

while select forUpdate CustList1

{

if(CustList1.CheckNumber==0)

{

CustList1.CheckNumber = chequeno;

CustList1.update();

if(chequeno==lastChequeNo) break;

chequeno++;

print "Cheque number inserted is "+int2str(chequeno)+“sequence no”+int2str(countseq);

}

else

{

print(“go next row in grid”);

}

}

CustTransOpen.setTmpData(CustList1);

ttsCommit;

CustTransOpen_Ds.executeQuery();

super();

}

Hi Himanshu,

Techinally i will not be able to help you as i am not much into that sector.

I will suggest you to go through the development manuals first as this will help you in development. The manuals can be downloaded from partner source.

Post your technical doubts here, that will help you.

Pranav…

Hi Pranav,

Thanks a lot for your guidance and help. Pls can you send me links from where i can find tutorail which can help me for my basic knowledge and help me to learn coding … I have one more issue…

Can you help me in this , I have one grid where i am displaying records, i want to copy marked records of the grid into another gird which is in the same page.How can i do that ? pls let me know if you can get some kind of code or steps i can follow to do this task.

Himanshu.