Recording Line numbers in Header /Detail BO

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
sabbirehal
Posts: 57
Joined: Fri Feb 12, 2016 11:35 pm
Location: Brampton, ON

Recording Line numbers in Header /Detail BO

Post by sabbirehal »

Hi Group,
Please ignore my ignorance as I am new to aware IM. I wanted to record auto increment line number number in the PO Detail BO and wanted to know the best way of doing it in Aware IM. Please see attached picture for more detail .

Thanks
Sabbi
Attachments
PO Detail Lines.jpg
PO Detail Lines.jpg (34.42 KiB) Viewed 11248 times
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Recording Line numbers in Header /Detail BO

Post by Jaymer »

sorry sabbi
what you wrote doesn't make any sense.
i think you need to delete you question and re-type it.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
sabbirehal
Posts: 57
Joined: Fri Feb 12, 2016 11:35 pm
Location: Brampton, ON

Re: Recording Line numbers in Header /Detail BO

Post by sabbirehal »

Sorry Jaymer but I have basically two BO's PO Header and PO Detail in One to many relationship.
The PO Header will have PO Number as Unique and PO Detail will be PO Number and Line Number as unique. I know awareim can manage one to many relationship automatically but don't know how it will store the Line Number in sequential order of its creation?

Thanks
idpSteve
Posts: 201
Joined: Thu Jul 27, 2017 6:13 am
Location: Johannesburg, South Africa
Contact:

Re: Recording Line numbers in Header /Detail BO

Post by idpSteve »

You can add a number attribute to your object, and in the attribute properties menu under the 'Number-specific' options there is 'Auto-increment'.

I think this might work for your purpose?
customaware
Posts: 2391
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: Recording Line numbers in Header /Detail BO

Post by customaware »

In the BO Rules for PODetail

PODetail IS NEW
PODetail.LineNumber = COUNT PODetail WHERE PODetail IN POHeader.om_PODetail + 1
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
idpSteve
Posts: 201
Joined: Thu Jul 27, 2017 6:13 am
Location: Johannesburg, South Africa
Contact:

Re: Recording Line numbers in Header /Detail BO

Post by idpSteve »

Hi Mark.

Would that not have a bigger overhead than just using the built in increment function?

EDIT:

This would also cause an issue if a record is deleted, you might end up with duplicate line numbers in that case as the COUNT wouldn't return the number of the last record. You could also do this with a counter in system settings or something, BUT, why not just use the built in function?
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Recording Line numbers in Header /Detail BO

Post by Jaymer »

eagles9999 wrote:In the BO Rules for PODetail

PODetail IS NEW
PODetail.LineNumber = COUNT PODetail WHERE PODetail IN POHeader.om_PODetail + 1
No count, use max PODetail.LineNumber + 1
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
sabbirehal
Posts: 57
Joined: Fri Feb 12, 2016 11:35 pm
Location: Brampton, ON

Re: Recording Line numbers in Header /Detail BO

Post by sabbirehal »

The auto increment is simple but I think max PODetail.LineNumber + 1 what I need as I want to keep the number increment within single PO Number.

Thanks to all for your input.

Regards,
Sabbi
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Recording Line numbers in Header /Detail BO

Post by Jaymer »

sabbirehal wrote:as I want to keep the number increment within single PO Number
The auto inc facility HAS A WAY to do numbering within groups, like you desire. I’ve never used it. Performance-wise, I’m not sure which method is better.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
sabbirehal
Posts: 57
Joined: Fri Feb 12, 2016 11:35 pm
Location: Brampton, ON

Re: Recording Line numbers in Header /Detail BO

Post by sabbirehal »

Jaymer,

Ok, please see the attached picture of the actual BO lines. I need the LineNumber increment within the ob_Employee_RID. When I try to add the auto increment property, it does not show this field ob_Employee_RID. How can I use the Max LineNumber+1 Rules for every record within ob_Employee_RID?

Thanks
Sabbi
Attachments
Line Number Increment.jpg
Line Number Increment.jpg (135.69 KiB) Viewed 11111 times
sabbirehal
Posts: 57
Joined: Fri Feb 12, 2016 11:35 pm
Location: Brampton, ON

Re: Recording Line numbers in Header /Detail BO

Post by sabbirehal »

Thanks to mark. He helped me on the Zoom.
Post Reply