I am new to Servoy and have created a form containing a portal. I added a button to the portal to allow users to add new records. However, when I run the form, the button does not appear in the portal. The relationship does allow for the addition of records.
Can anyone tell me why this might be happening or if there is a better way of doing this?
Hi Brenda… it should work… just check for any “typo” in your command, keeping in mind that Servoy IS case sensitive. Maybe you can show us your complete method.
Brenda:
“True” is not defined.
if this message is right then you probably passed “True” (undefined variable) to the newRecord() instead of “true” (reserved word = true value)
Oh wait…this is a portal right ? Your portal element is named ‘portal_MaintDetails’ ??
Or is this the relationship?
You need to use the relationshipname.
Thus forms.Maintenance.yourRelationshipName.newRecord();
Also your relationship has to be set to allow creation of records.
I changed the method to refer to the relationship rather than the portal. I didn’t realize that I was supposed to use the relationship name. However, I am still getting the same error. I checked the relationship and it is set to allow creation of new records (i.e., in the Define Relation form, the “Allow creation of related records” check box is checked. My method is now as follows:
Well, there are a lot of ways in Servoy to add records… and … they all work!!!.. so we must be missing something real simple… Brenda, try adding records using the relation instead of the portal and let’s see what happens.
I was getting the same error as before, but I now have it working. My method says:
fk_maintenance_assetinfo.newRecord()
The problem was that the OnAction property for my button must have gotten changed at some point to use a different method (shown below) and I didn’t realize it.