Couldn't translate expression value(Microsoft.ProjectServer.Query`1 - sharepoint

Project server 2019 after upgrade from 2016, filter project by ProjectSiteURL throw exception
<m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<m:code>-1, Microsoft.ProjectServer.PJClientCallableException</m:code>
<m:message xml:lang="en-US">Couldn't translate expression value(Microsoft.ProjectServer.Query`1[Microsoft.ProjectServer.PublishedProject]).Where(p => (p.ProjectSiteUrl == "http://bing.com")). See InnerException for more details.</m:message>
</m:error>
Get request :
/_api/ProjectServer/Projects?$select=Id,Name,ProjectSiteUrl&$filter=ProjectSiteUrl%20%20eq 'http://bing.com'
Same error appears using C# CSOM
SP2019 v:16.0.10.382.20004

Related

using commission junction API in CJ platform anyone using successfully?

Is anyone successfully using the CJ web services? while passing the parameters as text or xml am getting error.This is my code
Here is my code am using
This is the Params am using
and am getting the error like this...below I've mentioned
{
"statusCode": 400,
"body": "{"data":null,"errors":[{"message":"Syntax error while parsing GraphQL query. Invalid input """2", expected Value or Argument (line 1, column 71):\n{ publisherCommissions(forPublishers: [""5638564""], sincePostingDate:""2022-12-01T00:00:00Z"",beforePostingDate:""2022-12-28T00:00:00Z""){count payloadComplete records {actionTrackerName websiteName advertiserName postingDate pubCommissionAmountUsd items { quantity perItemSaleAmountPubCurrency totalCommissionPubCurrency }} }}\n ^"}]}",
}
please can someone solve this problem?
data is showing null I want to show the transaction details.

Complex Queries for Side-by-Side SuccessFactors extension using SAP Cloud SDK (NodeJS)

I am trying to create request builders using SAP Cloud SDK for calling Successfactors Odata APIs. I am facing issues with complex OData querying that includes $expand and maybe custom fields.
https://xxxx.xxxx.xx/odata/v2/WfRequest(11111L)?$expand=wfRequestUINav
I created the request builder as below for the above api:
WfRequest.requestBuilder()
.getByKey(11111)
.select(
WfRequest.WF_REQUEST_UI_NAV
)
.execute({
destinationName: "sfapi"
});
I am getting the below error:
OData get by key request failed!
So I modified the code by adding TO_ to WF_REQUEST_UI_NAV as below:
WfRequest.TO_WF_REQUEST_UI_NAV
but still getting the same error. So I thought it may be a custom field and changed the code as below:
const WF_REQUEST_UI_NAV = WfRequest.customField('wfRequestUINav');
function getWFRequestsDetail() {
return WfRequest
.requestBuilder()
.getByKey(11111)
.select(
WF_REQUEST_UI_NAV
)
.execute({
destinationName: "sfapi"
});
I got the below output, but not the expanded result:
{
"wfRequestUINav": {
"__deferred": {
"uri": "https://api12preview.sapsf.eu/odata/v2/WfRequest(11111L)/wfRequestUINav"
}
}
}
Can anyone help in fixing this issue?
Thanks & Regards,
Harish
I guess the answer can be found in the answers.sap.com as mentioned.

The returned result is null after price is updated with java vdm generated for custom odata service

We have a custom OData service(function import) to update price in S/4HANA on-premise system(1909). And I used Java VDM Generator to generate VDM for this OData Service.
OData Service to update price
/sap/opu/odata/SAP//ChangePrice?SalesOrganisation=''&Plant=''&MaterialNumber=''&ConditionAmount=2100&ConditionUnit='EUR'&ValidFrom=datetime'2019-01-01T00:00:00'&ValidTo=datetime'2019-12-31T00:00:00'
After I called the changePrice method and the price is updated in S/4HANA system but the returned entity (priceCondUpdated) is null.
TransferPriceCondition priceCondUpdated = service.changePrice(condUnit,
price,
materialNo,
plant,
LocalDateTime.of(2019, 1, 1, 0, 0, 0),
LocalDateTime.of(2019, 12, 31, 0, 0, 0),
salesOrg).execute(DestinationUtil.getHttpDestination());
I debugged the source code of SAP Cloud SDK and found that the OData Service gave a correct response.
OData response
{"__metadata":{"id":"http://host:port/sap/opu/odata/sap//TransferPriceCondition(SalesOrganisation='',Plant='',MaterialNumber='')","uri":"http://host:port/sap/opu/odata/sap//TransferPriceCondition(SalesOrganisation='',Plant='',MaterialNumber='')","type":".TransferPriceCondition"},"SalesOrganisation":"1709","Plant":"","MaterialNumber":"***","ConditionAmount":"123.000","ConditionUnit":"EUR","ValidFrom":"/Date(1546346659000)/","ValidTo":"/Date(1577796259000)/"}
When it was going to get entity from response in SDK, see source code below responseJsonObject does not contain edmFunctionImportName(changePrice). So it would return null.
Source code of FunctionImportResponseParser.java in Cloud SDK
#Nullable
<T> T getEntityFromResponse(
final InputStream responseContent,
final String edmFunctionImportName,
final Class<? extends T> entityJavaType )
throws IOException,
IllegalArgumentException
{
final JsonObject responseJsonObject = getJsonObjectFromResponse(responseContent);
if( responseJsonObject.has(edmFunctionImportName) ) {
final JsonElement jsonElement = responseJsonObject.get(edmFunctionImportName);
return getEntityFromJsonElement(jsonElement, entityJavaType);
}
return null;
}
Could you help to take a look at this issue?
SAP Cloud SDK Version: 3.3.1
S/4HANA On premise: 1909
Thanks,
Jerry
Thanks for the well documented question! Please use the SAP Cloud SDK version 3.6.0 and above. We fixed the parsing of OData function import results.
Best regards,
Alexander

MS Translator API Error - not working for Serbian/Croatian

I have a question regarding MS Translator API. I followed "[Walkthrough: Microsoft Translator in a C# Console Application][1]" tutorial so I could use MS translate API from my app. When I try translating from "English" to "French" or some other language, everything works perfectly fine. But when translating from/to Serbian/Croatian, I get following error message: "Parameter: From has an invalid pattern of characters".
Since I am using automatic language detection, I didn't hard code any of the language acronyms:
string input = "Petar voli da ide u skolu"; // serbian
var sourceLanguage = Translator.DetectSourceLanguage(tc, input); // gets Croatian
var targetLanguage = PickRandomLanguage(tc); // select random language by using
// Handle the error condition
if (sourceLanguage != null)
{
var translationResult = Translator.TranslateString(tc, input, sourceLanguage, targetLanguage); // exception "Parameter: From has an invalid pattern of characters".
if (translationResult != null)
{
}
}
Is there a problem with the API, or Serbian/Croatian are not supported?
You use wrong or old script.
I use this script in php: Microsoft Translator doesn’t work in the Serbian and Croatian?
For C# use script from this page: https://msdn.microsoft.com/en-us/library/ff512421.aspx#csharpexample

Microsoft WF .NET ExpressionText causes validation errors

This is related to the Workflow Foundation .NET 4.0. We have found that when setting the ExpressionText to a reserved keyword such as "interface" or "class", the underlying Validation Service in the foundation throws a validation message stating "one or more children have validation errors or warnings".
We are setting the ExpressionText of an argument like this:
Argument inArg = Argument.Create(typeof(T), ArgumentDirection.In);
inArg.Expression = new VisualBasicValue<T>
{
ExpressionText = selectedItem,
};
mp.SetValue(inArg);
Any idea if this is a known issue, and how we can handle it?

Resources