DeepSave questions

App ID: 41F831D7-1082-9EE4-FF6C-0E7ED3481C00

I’ve been playing around with the Deep Save function and its great, it does exactly what it says it does and very easily (although my method is probably less than optimal). In my application I have a page which is the profile of a company, it has all their approvals, registered company details etc and all of these come off the root (parent) which is the registered company. The rest are child relations to the registered company.

At present, when I click save, it takes all the details entered into the profile page and creates new objects for them whether there is any content in the field or not. In the example below, the coHo table is the parent, and the VAT table is the child.

If the companies coHo details are filled in but it is not VAT registered, and said VAT properties are blank, deep save creates an object ID and OwnerID in the VAT object but the properties are blank also. But i cant find a suitable logic option to check if the the vatNo is empty, and if so then dont create the object and the relation to the coHo table because there is nothing to relate to. Ive tried logic test and rebuilding it to try if/else options but its not working. maybe i need to try the transaction API’s or event handlers.

Does anyone have any tips they wouldnt mind sharing? My app is relatively simple, it will be a database of companies and their approvals for our internal use through a UI built in Backendless also.

Hello @Andrew_Billcliffe

Can you share with us a logic test you did? And what was the result of this test?

Regards,
Inna

Hi Inna,
In this method I get the error below when I hit save. I presume its to do with the fact it cant read the object as text. (text is empty argument)


image

Next I Tried creating text from the object. This removes the error when I hit save in the UI, but doesnt work as I expected.
If the vatNo property is empty it saves a object to the database with blank properties for the vatNo etc, but with an object ID and ownerID.
If the fields are populated it also saves the object.


This is the same if i have the “null” on the true input or not.

if I try it the other way round:


it actually works, although backwards. If the argument (vatNo not populated) is true, it save a blank record. But if it the argument is false (vatNo is populated) it does not save a record.

I cant get it to react the right round round if that makes sense?

Tried another option and think it works… :slight_smile:

Sorry to bother you!