dbo.[Companyname$Purch_ Inv_ Line].No_ LIKE '122350%' OR dbo.[Companyname$Purch_ Inv_ Line].No_ LIKE '122370%' OR dbo.[Companyname$Purch_ Inv_ Line].No_ LIKE '7%')
IF PurchInvLine.FINDSET THEN REPEAT IF (Type = Type::"G/L Account") AND ((COPYSTR("No.",1,6) IN ['122350', '122370']) OR // Problem is here I know. If I don't have anything here I can display everything (COPYSTR("No.",1,1) = '7')) BEGIN // Populate Temp Table // Rec := PurchInvLine; INSERT; END; UNTIL PurchInvLine.NEXT = 0; UNTIL PurchInvHeader.NEXT = 0;
PurchInvLine.SETRANGE(Type,Type::"G/L Account"); PurchInvLine.SETFILTER("No.",'%1*|%2*|%3*',122350,122370,7); IF PurchInvLine.FINDSET(FALSE,FALSE) THEN BEGIN REPEAT // Populate Temp Table // Rec := PurchInvLine; INSERT; UNTIL PurchInvLine.NEXT = 0; END;
Answers
You can use the Linked Object for linking to SQL Server objects.
https://docs.microsoft.com/en-us/dynamics-nav/using-linked-objects
why don't you filter in NAV?
This should do the trick. I will work on it. Thank you for your time.
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/
COPYSTR will anyhow you have to do looping and SETFILTER will save you from this so SETFILTER holds the priority.
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/
I started nav 3-4 months ago and I feel like I am learning a lot. I also have the best mentor at work. Thank you again!