I have two business objects, one that represents Cheque Numbers and another that represents and issue where a cheque number would be assigned.
I need to import batches of CQ Nos on an ongoing basis, which is no problem with the importer, and flag as unused.
But then I need to be able to use a process to 'issue' the next available number and at the same time flag that number as not available for the next time someone requests it.
Transactions between Objects
-
- Posts: 595
- Joined: Sun Apr 24, 2005 2:22 am
- Contact:
-
- Posts: 595
- Joined: Sun Apr 24, 2005 2:22 am
- Contact:
This could be done by a process with the following rules:
1 - Check number availability:
If NOT(EXISTS ChequeNumber WHERE (ChequeNumber.State='Unused')) Then REPORT ERROR 'There are no more unused cheque numbers available'
2 - Get next cheque number:
FIND ChequeNumber WHERE ChequeNumber.State='Unused' ORDER BY ChequeNumber.Number TAKE BEST 1
3 - Link check number to cheque issue:
ChequeIssue.CqNo = ChequeNumber
4 - Mark check number unavailable:
ChequeNumber.State = 'Issued'
The process should have ChequeIssue object as its input. You can then add the process as an operation on the form for ChequeIssue.
It would also be a good idea to have attribute ChequeNumber.CqIssue as a matching attribute to ChequeIssue.CqNo so the form for ChequeNumber shows the ChequeIssue to which it is issued.
1 - Check number availability:
If NOT(EXISTS ChequeNumber WHERE (ChequeNumber.State='Unused')) Then REPORT ERROR 'There are no more unused cheque numbers available'
2 - Get next cheque number:
FIND ChequeNumber WHERE ChequeNumber.State='Unused' ORDER BY ChequeNumber.Number TAKE BEST 1
3 - Link check number to cheque issue:
ChequeIssue.CqNo = ChequeNumber
4 - Mark check number unavailable:
ChequeNumber.State = 'Issued'
The process should have ChequeIssue object as its input. You can then add the process as an operation on the form for ChequeIssue.
It would also be a good idea to have attribute ChequeNumber.CqIssue as a matching attribute to ChequeIssue.CqNo so the form for ChequeNumber shows the ChequeIssue to which it is issued.
Aware IM Support Team