Child fields are disabled


Author
Message
Doron Farber
Doron Farber
StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)
Group: Forum Members
Posts: 92, Visits: 612
ok thanks Trent
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
You can use it if you understand when to remove the filter and reapply it.  The post you pointed me to was really more complex than what you are trying to do in regards to the scenario that you gave me (I am sure that your code would be more complex).  However, the point of that post and what I have been telling you is that if you have a filter applied, automated or otherwise, and add a new record, that new record will be immediately filtered.
Doron Farber
Doron Farber
StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)
Group: Forum Members
Posts: 92, Visits: 612
Hi Trent,

That property really creates a lot of confusion after searching into the WinForms section. Me and Edhy were looking at this problem and made the same assumption of using the ChildAutoFilterOption property as MatchCurrentRow. In this thread you calrify it: http://forum.strataframe.net/Topic16681-6-1.aspx?Highlight=ChildAutoFilterOption

Regards,

Doron

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
It was a very simple problem...you have the ChildAutoFilterOption on the CustomersBO1 set to MatchCurrentRow.  So you will never be able to see a new child record.  This is a basic filtering problem, and you can find post after post in this regard.  I always caution people about using the ChildAutoFilter options and to be careful when using a filter or sort of any kind.  We use them all of the time, but you have to be aware of what will happen when you add a new record or change a value that is part of the filter or sort.

In this case, you could never add a new record because as soon as you create new Orders record the new row will be fitlered out (this is standard ADO.NET).  You need to turn off the filter, allow the foreign key to be set (in this example), then you could apply a filter that would include the new record. 

Bottom line, set the ChildAutoFilterOption to Off on the CustomersBO1 instance, run the app again, click add, and it will work.

Doron Farber
Doron Farber
StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)
Group: Forum Members
Posts: 92, Visits: 612
Hi Trent,

This is a maintenance form where the parent and the child fields are in the same form and using the tool strip for Adding or Editing each record. I followed all the steps shown in a video and in the help file and got the same problem. I could edit the child and the parent and under the Add mode the child was disabled. The EditingState was Adding initially and then later became Idle. Well I created a sample project with one form , from your sample database and had the same problem.

Please let me know how that can be fixed.

Thanks,

Doron

Attachments
SF_Projects.zip (142 views, 1.00 MB)
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Have you debugged to actually see if the EditingState of the BO has changed to Adding?  It sounds like something within your configuration is preventing those BOs from being placed in an Add mode.  Since you are using the IncludeInForm stuff, the Edit and the Add states will be determined by the IncludeInForm properties.  You can adjust these settings until you get what you want...but in short, the EditingState of the BO did not change.
Doron Farber
Doron Farber
StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)StrataFrame User (212 reputation)
Group: Forum Members
Posts: 92, Visits: 612
Hi All,

From some reason the Child fields are disabled on Add mode, but are fine in Edit mode. Somehow before it worked fine.  In the Child object the IncludeInFormAdd is True and in the form level the IncludeInFormAddType is DetermainedByBusinessObject. This is just an exercise for me to learn the SF, but the child and the parent should be saved at the same time. Using SF 1.6.5.1

Thanks,

Doron

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search