In questo articolo si applica a Microsoft Dynamics NAV per tutte le lingue.
Sintomi
In Microsoft Dynamics NAV, quando si tenta di creare un ordine di vendita in valuta estera se la Data di registrazione predefinito è impostato su "Nessuna data," Impossibile convalidare il tasso di cambio. Di conseguenza, viene visualizzato il seguente messaggio di errore:
Vi è alcun tasso di cambio valuta all'interno del filtro.
Inoltre, è possibile stampare il report di conferma dell'ordine (205).
Questo problema si verifica nei seguenti prodotti:
-
Microsoft Dynamics NAV 2009 Service Pack 1 (SP1)
-
Microsoft Dynamics NAV 2009 R2
Risoluzione
Informazioni sull'hotfix
Un hotfix supportato è ora disponibile da Microsoft. Tuttavia, è destinato esclusivamente alla risoluzione del problema descritto in questo articolo. Applicarlo solo ai sistemi in cui si verificano questo problema specifico. Questo hotfix potrebbe essere sottoposto ad ulteriori test. Pertanto, se il problema non causa gravi difficoltà, consiglia di attendere il prossimo service pack di Microsoft Dynamics NAV 2009 o versione successiva di Microsoft Dynamics NAV contenente tale hotfix.
Nota: In casi particolari, le spese normalmente addebitate per le chiamate potrebbero essere annullate qualora un aggiornamento del supporto tecnico di Microsoft Dynamics e prodotti correlati di supporto determina che uno specifico aggiornamento risolverà il problema. I costi di supporto normale verranno applicati per eventuali ulteriori domande e problemi che non dovessero rientrare nello specifico aggiornamento in questione.
Informazioni sull'installazione
Microsoft fornisce esempi di programmazione a scopo puramente illustrativo, senza alcuna garanzia espressa o implicita. Ciò include, ma non limitato a, le garanzie implicite di commerciabilità o idoneità per uno scopo particolare. In questo articolo si presuppone che si abbia familiarità con il linguaggio di programmazione in questione e gli strumenti utilizzati per creare ed eseguire la procedura di debug. I tecnici del supporto Microsoft possono spiegare la funzionalità di una particolare procedura, ma in nessun caso possono modificare questi esempi per fornire funzionalità aggiuntive o creare procedure atte a soddisfare specifiche esigenze.
Nota: Prima di installare questo hotfix, verificare che tutti gli utenti di client Microsoft Navision siano disconnessi dal sistema. Include gli utenti client Microsoft Navision Application Services (NAS). Dovrebbe essere il solo l'utente client connesso quando si implementa questo hotfix.
Per implementare questo hotfix, è necessario disporre di una licenza di sviluppatore.
È consigliabile che l'account utente nella finestra Login Windows o Login Database assegnare l'ID di ruolo "SUPER". Se l'account utente non può essere assegnato l'ID ruolo "SUPER", è necessario verificare che l'account utente disponga delle autorizzazioni seguenti:
-
Autorizzazione alla modifica dell'oggetto che si desidera modificare.
-
L'autorizzazione di esecuzione per l'oggetto System Object ID 5210 e object ID 9015 oggetto di sistema .
Nota: Non è necessario disporre dei diritti per gli archivi dati a meno che non è necessario eseguire il ripristino di dati.
Modifiche al codice
Nota: Sempre il codice di test consente di correggere in un ambiente controllato prima di applicare le correzioni per i computer di produzione.
Per risolvere questo problema, attenersi alla seguente procedura:
-
Modificare il codice nella funzione SalesHeaderExchDate della codeunit Gest Calcola prezzo di vendita (7000) come segue:
Codice esistente...WITH SalesHeader DO BEGIN
// Delete the following lines.
IF ("Document Type" IN ["Document Type"::"Blanket Order","Document Type"::Quote]) AND
("Posting Date" = 0D)
THEN
EXIT(WORKDATE);
EXIT("Posting Date");
// End of the deleted lines.
END;
...Codice di sostituzione
...WITH SalesHeader DO BEGIN
// Add the following lines.
IF "Posting Date" <>0D THEN
EXIT("Posting Date");
EXIT(WORKDATE);
// End of the added lines.
END;
... -
Modificare il codice nella funzione PurchHeaderExchDate di Acq. Prezzo Gest Calc codeunit (7010) come segue:
Codice esistente...WITH PurchHeader DO BEGIN
// Delete the following lines.
IF ("Document Type" IN ["Document Type"::"Blanket Order","Document Type"::Quote]) AND
("Posting Date" = 0D)
THEN
EXIT(WORKDATE);
EXIT("Posting Date");
// End of the deleted lines.
END;
...Codice di sostituzione
...WITH PurchHeader DO BEGIN
// Add the following lines.
IF "Posting Date" <> 0D THEN
EXIT("Posting Date");
EXIT(WORKDATE);
// End of the added lines.
END;
... -
Modificare il codice del trigger OnAssistEdit nel campo Codice valuta (111) nel modulo dell'Ordine di vendita (42) come segue:
Codice esistente...CLEAR(ChangeExchangeRate);
// Delete the following line.
ChangeExchangeRate.SetParameter("Currency Code","Currency Factor","Posting Date");
// End of the deleted line.
IF ChangeExchangeRate.RUNMODAL = ACTION::OK THEN BEGIN
VALIDATE("Currency Factor",ChangeExchangeRate.GetParameter);
CurrForm.UPDATE;
END;
CLEAR(ChangeExchangeRate);
...Codice di sostituzione
...CLEAR(ChangeExchangeRate);
// Add the following lines.
IF "Posting Date" <> 0D THEN
ChangeExchangeRate.SetParameter("Currency Code","Currency Factor","Posting Date")
ELSE
ChangeExchangeRate.SetParameter("Currency Code","Currency Factor",WORKDATE);
// End of the added lines.
IF ChangeExchangeRate.RUNMODAL = ACTION::OK THEN BEGIN
VALIDATE("Currency Factor",ChangeExchangeRate.GetParameter);
CurrForm.UPDATE;
END;
CLEAR(ChangeExchangeRate);
... -
Modificare il codice del trigger OnAssistEdit nel campo Codice valuta (107) nel modulo della Fattura di vendita (43) come segue:
Codice esistente...CLEAR(ChangeExchangeRate);
// Delete the following line.
ChangeExchangeRate.SetParameter("Currency Code","Currency Factor","Posting Date");
// End of the deleted line.
IF ChangeExchangeRate.RUNMODAL = ACTION::OK THEN BEGIN
VALIDATE("Currency Factor",ChangeExchangeRate.GetParameter);
CurrForm.UPDATE;
END;
CLEAR(ChangeExchangeRate);
...Codice di sostituzione
...CLEAR(ChangeExchangeRate);
// Add the following lines.
IF "Posting Date" <> 0D THEN
ChangeExchangeRate.SetParameter("Currency Code","Currency Factor","Posting Date")
ELSE
ChangeExchangeRate.SetParameter("Currency Code","Currency Factor",WORKDATE);
// End of the added lines.
IF ChangeExchangeRate.RUNMODAL = ACTION::OK THEN BEGIN
VALIDATE("Currency Factor",ChangeExchangeRate.GetParameter);
CurrForm.UPDATE;
END;
CLEAR(ChangeExchangeRate);
... -
Modificare il codice del trigger OnAssistEdit nel campo Codice valuta (91) del modulo di Nota credito vendita (44) come segue:
Codice esistente...CLEAR(ChangeExchangeRate);
// Delete the following line.
ChangeExchangeRate.SetParameter("Currency Code","Currency Factor","Posting Date");
// End of the deleted line.
IF ChangeExchangeRate.RUNMODAL = ACTION::OK THEN BEGIN
VALIDATE("Currency Factor",ChangeExchangeRate.GetParameter);
CurrForm.UPDATE;
END;
CLEAR(ChangeExchangeRate);
...Codice di sostituzione
...CLEAR(ChangeExchangeRate);
// Add the following lines.
IF "Posting Date" <> 0D THEN
ChangeExchangeRate.SetParameter("Currency Code","Currency Factor","Posting Date")
ELSE
ChangeExchangeRate.SetParameter("Currency Code","Currency Factor",WORKDATE);
// End of the added lines
IF ChangeExchangeRate.RUNMODAL = ACTION::OK THEN BEGIN
VALIDATE("Currency Factor",ChangeExchangeRate.GetParameter);
CurrForm.UPDATE;
END;
CLEAR(ChangeExchangeRate);
... -
Modificare il codice del trigger OnAssistEdit nel campo Codice valuta (119) nel modulo dell'Ordine di acquisto (50) come segue:
Codice esistente...CLEAR(ChangeExchangeRate);
// Delete the following line.
ChangeExchangeRate.SetParameter("Currency Code","Currency Factor","Posting Date");
// End of the deleted line.
IF ChangeExchangeRate.RUNMODAL = ACTION::OK THEN BEGIN
VALIDATE("Currency Factor",ChangeExchangeRate.GetParameter);
CurrForm.UPDATE;
END;
CLEAR(ChangeExchangeRate);
...Codice di sostituzione
...CLEAR(ChangeExchangeRate);
// Add the following lines.
IF "Posting Date" <> 0D THEN
ChangeExchangeRate.SetParameter("Currency Code","Currency Factor","Posting Date")
ELSE
ChangeExchangeRate.SetParameter("Currency Code","Currency Factor",WORKDATE);
// End of the added lines.
IF ChangeExchangeRate.RUNMODAL = ACTION::OK THEN BEGIN
VALIDATE("Currency Factor",ChangeExchangeRate.GetParameter);
CurrForm.UPDATE;
END;
CLEAR(ChangeExchangeRate);
... -
Modificare il codice del trigger OnAssistEdit nel campo Codice valuta (104) nel modulo della Fattura di acquisto (51) come segue:
Codice esistente...CLEAR(ChangeExchangeRate);
// Delete the following line.
ChangeExchangeRate.SetParameter("Currency Code","Currency Factor","Posting Date");
// End of the deleted line.
IF ChangeExchangeRate.RUNMODAL = ACTION::OK THEN BEGIN
VALIDATE("Currency Factor",ChangeExchangeRate.GetParameter);
CurrForm.UPDATE;
END;
CLEAR(ChangeExchangeRate);
...Codice di sostituzione
...CLEAR(ChangeExchangeRate);
// Add the following lines.
IF "Posting Date" <> 0D THEN
ChangeExchangeRate.SetParameter("Currency Code","Currency Factor","Posting Date")
ELSE
ChangeExchangeRate.SetParameter("Currency Code","Currency Factor",WORKDATE);
// End of the added lines.
IF ChangeExchangeRate.RUNMODAL = ACTION::OK THEN BEGIN
VALIDATE("Currency Factor",ChangeExchangeRate.GetParameter);
CurrForm.UPDATE;
END;
CLEAR(ChangeExchangeRate);
... -
Modificare il codice del trigger OnAssistEdit nel campo Codice valuta (91) del modulo di Nota di credito (52) come segue:
Codice esistente...CLEAR(ChangeExchangeRate);
// Delete the following line.
ChangeExchangeRate.SetParameter("Currency Code","Currency Factor","Posting Date");
// End of the deleted line.
IF ChangeExchangeRate.RUNMODAL = ACTION::OK THEN BEGIN
VALIDATE("Currency Factor",ChangeExchangeRate.GetParameter);
CurrForm.UPDATE;
END;
CLEAR(ChangeExchangeRate);
...Codice di sostituzione
...CLEAR(ChangeExchangeRate);
// Add the following lines.
IF "Posting Date" <> 0D THEN
ChangeExchangeRate.SetParameter("Currency Code","Currency Factor","Posting Date")
ELSE
ChangeExchangeRate.SetParameter("Currency Code","Currency Factor",WORKDATE);
// End of the added lines.
IF ChangeExchangeRate.RUNMODAL = ACTION::OK THEN BEGIN
VALIDATE("Currency Factor",ChangeExchangeRate.GetParameter);
CurrForm.UPDATE;
END;
CLEAR(ChangeExchangeRate);
... -
Modificare il codice del trigger OnAssistEdit nel campo Codice valuta (91) nel modulo Ordine di reso vendita (6630) come segue:
Codice esistente...CLEAR(ChangeExchangeRate);
// Delete the following line.
ChangeExchangeRate.SetParameter("Currency Code","Currency Factor","Posting Date");
// End of the deleted line.
IF ChangeExchangeRate.RUNMODAL = ACTION::OK THEN BEGIN
VALIDATE("Currency Factor",ChangeExchangeRate.GetParameter);
CurrForm.UPDATE;
END;
CLEAR(ChangeExchangeRate);
...Codice di sostituzione
...CLEAR(ChangeExchangeRate);
// Add the following lines.
IF "Posting Date" <> 0D THEN
ChangeExchangeRate.SetParameter("Currency Code","Currency Factor","Posting Date")
ELSE
ChangeExchangeRate.SetParameter("Currency Code","Currency Factor",WORKDATE);
// End of the added lines.
IF ChangeExchangeRate.RUNMODAL = ACTION::OK THEN BEGIN
VALIDATE("Currency Factor",ChangeExchangeRate.GetParameter);
CurrForm.UPDATE;
END;
CLEAR(ChangeExchangeRate);
... -
Modificare il codice del trigger OnAssistEdit nel campo Codice valuta (91) nel modulo Ordine di reso acquisto (6640) come segue:
Codice esistente...CLEAR(ChangeExchangeRate);
// Delete the following line.
ChangeExchangeRate.SetParameter("Currency Code","Currency Factor","Posting Date");
// End of the deleted line.
IF ChangeExchangeRate.RUNMODAL = ACTION::OK THEN BEGIN
VALIDATE("Currency Factor",ChangeExchangeRate.GetParameter);
CurrForm.UPDATE;
END;
CLEAR(ChangeExchangeRate);
...Codice di sostituzione
...CLEAR(ChangeExchangeRate);
// Add the following lines.
IF "Posting Date" <> 0D THEN
ChangeExchangeRate.SetParameter("Currency Code","Currency Factor","Posting Date")
ELSE
ChangeExchangeRate.SetParameter("Currency Code","Currency Factor",WORKDATE);
// End of the added lines.
IF ChangeExchangeRate.RUNMODAL = ACTION::OK THEN BEGIN
VALIDATE("Currency Factor",ChangeExchangeRate.GetParameter);
CurrForm.UPDATE;
END;
CLEAR(ChangeExchangeRate);
... -
Modificare il codice della funzione UpdateCurrencyFactor nella tabella Testata vendita (36) come segue:
Codice esistente...IF "Currency Code" <>'' THEN BEGIN
// Delete the following lines.
IF ("Document Type" IN ["Document Type"::Quote,"Document Type"::"Blanket Order"]) AND
("Posting Date" = 0D)
THEN
CurrencyDate := WORKDATE
ELSE
CurrencyDate := "Posting Date";
// End of the deleted lines.
"Currency Factor" := CurrExchRate.ExchangeRate(CurrencyDate,"Currency Code");
END ELSE
"Currency Factor" := 0;
...Codice di sostituzione
...IF "Currency Code" <> '' THEN BEGIN
// Add the following lines.
IF "Posting Date" <> 0D THEN
CurrencyDate := "Posting Date"
ELSE
CurrencyDate := WORKDATE;
// End of the added lines.
"Currency Factor" := CurrExchRate.ExchangeRate(CurrencyDate,"Currency Code");
END ELSE
"Currency Factor" := 0;
... -
Modificare il codice della funzione GetDate nella tabella Riga di vendita (37) come segue:
Codice esistente...// Delete the following lines.
IF ("Document Type" IN ["Document Type"::"Blanket Order","Document Type"::Quote]) AND
(SalesHeader."Posting Date" = 0D)
THEN
EXIT(WORKDATE);
EXIT(SalesHeader."Posting Date");
// End of the deleted lines.
...Codice di sostituzione
...// Add the following lines.
IF SalesHeader."Posting Date" <> 0D THEN
EXIT(SalesHeader."Posting Date");
EXIT(WORKDATE);
// End of the added lines.
... -
Modificare il codice della funzione UpdateCurrencyFactor nella tabella Testate Acquisti (38) come segue:
Codice esistente...IF "Currency Code" <> '' THEN BEGIN
// Delete the following lines.
IF ("Document Type" IN ["Document Type"::Quote,"Document Type"::"Blanket Order"]) AND
("Posting Date" = 0D)
THEN
CurrencyDate := WORKDATE
ELSE
CurrencyDate := "Posting Date";
// End of the deleted lines.
"Currency Factor" := CurrExchRate.ExchangeRate(CurrencyDate,"Currency Code");
END ELSE
"Currency Factor" := 0;
...Codice di sostituzione
...IF "Currency Code"<>'' THEN BEGIN
// Add the following lines.
IF "Posting Date" <> 0D THEN
CurrencyDate := "Posting Date"
ELSE
CurrencyDate := WORKDATE;
// End of the added lines.
"Currency Factor" := CurrExchRate.ExchangeRate(CurrencyDate,"Currency Code");
END ELSE
"Currency Factor" := 0;
... -
Modificare il codice della funzione GetDate nella tabella Righe acquisto (39) come segue:
Codice esistente...// Delete the following lines.
IF ("Document Type" IN ["Document Type"::"Blanket Order","Document Type"::Quote]) AND
(PurchHeader."Posting Date" = 0D)
THEN
EXIT(WORKDATE);
EXIT(PurchHeader."Posting Date")
// End of the deleted lines.
...Codice di sostituzione
...// Add the following lines.
IF PurchHeader."Posting Date"<>0D THEN
EXIT(PurchHeader."Posting Date");
EXIT(WORKDATE);
// End of the added lines.
... -
Modificare il codice nella funzione RoundAmount della codeunit Vendite-registra (80) come segue:
Codice esistente...IF SalesHeader."Currency Code" <>'' THEN BEGIN
// Delete the following lines.
IF ("Document Type" IN ["Document Type"::"Blanket Order","Document Type"::Quote]) AND
(SalesHeader."Posting Date" = 0D)
THEN
// End of the deleted lines.
UseDate := WORKDATE
ELSE
UseDate := SalesHeader."Posting Date";
...Codice di sostituzione
...IF SalesHeader."Currency Code" <>'' THEN BEGIN
// Add the following line.
IF (SalesHeader."Posting Date" = 0D) THEN
// End of the added line.
UseDate := WORKDATE
ELSE
UseDate := SalesHeader."Posting Date";
... -
Modificare il codice nella funzione RoundAmount di Acq.-Post codeunit (90) come segue:
Codice esistente...IF PurchHeader."Currency Code" <>'' THEN BEGIN
// Delete the following lines.
IF ("Document Type" IN ["Document Type"::"Blanket Order","Document Type"::Quote]) AND
(PurchHeader."Posting Date" = 0D)
THEN
// End of the deleted lines.
Usedate := WORKDATE
ELSE
Usedate := PurchHeader."Posting Date";
...Codice di sostituzione
...IF PurchHeader."Currency Code"<> '' THEN BEGIN
// Add the following line.
IF (PurchHeader."Posting Date" = 0D) THEN
// End of the added line.
Usedate := WORKDATE
ELSE
Usedate := PurchHeader."Posting Date";
... -
Modificare il codice nella funzione UpdateHeaderInfo nel modulo Statistiche ordini vendita (402) come segue:
Codice esistente...IF "Prices Including VAT" THEN
TotalSalesLineLCY[IndexNo].Amount := TotalAmount2[IndexNo]
ELSE
TotalSalesLineLCY[IndexNo].Amount := TotalAmount1[IndexNo];
IF "Currency Code" <> '' THEN
// Delete the following lines.
IF ("Document Type" IN ["Document Type"::"Blanket Order","Document Type"::Quote]) AND
("Posting Date" = 0D)
THEN
// End of the deleted lines.
UseDate := WORKDATE
ELSE
UseDate := "Posting Date";
...Codice di sostituzione
...IF "Prices Including VAT" THEN
TotalSalesLineLCY[IndexNo].Amount := TotalAmount2[IndexNo]
ELSE
TotalSalesLineLCY[IndexNo].Amount := TotalAmount1[IndexNo];
IF "Currency Code" <>'' THEN
// Add the following line.
IF "Posting Date" = 0D THEN
// End of the added line.
UseDate := WORKDATE
ELSE
UseDate := "Posting Date";
... -
Modificare il codice nella funzione UpdateHeaderInfo nel modulo Statistiche acquisto ordine (403) come segue:
Codice esistente...IF "Prices Including VAT" THEN
TotalPurchLineLCY[IndexNo].Amount := TotalAmount2[IndexNo]
ELSE
TotalPurchLineLCY[IndexNo].Amount := TotalAmount1[IndexNo];
IF "Currency Code" <> '' THEN BEGIN
// Delete the following lines.
IF ("Document Type" IN ["Document Type"::"Blanket Order","Document Type"::Quote]) AND
("Posting Date" = 0D)
THEN
// End of the deleted lines.
UseDate := WORKDATE
ELSE
UseDate := "Posting Date";
...Codice di sostituzione
...IF "Prices Including VAT" THEN
TotalPurchLineLCY[IndexNo].Amount := TotalAmount2[IndexNo]
ELSE
TotalPurchLineLCY[IndexNo].Amount := TotalAmount1[IndexNo];
IF "Currency Code" <> '' THEN BEGIN
// Add the following line.
IF "Posting Date" = 0D THEN
// End of the added line.
UseDate := WORKDATE
ELSE
UseDate := "Posting Date";
... -
Modificare il codice nella funzione CalculateInvoiceDiscount della codeunit Vendite-Calcola sconto (60) come segue:
Codice esistente...// Delete the following lines.
IF ("Document Type" IN ["Document Type"::"Blanket Order","Document Type"::Quote]) AND
(SalesHeader."Posting Date" = 0D)
THEN
// End of the deleted lines.
CurrencyDate := WORKDATE
ELSE
CurrencyDate := SalesHeader."Posting Date";
...Codice di sostituzione
...// Add the following line.
IF SalesHeader."Posting Date" = 0D THEN
// End of the added line.
CurrencyDate := WORKDATE
ELSE
CurrencyDate := SalesHeader."Posting Date";
... -
Modificare il codice nella funzione CalculateInvoiceDiscount di Acq.-Calc.Discount codeunit (70) come segue:
Codice esistente...// Delete the following lines.
IF ("Document Type" IN ["Document Type"::"Blanket Order","Document Type"::Quote]) AND
(PurchHeader."Posting Date" = 0D)
THEN
// End of the deleted lines.
CurrencyDate := WORKDATE
ELSE
CurrencyDate := PurchHeader."Posting Date";
...Codice di sostituzione
...// Add the following line.
IF PurchHeader."Posting Date" = 0D THEN
// End of the added line.
CurrencyDate := WORKDATE
ELSE
CurrencyDate := PurchHeader."Posting Date";
...
Prerequisiti
Deve avere uno dei seguenti prodotti per applicare questo hotfix:
-
Microsoft Dynamics NAV 2009 Service Pack 1 (SP1)
-
Microsoft Dynamics NAV 2009 R2
Informazioni sulla rimozione
Non è possibile rimuovere questo hotfix.
Stato
Microsoft ha confermato che questo è un problema dei prodotti Microsoft elencati nella sezione "Si applica a".
Riferimenti
VSTF DynamicsNAV SE: 237796, 245981, 254036
Nota: Si tratta di un articolo a "Pubblicazione Veloce" creato direttamente all'interno dell'organizzazione di supporto Microsoft. Le informazioni contenute nel presente documento sono fornite così come sono in risposta a problemi urgenti. Per la velocità in rendendo disponibili, i materiali possono includere errori tipografici e possono essere modificati in qualsiasi momento senza preavviso. Per altre considerazioni, vedere Condizioni di utilizzo .