I’ve been looking for an example I can follow to put a Button in my customization that adds a new record. I have the button but don’t see anything related to new record. If I find the object in the object explorer I then need to convert it to C# from the VB example. What object should I look at using? My customization is using a UD10 table.
Are you working directly on a UD10 Customization or has the UD10 table been setup as a Child table?
I’m using the table directly.
private void btnNewUD10_Click(object sender, System.EventArgs args)
{
// ** Place Event Handling Code Here **
oTrans.GetNewUD10Record();
}
Error: CS1061 - line 65 (616) - ‘Ice.UI.App.UD10Entry.Transaction’ does not contain a definition for ‘GetNewUD10Record’ and no extension method ‘GetNewUD10Record’ accepting a first argument of type ‘Ice.UI.App.UD10Entry.Transaction’ could be found (are you missing a using directive or an assembly reference?)
Are u using the UD10 form? it already have the new record on top…
Or another form where you want to use UD10 records, if the latter you should use the wizard to add ud10 as a child, it then copies all the necessary code to add, delete, etc… ) But if the child link is not what you want, just remove the code pertaining to this functionality…
Sorry, copied from child table customization.
Method should be oTrans.GetNew() according to Object Explorer.
The form doesn’t always have a record in it when I want to create a new record and select the button. I can select new in the corner but I want to do other things as well with the button afterwards. The error is when I test the code in the script window.
You could catch the EpiViewNotification event of the UD10 EpiDataView?
On NotifyType.AddRow
do your stuff…
Pierre
Okay I managed to get it.
It is simpler than I expected.
private void epiButtonC1_Click(object sender, System.EventArgs args)
{
// ** Place Event Handling Code Here **
oTrans.GetNew();
}