When add a record (create service) and I map a value to the pointer field it fails, when I don't the field remains empty?
When add a record (create service) and I map a value to the pointer field it fails, when I don't the field remains empty?
Hello Sander,
Could you please clarify what value do you map on pointer field? It should contain the id of record in related collection. Please look at this link: http://devcenter.appery.io/documentat...
I have got 2 collections 1 with a pointer to the other. I use create service to add a record to collection A and map the _id to a LocalVariable. I then use the create service to add a record to collection B using the LocalVariable to populate the pointer - this doesnt work.
Hi Sander,
How do you add a record of pointer type?
Did you map a localStorage variable to a parameter of pointer type? If yes then note you would need to add both ID and column name.
For example, if you pass ID via mapping, add the following code to this parameter:
prereturn '{"collName":"myColumn", "_id":"' + value + '"}';/preWhere 'myColumn' is a name of the column where the pointer points.
Hi Katya not quite sure I get it tbh:
So if I have a collection called "A" and I add a record with an "_id" and then want to add a record to a collection called "B" with a pointerfield called "AID" what would the syntax be please?
This example will help you:
Great stuff, thanks!
Hi thanks for that but it works in test but not in the app? I've added the "return '{"collName":"myColumn", "_id":"' + value + '"}';" statement to the EditJS mapping and use an alert to ensure it is using the right parameters. It doesn't add a record at all.
In test it works fine
Did you invoke Service?
How exactly?
Yes, I invoke the create service to add the record to collection "A" and then on the success event of that service invoke the create service for collection "B"