I have tried searching for an answer but could't find it. I have an OptionSet field (x) in Dynamics on an Entity. Its OptionSetType is Boolean. FalseOption is No and TrueOption is Yes.
I am to set the value of above field using CDS. I am making Http calls to update the data. The rest of the fields are updating OK but only this one has no affect and is always false. I have tried giving values like "true", true, "Yes", yes, 1, "1" ... but not working.
Does anyone know how to set the yes or not optionset using CDS?
Thanks in advance
Additional info:
Here is the data that I am sending to D365 via CDS:
{{
"createdon": "2020-01-14T00:00:00",
"receiveddate": "2020-01-14T00:00:00",
"grosssaleprice": 297495.0000,
"discount": 10374.0000,
"islocalboolean": true,
"agreementnumber": "Aj55"
}}
If you know CDS, it just works via http requests. and takes the above payload. All other fields are set as expected but the islocalboolean is not.
Related
I can't figure out how to set up the links. I have created a collection. I need an creator to be automatically specified in that record when adding a record to the collection. How do I do that?
I've faced this problem...
I found the solution in the documentation:
need to add
"populateCreatorFields": true
in the file (strapi v3) /api/your-type-name/models/your-type-name.settings.json
in options object
like:
...
"options": {
"increments": true,
"timestamps": true,
"draftAndPublish": true,
"populateCreatorFields": true
},
...
More information can be found at strapi documentation
Strapi does not support it by default. As mentioned in this form you can achieve it by editing the strapi's controller. But I will not recommend you to edit the strapi controller at all. Please avoid it.
There is a simple and better solution to this. You can achieve this by creating one to one relationship. Create an author table/collection. Make one to one relationship with your other collection. You can make it a required option as well. So whenever someone creates an entry they have to select an author from your already created collection of authors.
And now you can get relation in your API and use it wherever you want to.
As stated in my comment, Strapi (tested on v3) comes with a created by field. To ascertain the claim, the following steps can be followed;
Create a new content type. Here I am setting only one field, called test
Add an entry for that content type. Notice the last update and by field on the right.
Save and open the entry. The last update and by fields have been automatically populated.
I have a question of AWS AppSync. I wonder whether there is a way to check existence while adding multiple values into one attribute of the parent.
So, here is my example:
This is User type:
User type
Here is what the dynamodb looks like:
dynamodb item
And here is what I want t accomplish: To add three programs into a user record, under the programs attribute.
the addProgramToUser mutation
And here is my current resolver:
the addProgramToUser resolver
So I my logic is to extract the existent programs from dynamodb first, and then check whether the "To Be Added" program Ids are in there. If there is, stop the updating or skip that program id. If there is not, continue the update. So the question is, how to extract current data using the VTL and how to compare the existent ones and the ones I want add.
Or if anyone has other idea of how I can accomplish this task, please help. Thanks so much. I cannot embed the pictures since I am new on stackoverflow. So sorry for the inconvenience. Have a good day.
It seems that you can use a condition for your resolver's request mapping template. A condition expression lets you tell AWS AppSync and DynamoDB whether the request should succeed or not based on the state of the object already in DynamoDB before the operation is performed. For example, in your case, you only want the UpdateItem request to succeed if there is no program id in Dynamo already.
{
"version" : "2017-02-28",
"operation" : "PutItem",
"key" : {
"id" : { "S" : "1" }
},
"condition" : {
"expression" : "attribute_not_exists(programId)"
}
}
Since today I have problem with one of 2 similar calls to Google Calendar API v3:
calendar.events.list
Both calls are requesting list of assignemnts and use privateExtendedProperty to filter them, but key=Value pairs are different.
When I have privateExtendedProperty set to myStatus=READY it returns events I need,
but when I set privateExtendedProperty to myId=agxzfm1haWxmb29nYWVyNQsSDE9yZ2FuaXphdGlvbiIVYWN0aXZlZ2FtaW5nbWVkaWEuY29tDAsSBENhc2UYkcHA3wgM
it returns no events, though I'm sure there are several events with this myId...
It appears that the calendar API list is returning an empty list when querying by a privateExtendedProperty with 90 characters long.
Everything worked fine for years, but it suddenly broke for some of my users this morning...
This is my request:
GET googleapis.com/calendar/v3/calendars/****/events?privateExtendedProperty=myId%3Dagxzfm1haWxmb29nYWVyNQsSDE9yZ2FuaXphdGlvbiIVYWN0aXZlZ2FtaW5nbWVkaWEuY29tDAsSBENhc2UYwauk6QgM&key={YOUR_API_KEY}
This is the result I see in API explorer:
{
"kind": "calendar#events",
"etag": "\"*****\"",
"summary": "*****",
"description": "*****",
"updated": "2018-02-20T03:18:35.098Z",
"timeZone": "Asia/Tokyo",
"accessRole": "owner",
"defaultReminders": [
],
"nextSyncToken": "CJDv1KDEs9kCEJDv1KDEs9kCGAU=",
"items": [
]
}
Update 1:
My privateExtendedProperty looks like this:
{
"myStatus": "READY",
"myId": "agxzfm1haWxmb29nYWVyNQsSDE9yZ2FuaXphdGlvbiIVYWN0aXZlZ2FtaW5nbWVkaWEuY29tDAsSBENhc2UYkcHA3wgM",
"another": "Another value",
"another2": "Another value2"
}
When I query events with "myStatus=READY" - event is returned, but when I do the same with "myId=agxzfm1..." - it returns emtpy list.
Update 2:
For those who have the same issue. As per suggestion, I created a new calendar and then duplicated some test data and tried long value in privateExtendedProperty query and it returned event as expected. It means, if this is a bug - not all calendars are affected and moving things to a new calendar might be a way to go.
The document for Extended Properties says the limitations as follows.
The maximum size of a property's key is 44 characters, and properties with longer keys will be silently dropped.
The maximum size of a property's value is 1024 characters, and properties with longer values will be silently truncated.
An event can have up to 300 shared properties totaling up to 32kB in size (keys size + value size).
An event can have up to 300 private properties, totaling up to 32kB in size (keys size + value size), across all "copies" of the event.
From this, it seems that your case is out of the above limitations. In my environment, also I tried your situation. As the result, it was found that myId=agxzfm1haWxmb29nYWVyNQsSDE9yZ2FuaXphdGlvbiIVYWN0aXZlZ2FtaW5nbWVkaWEuY29tDAsSBENhc2UYkcHA3wgM can be used.
So can you confirm the following points again?
It seems that your result retrieved by API explorer doesn't included extendedProperties in the property of items. When you set extendedProperties, it can be seen. If you use fields, it might be not able to be seen.
Can you set extendedProperties with myId=agxzfm1haWxmb29nYWVyNQsSDE9yZ2FuaXphdGlvbiIVYWN0aXZlZ2FtaW5nbWVkaWEuY29tDAsSBENhc2UYkcHA3wgM again?
You can set it using calendar.events.patch.
When you retrieve events with myId=agxzfm1haWxmb29nYWVyNQsSDE9yZ2FuaXphdGlvbiIVYWN0aXZlZ2FtaW5nbWVkaWEuY29tDAsSBENhc2UYkcHA3wgM using calendar.events.list, if you use the URL encoded value of myId%3dagxzfm1haWxmb29nYWVyNQsSDE9yZ2FuaXphdGlvbiIVYWN0aXZlZ2FtaW5nbWVkaWEuY29tDAsSBENhc2UYkcHA3wgM, please try to use the value without URL encode.
If this was not useful for you and I misunderstand your question, I'm sorry.
Edit :
If you retrieve the event using calendar.events.get, can the extendedProperties you set be seen? If you cannot see it, please insert extendedProperties again.
The endpoint is GET https://www.googleapis.com/calendar/v3/calendars/### calendar Id ###/events/### event Id ###?fields=extendedProperties%2Fprivate
In my environment, the same endpoint of yours works fine. So as a test, can you try to create new calendar and run that query? Because I worried whether the recent update of calendar affects this situation.
Enums come back from the server as myEnum.SomeValue but what I'd like to show on screen is a formatted value such as "some value" instead of SomeValue.
That could be part of an attribute on the server-side model but it won't be passed in the metadata.
What's the best place then to do that kind of thing with breeze ?
We've discussed the idea of "extensible" metadata for Breeze but have not yet implemented it. Please vote for this here.
But in the meantime, there is nothing stopping you from "enhancing" the metadata returned by Breeze yourself. The best way to do this would be to add your own properties to either the "MetadataStore", "EntityType" or "DataProperty" classes.
The advantage of adding your custom metadata to existing metadata objects is that this data will be available whenever you work with any of the basic Breeze metadata.
Perhaps something like this: ( I haven't actually confirmed that this code is correct)
var custType = myEntityManager.metadataStore.getEntityType("Customer");
// assume that the 'status' property is actually an enumerated value where you want to
// add some custom metadata.
var statusProp = custType.getProperty("status");
// enumDescriptions is your custom property
statusProp.enumDescriptions = {
"PaidUp": "Paid Up",
"Delinq": "Delinquent",
"InArr": "In Arrears"
};
Now anywhere that you get given the "status" dataProperty, ( such as in a Validation), you will also have access to your "enumDescriptions"
Hope this makes sense.
When trying to create a new list via api
https://api.foursquare.com/v2/lists/add
collaborative is always set to false, ignoring any true, "true", 1...
Anybody with this problem?
I confirmed this is really a bug on add list endpoint, because if you update the list you just created, and set collaborative to true, it works :)