My service is to create a customer So if my requestContractClass has this:
[DataMemberAttribute]
public DirPartyType DirPartyType(DirPartyType _dirPartyType = dirPartyType)
{
dirPartyType = _dirPartyType;
return dirPartyType;
}
[DataMemberAttribute]
public int64 NameSequence(int64 _nameSequence = nameSequence)
{
nameSequence = _nameSequence;
return nameSequence;
}
i want to pass dirPartyType and NameSequence
if in C# i do the following:
CallContext callContext = new CallContext { Company = "contoso" };
var request = new requestContract();
request.DirPartyType = "Person";
i will get an error that an enumDataMember should be added, is there a way to pass an enum in c# instead of hard coding because i can't add enumDataMember in D365
1. is the only way is to make my request of type str instead of DirPartyType and in the service class do str2enum?
if(str2Enum(DirPartyType::Person,contractRequest.DirPartyType()) == DirPartyType::Person)
{
custTable.insert(DirPartyType::Person,contractRequest.Name());
}
2. As for the nameSequence, u know in D365 it's a recId but it appears in the table as sth like "FirstMiddleLast" so how can i pass the value instead of recId when i insert in the dirPerson.