Hi
I am trying to create an invoice number format as follows
I2007-10-10000
I= letter I for invoice
2007 = current year
10= current month
12345 number
So the numbers will run as follows:
I2007-10-10001
I2007-10-10002
I2007-10-10003
I2007-11-10004
Does anyone have a suggestion ?
Thanks in advance
Number Format Rule - puzzled !
tford
I am getting an error in the browser when I concatenate the attributes as suggested
Rule:
Invoice.InvoiceNo=Invoice.InvNoYear+Invoice.InvNoMonth+'-'+Invoice.InvNoNo
This passes the entegrity test
but in the browser I get this error:
"Operation error. com.bas.shared.ruleparser.ParseException Operands of addition expression are of incompatible types"
This is strange because I have a similar rule that concatenates dates and text types , except this it does not contain a number type. So this is probably where the problem is.
How do i get round a number in a rule that concatenates with other types - can I convert the number type in the rule somehow ?
I am getting an error in the browser when I concatenate the attributes as suggested
Rule:
Invoice.InvoiceNo=Invoice.InvNoYear+Invoice.InvNoMonth+'-'+Invoice.InvNoNo
This passes the entegrity test
but in the browser I get this error:
"Operation error. com.bas.shared.ruleparser.ParseException Operands of addition expression are of incompatible types"
This is strange because I have a similar rule that concatenates dates and text types , except this it does not contain a number type. So this is probably where the problem is.
How do i get round a number in a rule that concatenates with other types - can I convert the number type in the rule somehow ?
ACDC,
Tom
I store this kind of info in the SystemSettings BO. You could simply change it on a form any time you want to change the number. Obviously this could be dangerous if this was accessible to the wrong person. If you really want to lock it down, you can set it once via form, then change that attribute to "Calculated"B.T.W., how do I get the number to start at a specific number like 1000 instead of 1
Tom
Greg
Its interesting, if I change the first concatenated attribute to one of a ref type ,in this case LoginName then it works. As soon as I take the LoginName out then the error returns
How would I convert to a string , I cant find much in the help.greg wrote:Try defining Invoice.InvoiceNo as a plain text attribute and convert both Invoice.InvNoYear and Invoice.InvNoMonth to strings before combining them together.
Its interesting, if I change the first concatenated attribute to one of a ref type ,in this case LoginName then it works. As soon as I take the LoginName out then the error returns