Hi All
Working on an integration using CS where terms need to be synced from another source. There is an option set called paymenttermscode that contains these. Our system of record calls for payment term ID #1 to be "credit hold" and dynamics is "Net 30". Try as I might, I cannot get this change to stick.
Via the XRM toolbox SQL4CDS , I can see that ID#1 is Net 30. I cannot of course edit it there. I have wiped all uses of paymenttermscode to null. I visited each place it is referenced (account, contact, sales order, quote, invoice) and went into the option choice there. I cleaned them out leaving just 1, "Credit Hold" with value of 1.
Even though none of the forms seem to have other data listed, the stringmaps seems to keep all the old ones.
If I use c# code to insert it as #1 it fails saying it's already there - which it isn't via the web UI but IS via the string maps.
Dataverse.InsertOptionValue(serviceClient, "account", "paymenttermscode", 1, "Credit Hold");
Is there some weird hardcode on net30 as ID1? Has anyone been successful in doing anything like this? It's very frustrating.
Dataverse.InsertOptionValue(serviceClient, "account", "paymenttermscode", 1, "Credit Hold");
public static int? DeleteOptionValue(ServiceClient sc, string entityLogicalName, string attributeLogicalName, int value)
{
int? ret = null;
try
{
var deleteOptionValueRequest = new DeleteOptionValueRequest
{
EntityLogicalName = entityLogicalName,
AttributeLogicalName = attributeLogicalName,
Value = value,
};
var res = (DeleteOptionValueResponse)sc.Execute(deleteOptionValueRequest);
}
catch (Exception e)
{
Console.WriteLine(e);
}
return ret;
}