Acumatica OpenAPI can not search stock item by barcode in cross references - join

I'm trying to use OpenAPI to fetch data from Acumatica.The filter is barcode in CROSS-REFERENCEEimage.
It's unable to fetch data(before change) because
"The parent value for a property access of a property 'AlternateID' is not a single value. Property access can only be applied to a single value."
I did some research and find a same question(OData $filter with items in a $expand).
I changed(after change) my request but still get
"exceptionMessage": "The method or operation is not implemented." error.
I really know nothing about OData and C#.I use JAVA/NODEJS to fetch data. Can someone give me any suggestion? Thanks a lot.

You can't do it this way.
Acumatica doesn't support filtration over the detail records.
Instead, you can create a new GI that will contain the information from the Inventory Item and corresponding Alternate IDs and request the records from that GI.

Related

Graph Bookings API - List appointment returning empty customers array

When invoking either
GET /solutions/bookingBusinesses/{id}/calendarView
or
GET /solutions/bookingBusinesses/{id}/appointments
the returned bookingAppointment object has an empty customer array. However the customers appear in the UI. Any idea why this may be the case?
Looks like a bug in Graph API.
According to the documentation the customers property is optional. Sometimes you have to specify optional property in $select statement.
GET solutions/bookingBusinesses/{id}/calendarView?start=2018-04-30T00:00:00Z&end=2018-05-10T00:00:00Z&$select=customers
Another option is trying beta version instead of v1.0
GET beta/solutions/bookingBusinesses/{id}/calendarView?start=2018-04-30T00:00:00Z&end=2018-05-10T00:00:00Z

How to access object field in qaf step from stored variable

In my previous question I was looking for a way to access and store return value of the function in qaf step. I was provided with the following:
When create new user using "{'name':'user1','password':'user123'}"
And store into 'newUser'
Then system should have user '${newUser}'
Now, I'd like to know how to get value from object/collection stored.
If it is a simple object named newUser which has field Id. How would I pass Id on next step?
And, if return is List, how to get by index from stored list?
Resolved issue on my own. If anyone faces same unknowns, here is how I solved it.
For requirements to work around response data, parsing same stored objects in properties by specific fields or collecting data from other structures such as Maps or Lists, create common functions with #QAFTestStep annotation to get data for class member name, map by key or list by index and so on... Add those in common steps and then write stepname text in gherkin format with parameters specified. Let me know if someone needs help, always ready to help out...

How to store data in workitem using key value pair in TFS using object model

I have heard that there is an api method available in TFS Object model api, through which i can store in the work item using key value pair and this data is not visible in UI as it is not any field value. This data can only be retrieved through api. I have searched but i was not successful up till now. If any one know such type of method so please share it.
My main purpose to store some metadata in it but it should not visible to the User and also user can not update it. Secondly i did not have to use any field, as fields vary from work item to work item and even from Process template to Process template.
Thanks in advance.
I suppose that you mean this link: https://www.visualstudio.com/en-us/docs/integrate/extensions/develop/data-storage.
To set a value of key-value you could use this method:
VSS.getService(VSS.ServiceIds.ExtensionData).then(function(dataService) {
// Get value in user scope
dataService.getValue("userScopedKey", {scopeType: "User"}).then(function(value) {
console.log("User scoped key value is " + value);
});
});
This document is the details information about the methods in VSS.ServiceIds.ExtensionData service.

Getting some data from Microsoft Graph unified OData endpoint

How to count number of items in EntitySet of MicrosoftGraph, for example 'users' or 'groups'? I tried:
https://graph.microsoft.com/v1.0/users?$count
Returns: lists all users
https://graph.microsoft.com/v1.0/users/$count
Returns:
{ "error": { "code": "Request_BadRequest", "message": "Unexpected segment Edm.Int32.", } }
Also in Annotations of target "microsoft.graph.directoryObject" which are those EntitySets based on I see that it is Selectable=false, Countable=false ...
Will $skip be ever available on 'users' or other toplevel EntitySet items ( https://graph.microsoft.com/v1.0/groups?$skip=5 ) ? It is available on other items ( https://graph.microsoft.com/v1.0/me/contacts?$skip=5 ). I know about $skipToken, but it is not the same.
Can I find somewhere in the $metadata if property is sortable? For example user.displayName is sortable, but user.mail or user.givenName are not. This would be handy in the $metadata. Is there plan to introduce this into $metadata?
OrderBy DESC in this formula https://graph.microsoft.com/v1.0/users?$orderBy=displayName%20desc is ignored, it shows items ordered ASC, am I doing something wrong?
Not much help I know, but if you do an API call that gets a Collection you can get a count using the second form you gave in the first question. Eg:
https://graph.microsoft.com/v1.0/users/<id>/events/$count
returns the count (6 in my case, and not in JSON - the returned data is actually "\x{ef}\x{bb}\x{bf}6" (in Perl formatting)). If we use the ? as the last separator (which is what http://graph.microsoft.io/en-us/docs/overview/query_parameters seems to indicate we should) with this URL:
https://graph.microsoft.com/v1.0/users/<id>/events?$count
I just get the list of events with no count as you do.
So that seems to indicate two things to me:
a) The $count doesn't appear to work as a query parameter, despite the documentation and the OData standards saying it should,
and
b) There seems to be a bug in the API for handling EntitySets which isn't there for Collections.
Sorry I can't be of more help, but its another data point at least (I just came unstuck with the same thing which is why I noticed this StackOverflow post!)
Ad 1. https://graph.microsoft.com/v1.0/users/$count is the correct OData syntax (http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part2-url-conventions/odata-v4.0-errata02-os-part2-url-conventions-complete.html#_Toc406398087), but as indicated in the metadata directoryObject collections are not currently countable. ODataV4 also allows $count in query parameters (http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part2-url-conventions/odata-v4.0-errata02-os-part2-url-conventions-complete.html#_Toc406398166), but then it should be specified with true or false value (e.g. https://graph.microsoft.com/v1.0/me/events?$count=true) and the response will include both the collection and its count in the #odata.count property. This is again not supported for directoryObject collections.
Ad 2. There is no plan right now to support $skip for directoryObject collections.
Ad 3. Yes, we plan to indicate which properties are sortable by in metadata using the SortRestrictions annotation defined in the OData capabilities vocabulary (http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/vocabularies/Org.OData.Capabilities.V1.xml)
Ad 4. Your request is correct, but we only support sorting users by displayName in the ascending order.

OData call with $filter and $expand simultaneously

I've been trying to call a entity, but i'm supposed to call the results from its associated entities. I tried to do it with the following URL:
/sap/opu/odata/XXXXXXXX/SERVICE_NAME/MatnrGetdetailCollection?$filter=IVendorId eq '1701' and ILanguage eq 'P' and IMaterial eq 'M-05'&$expand=MatnrClassGetdetail
I must use the filter because the called function has these mandatory parameters.
Am I making any mistake on the URL or the error isn't there?
In general $filter and $expand can be combined, we use it in our application. Therefore please see Layla's Comment. In addition, you should tell us what the actual error is.
If MatnrGetdetailCollection is indeed an entity set, then the corresponding entity must have a navigation property of the name MatnrClassGetdetail, otherwise $expand won't work.
There is some problem with the URL when you want to go for obligatory parameters. Please pass them as key values in segw and and go for the format I'm sending:
/sap/opu/odata/sap/SERVICE_NAME/EntitySet(keyfield='value',keyfield='value')/?$expand=navigationName

Resources