2/21/2025 10:58:49 PM
|
|
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!
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.
|
|
|
|
Wiring up screen to Add New Custom Record
Posted: 18 Mar 08 11:34 AM
|
I am upgrading a database that has NetworkClient customizations, which I developed a few years ago, that I need to implement in the Slx 7.2.2 WebClient. One of the customizations tracks Project and Project_Task information. It uses a Gmk_Project table that has a M:1 relationship to the Account table, and a Gmk_Task table that has a M:1 relationship to the Account table and a M:1 relationship to the gmk_project table.
I created a custom main view that that displays the Project Detail information, and Task infomation in a grid on a Project.Task tab. This is working the day I want and I am able to edit/delete existing Project records.
I created a Task Detail screen that is invokes from the Tasks tab grid. The Task Detail Screen works the way I want and I am able to edit/delete existing Task records.
Now I need to get the Insert (Task and Project) pieces working. I started with the Task Detail screen. The Task Detail form has an Account Lookup and a Project Lookup on it, and I am able to insert a new Task by manually populating the Account and Project information. However what I want is for the Account and Project information to be automatically populated when the Task Detail opens. The Add Task screen in being called from a Toolbar button on the Project-Task so the desired Account and Project informaiton is at hand when the Add button is clicked.
I decided to add a C# snippet to the LoadAction to set the Projectid and Accountid on the form when it is called in Add mode. I am able to sense when I am in Add mode and have been able to set the Projectid but have not been able to set the Account or other bound fields on the form.
Here is the C# code I tried.
Sage.Entity.Interfaces.IGmk_Task t = this.BindingSource.Current as Sage.Entity.Interfaces.IGmk_Task; if (t.GmkProject == null) { Sage.Entity.Interfaces.IGmk_Project pp = GetParentEntity() as Sage.Entity.Interfaces.IGmk_Project; if (pp != null) { t.GmkProject = pp; //this works
//t.Account=pp.Account; //this sort-of worked but caused problems on the post
t.AccountId=pp.Accountid; this.lueAccount.Text=pp.Account.AccountName; } }
Questions: Is what I am trying to do possible from the LoadActions? If so how do I get it done?
Is there a better approach... perhaps a business-rule? If so how to a approach it?
**Note** I am a new-comer to the ASP.Net world.
|
|
|
|
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!
|
|
|
|
|
|
|
|