Hello,
We have written a code to import briefcases using SDK .net version 9.
The import is working fine, but in my case the Matching Templates and Fields part is not working, and the result is that each new briefcase is creating duplicated templates and fields all the time.
I know that the part to handle this issue is inside the following piece of code
Case BriefcaseRequestType.MatchTemplates
But i have tried many options and I couldnt make it work.
Here you have my actual code for this section:
Case BriefcaseRequestType.MatchTemplates
Dim templates As System.Collections.ObjectModel.ReadOnlyCollection(Of BriefcaseTemplateInfo) = request.MatchTemplates
For Each temp As BriefcaseTemplateInfo In templates
Dim validtemps As Collections.IList = temp.GetValidMatches
Next
' MsgBox(templates.Count)
For i As Integer = 0 To templates.Count - 1
Dim template As BriefcaseTemplateInfo = templates.Item(i)
Dim validmatches As System.Collections.ObjectModel.ReadOnlyCollection(Of TemplateInfo) = template.GetValidMatches
For j As Integer = 0 To validmatches.Count - 1
Dim matchedTemp As TemplateInfo = validmatches.Item(j)
If matchedTemp.Name = "General" Then
template.MatchTemplate = matchedTemp <=== This is not valid
End If
Next
Next
Dim fields As Collections.IList = request.MatchFields
For k As Integer = 0 To fields.Count - 1
Dim ffield As BriefcaseFieldInfo = fields.Item(k)
Dim validfieldmatches As Collections.IList = ffield.ValidMatches
For l As Integer = 0 To validfieldmatches.Count - 1
'MsgBox(validfieldmatches.Item(l))
Dim matchedfield As FieldInfo = Field.GetInfo(validfieldmatches.Item(l), session)
If matchedfield.Name = "Branch" And ffield.Name = "Branch" Then
Field.MatchField = matchedfield <=== This is not valid
End If
Next
Next
request = imp.FinishedMatchingTemplates
Attached you have the entire solution.
Could anyone help?
Thank you very much in advance and best reagards,
Ignacio PdeA
BMB sal