Normal Topic Shift-F5 Ditto with Unique Invoice Numbers (Read 3527 times)
dhopkins
Member
*
Offline



Posts: 47
Joined: Aug 20th, 2007
Shift-F5 Ditto with Unique Invoice Numbers
Jun 16th, 2008 at 4:17pm
Print Post Print Post  
Hi,
The users in my office have managed to make the move from Q&A to Sesame with little problem. But one complaint I still get is that they can no longer ditto a form. They would like to use Shift-F5 to copy and form and replicate the order (for example, if a customer wants the same order everyday for a year). But when they use the ditto key, -everything- is replicated, including the invoice number, which is usually a unique number.

I have a feeling this is a simple fix, but I'm at a loss. Does anyone know how I can copy a form and still have a unique invoice number?

Thanks,
Derrick
  
Back to top
 
IP Logged
 
Ben
Lantica Support
*****
Offline



Posts: 218
Joined: Apr 7th, 2005
Re: Shift-F5 Ditto with Unique Invoice Numbers
Reply #1 - Jun 16th, 2008 at 4:28pm
Print Post Print Post  
You could add a command button to your form that your users could click when they want to duplicate a record. Below is a sample of On Element Entry programming that will allow you to selectively ditto the data.

Ditto_Button :: On Element Entry
Code
Select All
@Ditto(Company, Address1, Address2, City, State, Zip)
//The @Ditto command retrieves the values from the specified elements in the previous record and places them in the same elements in the current record.
 



See page 214 of the 2.0 Programming Guide for more details on the @Ditto command.
  
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Shift-F5 Ditto with Unique Invoice Numbers
Reply #2 - Jun 16th, 2008 at 4:56pm
Print Post Print Post  
Or you can use the copy form commands (F11/Shift-F11) along with the copy spec to selectively copy fields.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
dhopkins
Member
*
Offline



Posts: 47
Joined: Aug 20th, 2007
Re: Shift-F5 Ditto with Unique Invoice Numbers
Reply #3 - Jun 17th, 2008 at 3:42pm
Print Post Print Post  
Thanks, I'll tell them to use F11/Shift-F11 instead of ShiftF5.

D
  
Back to top
 
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Shift-F5 Ditto with Unique Invoice Numbers
Reply #4 - Jun 17th, 2008 at 4:21pm
Print Post Print Post  
For my users, I created two command buttons that do this, one for the F11 ditto and one for the Shift-F11 paste, and then removed the menu items and key functionality for these, so these buttons are the only way to do this.  Included in the Shift-F11 button programming are a set of CLEAR() commands which immediately remove all content from fields that need to be unique, such as the Invoice number.
Here's my code:

Replaces F11:
Code
Select All
Var vCopyToBuffer as Int

// Copies the current form to the buffer (F11)

IF @MODE() = 1  // For Update mode
THEN
	{
	vCopyToBuffer = @SelectTreeItem("Search Update Menu!Edit Commands!Copy Form to Buffer (F11)")
	}
ELSE IF @MODE() = 0  // For Add Mode
THEN
	{
	vCopyToBuffer = @SelectTreeItem("Add Data Menu!Edit Commands!Copy Form to Buffer (F11)")
	}
ELSE @MSGBOX("This Button only works in ADD or UPDATE Mode", "", "") 



Replaces Shift-F11:
Code
Select All
Var vPasteBuffer as Int

// Pastes the Buffer to the form  (Shift-F11)

IF @MODE() = 0  // For Add Mode
THEN
	{
	vPasteBuffer = @SelectTreeItem("Add Data Menu!Edit Commands!Paste Buffer to Form (Shift-F11)")
	CLEAR(INVOICE_NO_1)
	CLEAR(INVOICE_DATE)
	ClearAllPaymentInfo()
	}
ELSE @MSGBOX("This Button only works in ADD DATA Mode", "", "") 

  

**
Captain Infinity
Back to top
IP Logged