I am trying to import trade journals using OpenSalesPriceJournalLine
I understand I need to create a OpenTradeAgreementJournalHeaderV2 for my headers but I am getting exceptions when trying to create it.
The code below returns an exception " A null value was found for the property named 'JournalNumber', which has the expected type 'Edm.String[Nullable=False"
var header = new OpenTradeAgreementJournalHeaderV2()
{
DataAreaId = dataAreaId,
};
context.AddToOpenTradeAgreementJournalHeadersV2(header);
var headerResponse = context.SaveChanges();
Does anyone know why would I need to enter a journal number when I am trying to create a journal header and journal lines?
If I have to supply one myself from the third party app won't I risk creating two identical journal numbers?
If I do supply a Journal Number I get the following exception returned
TradeOpenTradeAgreementJournalHeaderV2Entity' for the following fields: JournalNumber, TradeAgreementJournalNameId. Infolog: Warning: Field 'Price/discount journal number' does not allow editing.; Warning: Invalid specification of Price/discount journal number; Warning: Number sequence Sale_306 does not allow change to a higher number.; Warning: Field 'Name' must be filled in.
Im confused about what this means, shouldn't D365 be creating journal numbers when the journal is created, like in Ax2012?