I have an XMLPort that I have created and I cannot get the table to filter correctly. I have used the SETFILTER variable to only list out ‘Released’ Production Orders. This is on the line as all the info I need is on the line. I am filtering for 'Released' only in SETFILTER. When I do this on the table in the DEV environment It filters correctly. When I run the XMLPort I get what I want except for the first line. I cannot figure out why it is doing this.
Thank you in advance for any help
Troy
Sorry for the delayed response.
Setting it on the table data worked.
Thank you
Sorry for the delayed response. This worked!
Thank you
Prod. Order Line - Export::OnPreXMLItem()
"Prod. Order Line".SETFILTER("Prod. Order Line".Status,'%1',"Prod. Order Line".Status::Released);
or
"Prod. Order Line".SETRANGE(Status,"Prod. Order Line".Status::Released);
1, we should put the filter under Export::OnPreXMLItem()
2, Syntax:
"Prod. Order Line".SETFILTER("Prod. Order Line".Status,'%1',"Prod. Order Line".Status::Released);
or
"Prod. Order Line".SETRANGE(Status,"Prod. Order Line".Status::Released);
Josh Thank you for the help. I tried both options you gave and neither worked. I am still getting the same result 1 record that the filters should remove.
A little more background on this XMLPort. It is going to be automated with a code unit to run through the Job Queue on a schedule. Not sure if this will change anything I have to do.
Thanks,
Troy
Try using setrange instead of setfilter. The field in question is an option field so the syntax is specific “Prod. Order Line”. Setrange(status, “Prod. Order Line”.Status::Released).
Failing that you can set these types of filters on the table data item of the XML port instead of in code. Highlight the line and choose the properties to open table filter edit window
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,041 Super User 2024 Season 2
Martin Dráb 229,720 Most Valuable Professional
nmaenpaa 101,156