I have a vendor bill, I have a custom record with ...
# suitescript
c
I have a vendor bill, I have a custom record with GL impact lines. I need to populate data from the bill lines onto the custom record GL lines. Obviously, the lines don't map between the records 1:1, GL impact will always have more lines than expenses/items on a bill. I need a way to match lines between the two. The custom record is locked (by Zone & Co), the script that creates the custom record is also locked. I tried to come up with a compound key (several line fields) to uniquely identify a line across both records, but it's never proven to be unique on a large enough bill. Any ideas?
b
It is unlikely that the ordering of the custom record's gl impact lines are random. They likely are created in the same order as the gl impacts, which is normally the same as the vendor bill lines
c
I tested that theory out with a one line expense bill, the GL impact on the bill was not ordered the same as the GL impact on the custom record.
Zone & Co's script will certainly have some logic to the order, it's just not completely clear and a bundle update could change how it works. It feels risky to rely on the ordering.
b
assuming that there isnt actually a key, the ordering is actually the only relation between the two
c
That's what I was afraid of - I can see there is definitely no shared key between them.
b
their script might actually be done via a search or query, so you would have to replicate that seach or query to find out the ordering
c
That's a good point. I can look at the components of the bundle and review all the searches, hoping it's not a query embedded in the script.