cancel
Showing results for 
Search instead for 
Did you mean: 

Updating exisiting system form field

Former Member
0 Kudos

Hi,

On the quotations form there is a tax date field.

I have renamed the caption "last updated" and wish everytime the form loads for the data to read the same as the server date as below:

'Move "Document Date" Caption and rename "Last Updated"

oXPlaneItem = oForm.Items.Item("85")

oYPlaneItem = oForm.Items.Item("13")

oItem = oForm.Items.Item("86")

With oItem

.Height = oYPlaneItem.Height

.Width = oYPlaneItem.Width

.Left = oYPlaneItem.Left

.Top = oXPlaneItem.Top

End With

oLabel = oItem.Specific

oLabel.Caption = "Last Updated"

'Move "Predicted Closing Date" edit box to centre

oXPlaneItem = oForm.Items.Item("13")

oItem = oForm.Items.Item("12")

With oItem

.Left = oXPlaneItem.Left + oXPlaneItem.Width

.Top = oXPlaneItem.Top

End With

'Move "Document Date" EditBox Always equal server date

oXPlaneItem = oForm.Items.Item("85")

oYPlaneItem = oForm.Items.Item("12")

oItem = oForm.Items.Item("46")

With oItem

.Height = oYPlaneItem.Height

.Width = oYPlaneItem.Width

.Left = oYPlaneItem.Left

.Top = oXPlaneItem.Top

End With

oEdit = oItem.Specific

oEdit.String = oApp.Company.ServerDate

This works for User defined edit boxes if the databind is definded.

Is it possible to acheive what I am trying to do? At present the dit box constaly reads what is in the table and does update to the server date.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

David,

your code seems to be ok, the question is, in which event you execute this code.

But, you can do this easier - the label you may rename with ctrl+dbl click on it and the date of last changes you may find from changes protocol for the current sales quotation and show it to the form with formatted search as select from protocol where date is max from existing dates.

Answers (2)

Answers (2)

Former Member
0 Kudos

Right I've got the problem wrong....

Its nothing to do with user defined fields.....

When the entry is first added it allows the server date string to populate in the edit box, but if an entry is to be updated, when the form loads the edit box does not populate with the new date.

The only other "naff" way of doing it is to do an sql query to update the table entry but then the field may become "Last Viewed" as opposed to "Last updated"

Any Ideas?

Former Member
0 Kudos

David,

the last changed date you may find from changes protocol fro this document. You can receive it to main form with sql query.

Former Member
0 Kudos

I don't think it where the data comes from that is the problem, it is as someone mention before the event in which I perform the data equality.

What I am trying to do now is recognise the formmode and "update button" click then perform an sql query to update the table itself as SDK is becoming more limited everyday.

I take it no one has tried something like this yet?

Former Member
0 Kudos

Hi,

Thanks for your reply.

I'm performing this on form load at present, so that if any chages are made they are with the Last Updated field already populated. The trouble is that once data is in there I cannot adjust it uing sdk code. I have deleting and adding etc etc. It just seems to be because it is an editbox already on the form and not a user defined editbox.

Dave.