Date Transactions

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
jacklcs
Posts: 338
Joined: Fri Dec 31, 2010 4:20 pm

Date Transactions

Post by jacklcs »

Good day everyone.

I found this from the AwareIM User Guide:
"CREATE Transaction FOR EACH DAY/WEEK/MONTH/QUARTER/YEAR BETWEEN Account.OpeningDate AND Account.ClosingDate".

In order to understand this rule, I have created Account OB and Transactions OB. (System prompt the words Transaction is reserved.)

In the Account OB, I created:
- OpeningDate
- ClosingDate

In the Trnsactions OB, I created
- S_Date

Process:
CREATE Transactions FOR EACH DAY BETWEEN Account.OpeningDate AND Account.ClosingDate

I have entered on the Account OB:
- OpeningDate: 01-10-2012
- ClosingDate: 31-10-2012
After that I click Save and the process run. It create 31 transaction with the blank records.

From my understanding it should create transctions for 31 records to Transaction OB from 01-10-2012 to 31-10-2012. But how to link to Transaction OB to show 01-10-2012 to 31-10-2012 on the S_Date?

The Transactions.S_Date=??? [As what]

Please help.... thanks.
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

From the User Guide in the section called "CREATE Action"
NOTE: You can use LOOP_ITERATION expression to get values of the current file name, current date or current iteration number, for example:
CREATE TRANSACTION FOR EACH FILE IN ’c:/mydirectory’ WITH
Transaction.FileName=LOOP_ITERATION
Tom - V8.8 build 3137 - MySql / PostGres
jacklcs
Posts: 338
Joined: Fri Dec 31, 2010 4:20 pm

Post by jacklcs »

thank you tford...I am think of that too.

I wish to write on the process to run auto. I read the MySQL books, it wrote on the Store Procedure to populate the Date to the tbl_date Table after the user enter the Date From and Date To.

Work Flow:
1. Create a form called "Fiscal Period"
2. User enter the Date From and Date To on the Form Fiscal Period.
3. There is a separate "Dates" object to create the daily date.
4. When the user enter Date From - 01-10-2012 ; Date To: 31-10-2012 and click save.
5. Run the process to create 31 row and at the same time store the date on S_Date (attribute of the Dates Object) from 01-10-2012 to 31-10-2012.

Please help....
RafaMD
Posts: 52
Joined: Wed Mar 16, 2011 6:22 am
Location: Spain

Post by RafaMD »

Try:

CREATE Transactions FOR EACH DAY BETWEEN Account.OpeningDate AND Account.ClosingDate WITH Account.S_Date=LOOP_ITERATION

After, S_Date contains the day date
jacklcs
Posts: 338
Joined: Fri Dec 31, 2010 4:20 pm

Post by jacklcs »

Wow... it worked!!

CREATE Transactions FOR EACH DAY BETWEEN Account.OpeningDate AND Account.ClosingDate WITH Transactions.S_Date=LOOP_ITERATION

It created 01-10-2012 to 31-10-2012...daily date..

By the way what does Loop_Iteration mean?

Million thanks.
jacklcs
Posts: 338
Joined: Fri Dec 31, 2010 4:20 pm

Post by jacklcs »

Good day everyone...

In the Transactions OB, I have done this rule:

Transactions.S_Day=AS_STRING(Transactions.S_Date,'dd')
Transactions.S_Month=AS_STRING(Transactions.S_Date,'MMMM')
Transactions.S_MonthYear=AS_STRING(Transactions.S_Date,'MMMM yyyy')
Transactions.S_MonthNo=AS_STRING(Transactions.S_Date,'MM')
Transactions.S_Year=AS_STRING(Transactions.S_Date,'yyyy')

It is correct way?

How to get the quarter number?
Transactions.S_QuarterNo=??

Thanks...
Post Reply