We are in the final stages of launching our app and we have decided to move some of the code server side utilizing Codeless. We have hit a small speed bump and request some assistance if possible.
We have 2 data Tables Venues and Tickets there is a one to many relation between Venues and tickets.
In the Tickets data table we have a “status” column and what we are trying to accomplish is when the “status” column is updated to 4 to create a new object in History data Table and delete the object from Tickets data table. The new created object must include the ownerId and the venues.objectId from the previously set relation.
Everything works as expected however we can seem to get the object id from the relationship the realtime logger keeps logging undefined.
i have attached a screen shot of our codeless block.
in the dataBrowser we have autoload relation on. and on the create object block for the venues property we have tried both response item and the request item to no avail.
and this stage we are certain that the relation is not being loaded when the codeless block is being run.
we have also attempted to use however the “venu” property is not being shown.
Any ideas how to retrieve the parent object id from the relation?
The “venu” property is a relation, this is the reason it doesn’t show up in the drop-down. The relations are not processed in the object update API request, therefore that information will not be available.
It just trying to wrap my head around this, the request item should have the objectId for the related object accessible because this is an event handler after update.
Otherwise which api call should we use to load the related object?
Thank you for the info, We really have been trying to get the relation to load however we are wits end here. We are not looking for someone to do the code for us however any guidance on which api call to make would be really appreciated
If the request item has objectId for the related object, then you should be able to retrieve the related object using that objectId.
Perhaps if we step back and you provide a very detailed description of what data you load from the server, what data you send to the server and what changes you need to implement, it will be very helpful.
So we have 2 tables Tickets and Venues…each Ticket has a relation to a Venue. The Tickets has a column called status, what we are trying to accomplish is have a codeless event handler afterUpdate if status = 4 to create a data object in a Table called History which has a column that should be the objectId of the related Venue.
We don’t want the history to be related to any table hence we just want to retrieve the related venue’s objectId.
Looks like you’re trying to get requestItem['venu.objectId']. Using nested string path isn’t supported here. Try to use another GetProperty block instead.
I am we can only find one get property block in the codless object list. and as i mentioned earlier we have tried accessing the venu property of the request item and the response item to no avail. There must be away to retrieve the related object as the reference in the data browser is alive and well
after some digging we have realized that the updated method dose not load the related object.
is there a way to load the relations of the request item and storing them as a variable then accessing the related object objectId from the stored variable?