Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Thursday, June 5, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Web Forums - SalesLogix Web Platform & Application Architect
Forum to discuss the use of the SalesLogix Web Platform, Client and Customer Portals, and the Application Architect (For version 7.2 and higher only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Web Platform & Application Architect | New ThreadView:  Search:  
 Author  Thread: Adding AddEdit form for data grid
Frank Chaffin
Posts: 475
 
Adding AddEdit form for data gridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 29 Feb 08 2:16 PM
I have an account tab with a datagrid that displays records from a 1:M account table (cuAccountNotes). I...
added an cuAccountNotes entity
added a relationship to the Account
added a detail form under the cuAccountNotes entity
added a Save button to the cuAccountNotes ToolBar (business rule:save:cuAccountNotes)
added an addButton, to the Tab that contains the grid, and wired it to the cuAccountNotes entity

The form comes up OK and the Save works if I manually provide the cuAccountNoteID and AccountID values. What do I need to do to wire up so it will pull the AccountID and generate an cuAccountNoteID values when needed?

[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Adding AddEdit form for data gridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 29 Feb 08 4:50 PM
The problem sounds like the child data is not getting associated to the parent properly. You do have to do some things to get that to happen.

You'll need to do one of the following:

Route #1) Launch your add/edit form using a "Insert Child Dialog Action" instead of just a Dialog Action.

For example if you had a custom Account Product 1:M datagrid form, which displayed under the Account main view, on the toolbar Add button, set the OnClickAction to something like this...

OnClickAction: Insert Child Dialog Action
Data Source: dsAccountProducts (This is the datasource object used to populate your datagrid)
Entity Type: AccountProduct
SmartPart: AddEditAccountProduct (This will be what ever you called your Add/Edit form, which was created under the Entity that is getting updated.)
Parent Relationship Property: Account (This will be your Parent Entity that the child Entity needs to be associated with.)
TitleOverride: Add Account Product

From here, your add button will do all the Parent-Child databindings for you automatically and all that you have to do now, is to make sure your Child Add/Edit form has a toolbar button with a Save action and your all set.

Route #2) For the "Save" button on your child form, instead of using the Save business rule, change it to a C# Code action and add the following (Assuming your grid is based on an Entity called Widget under the contact):

// get a reference to the current child object
Sage.Entity.Interfaces.IWidget widget = (Sage.Entity.Interfaces.IWidget)this.BindingSource.Current;
// get a reference to the current parent object
Sage.Entity.Interfaces.IContact contact = (Sage.Entity.Interfaces.IContact)this.GetParentEntity();

// add the widget to it's parent so the association is made.
// this is likely what is causing your problem (this isn't happening)
widget.Contact = contact;
// this next line is what will cause the grid to refresh to show the new widget
contact.Widgets.Add(widget);

// now call the Save business rule
widget.Save();


Anyway, hope that makes sense. Both routes work fine. Unless you have specific needs to do it in code (like maybe you are using the form in several areas, under different entities) then you should probably just go with route #1.

-Ryan
[Reply][Quote]
khoushik selvaraj
Posts: 3
 
Re: Adding AddEdit form for data gridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 May 08 8:40 AM
hi ryan

when i try to configure the addeditaccountproduct smartpart under account detail page i get an error stating cannot resolve the smartpart accountproduct/addeditaccountproduct.ascx,i have followed the exact steps as mentioned above. Please let me know the reason
Thanks
[Reply][Quote]
Byron Branfield
Posts: 10
 
Re: Adding AddEdit form for data gridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 Mar 14 10:01 AM

Hi Ryan, I was wondering if you could help me with this. I have an Account tab called AccountISVApplications, I have an Insert Entity page for adding new ISV Applications. From that Insert page I need to be able to add Accreditations associated to that specific ISV Application. Orginally I had the AddEdit page fire up in DialogWorkspace but adding Accreditations (Child Dialog Action) would work at all.


I then created the Insert Entity page which redirects from the AccountISVApplications tab, I have a datagrid and a button above which fires the Child Dialog Action. This all happens fine and after adding the Accreditations they appear in the datagrid, but when saving and redirecting the Account Detail the Accreditations arent saved. I think this is because there is no ISVApplication record at the time of adding the Accreditations.


I used your above code on the Save button of the child form (Accreditations) but I get the following error:


================================


object references an unsaved transient instance - save the transient instance before flushing or set cascade action for the property to something that would make it autosave. Type: NewNamespace.TPISVApplication, Entity: .

Saleslogix Error Id: SLXAB6A2C2A9CF7BCE5

URL: http://localhost:3333/SlxClientDev/InsertISVApplication.aspx?modeid=Insert&accountId=A6UJ9A000FXZ

Exception type: NHibernate.TransientObjectException

Source: NHibernate.Engine.ForeignKeys, NHibernate, Version=3.3.1.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4


================================


I tried saving the InsertISVApplication just before I click the Add Accreditations button but still nothing. Any ideas? Been stuck on this for a really long time!


 

[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 6/5/2025 2:56:09 AM