Part Revision Adapter

Hi guys

I am trying to do some customization into the Part Revision Form, and I need to use the adapter in order to add some data into the field “Character01” in the PartRevision Table, but I can’t find the correct adapter to do this.

I’ll appreciate any help.

Best Regards

If you do a trace on the action you want to imitate, the adapter and methods used should show.

Hi Chris

Thanks for your support, but I don’t follow you.

I was using the “after adapter” method, and I found in the case statment the event who triggers what I need, but I can’t realize how to modify the Character01 field into the PartRev table, so I was trying to use the EpiView in order to update this table, but unfurtunaly this view starts and infinite loop when the button “save” is pressed, so I tought to use an adapter in order to update the table but I don’t find which one I need to use, I don’t know if you want the piece of code that I’m using to achieve this

I need more info. Which method are you targeting on the after adapter method?

Perhaps you could just use an after field change for a specific field. The wizard will generate some examples on how to access diff fields in the relative dataview. You will have to save the record yourself if you want it autosaved < oTrans.Update() >

Hi Chris, thanks for your support!

This is the code:

Private Sub oTrans_adapter_AfterAdapterMethod(ByVal sender As Object, ByVal args As AfterAdapterMethodArgs)
’ ** Argument Properties and Uses **
’ ** args.MethodName **
’ ** Add Event Handler Code **

	' ** Use MessageBox to find adapter method name
	'EpiMessageBox.Show(args.MethodName)
	Select Case args.MethodName

		Case "GetNewPartRev"
			Dim txtParte As Control = csm.GetNativeControlReference("38e1671b-0c3f-4ab3-b8ab-95f26285f1d2")
			NoParte=txtParte.Text
			habilitarDALE()
			buscarVersionActualDALE(NoParte)
		
		Case "Update"
			guardarRevision()
		
		
	End Select

End Sub

private function guardarRevision()
Dim ParteRevView As EpiDataView = CType(oTrans.EpiDataViews(“PartRev”), EpiDataView)
ParteRevView.CurrentDataRow.BeginEdit()
ParteRevView.dataView(ParteRevView.Row)(“Character01”)=myValue
ParteRevView.CurrentDataRow.EndEdit()
oTrans.update()
end function

So, in oTrans.update() the system starts an infinite loop, in order to avoid that I would like to use an adapter, but I can’t find them, and I can’t bind some textbox to do this because then I need to save in other fields (number01, number02…) some values calculated in other methods.

Thank you again

Yes, because essentially you are saying When I Save -> Do Save which results in:
When save -> save -> When save -> save -> forever

Simply remove the oTrans.Update from the guardarRevision. If you use that function else where and it needs to save, I suggest passing a parameter to determine if it should perform a save.

void guardarRevision(bool Save)
{
… your code here …
if(Save) oTrans.Update();
}

Then just make sure when you call it from the “Update” method, you call it as guardarRevision(false);

Thanks Chris I’ll do it

Thanks for everything!

Best Regards