Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Tuesday, November 26, 2024 
 
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!
 Architect Forums - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: Save and New Data Form
Michael Rogers
Posts: 70
 
Save and New Data FormYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 Dec 06 8:40 AM
fiogf49gjkf0d
Alright, I backed myself into a corner here. I commited to the customer that they could "reuse" half of the information they enter on a data form for the next record they need to enter. I thought that I could use onclosequery to keep the form open, and clear all of the data I didn't want to reuse, including the record ID. Since you're reading this, you probably know that the first record added was updated with a NULL ID. I then tried GetIDFor, which of course then set the old record to the new ID.

Anyone tried this before? Succeded? Failed? Am I toast?

Michael
[Reply][Quote]
Jeremy Brayton
Posts: 491
Top 10 forum poster: 491 posts
 
Re: Save and New Data FormYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 Dec 06 2:31 PM
fiogf49gjkf0d
Fortunately you have access to a couple of examples: Insert New Ticket, Insert Opportunity and Add New Contact Account. Insert New Ticket creates a copy when you click the Save Copy button and it probably more closely matches what you're trying to do. I believe it creates the necessary records rather than rely on the data form to handle it under the hood. It is this coupled with the MainView loading technique that allows a data form to create multiple records but edit single records individually.

Theoretically here is how it should work:
1) Insert X is called
2) MainView loads "X EditView", passes the "Add" parameter (something to tell the mainview to add or edit a record)
3) EditView is loaded normally. OnChange and other events operate normally as if ShowViewForRecord was called
4) OnValidate is called to validate the form. If valid new record, create record manually through SQL statements.
5) Reload record into current MainView by using MainView.CurrentID = NewID
6) Repeat steps 4&5 for Save & New button

Upon further examination, it appears that Insert New Ticket creates AND updates records manually using SQL instead of relying on the databinding backend. If this is true I'm not sure why it's a Data Form tied to the ticket except that it probably handles persisting the control details that way, versus having to do all that manually with a Manage Form.

The specific routines that make up the "Save Copy" button are mainly the SaveTicketDetailInfo and Copy routines. You should be able to use them without much modification to suit your needs. The real issue is going to be overriding the default load behavior of your form to use the mainview loading technique. This means turning off Add/Edit from the EditOptions of a grid and a couple of other things depending on how it's done.
[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 © 2024 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): 11/26/2024 10:57:42 PM