*This post is locked for comments
*This post is locked for comments
Thanks again for leading me down the right path. The issue I ran into was I couldn't renumber the existing base-16384 receipt line numbers. There would be key errors and GP wouldn't reflect anything other than the original receipt line order.
I opened a ticket with Microsoft GP developer support and a helpful manager provided me a T-SQL script that did the trick. I'll paste it below. Invoking this script through a Dynamics.Forms.PopReceivingsEntry.PopReceivingsEntry.LocalReturnToExpansion.ValidateBeforeOriginal() event handler completed the requirement. Appreciate your time and feedback!
declare @oldseq int
declare @newseq int
--find the max sequence in use
select @newseq = max(RCPTLNNM) from POP10310 where POPRCTNM = 'RCT1166'
-- select our existing line sequences where the line number is less than our
-- max sequence. have to do this as i'm getting into an infinite loop
-- as the cursor seems 'live' and we keep getting the same record
declare itemcursor cursor for
select RCPTLNNM from POP10310 where
POPRCTNM = 'RCT1166' and
RCPTLNNM <= @newseq order by ITEMNMBR
open itemcursor
FETCH NEXT from itemcursor into @oldseq
while @@FETCH_STATUS = 0
BEGIN
set @newseq = @newseq + 16384
update POP10310 set RCPTLNNM = @newseq
where POPRCTNM = 'RCT1166' and RCPTLNNM = @oldseq
FETCH NEXT from itemcursor into @oldseq
END
close itemcursor
deallocate itemcursor
After received the orders from Select Purchaser Orders window, GP will insert the values to the Purchasing Receipt Line table and fill it to Receiving Transaction Entry scrolling window. So, if you want to re-fill the values with desired sorting orders, you need to re-populate the values to the tables and fill it again. This is common logic for all tools.
Hope this helps!!!
Thanks for the quick reply! I just wanted to clarify that this isn't something coded as part of my standard GP Add-In I rely on for customization. That was developed using VST 2010. Your example is using Dexterity? Not to be ignorant, but how do I utilize this toolset? All I've used in the past is VST 2010...
The Sort By option is only used for the Select Purchase order window. Because this sort options is help us select the purchase orders with different sorting options. Receiving Transaction Entry window won't consider this sort options.
If you want to re-sort the original filled values from Receiving Transaction Entry Scrolling window, you can use Dexterity to clear the scrolling window and set the range (appropriate receipt number from header value) then run the fill window command for key field 2(This key field has the sorting option from item number, receipt number and receipt line number).
Ex: fill window line_scroll of form POP_Receivings_Entry by number 2;
But, I would not recommend for breaking standard GP functionality.
Hope this helps!!!
André Arnaud de Cal...
292,516
Super User 2025 Season 1
Martin Dráb
231,409
Most Valuable Professional
nmaenpaa
101,156