recSalesLine.INIT; recSalesLine.SETRANGE(recSalesLine.Atribuir, TRUE); IF NOT recSalesLine.FINDFIRST THEN ERROR('Não está qualquer linha seleccionada'); REPEAT RecItem.RESET; RecItem.SETRANGE("No.", "No."); IF RecItem.FINDFIRST THEN BEGIN MESSAGE('%1', RecItem."No."); RecExtra.RESET; //RecExtra.SETRANGE(Tabela, RecExtra.Tabela::LCM); RecExtra.SETRANGE("No. Computador", RecItem."No." + '#'); END; RecCarp.RESET; RecCarp.SETRANGE("Data Registo", TODAY); RecCarp.SETRANGE("Sales No.", recSalesLine."Document No."); RecCarp.SETRANGE("Sales Line No.", recSalesLine."Line No."); RecCarp.SETRANGE("Tipo Operação", "Tipo Operação"::Construção); RecCarp.SETRANGE("No.", recSalesLine."No."); RecCarp.SETRANGE("No. Equipamento", RecExtra.Code); IF RecCarp.FINDFIRST THEN ERROR('O Equipamento encontra-se já em fase de produção da Carpintaria.'); //Rec.INIT; RecCarp."Data Registo":= TODAY; RecCarp."Sales No." := recSalesLine."Document No."; RecCarp."Sales Line No." := recSalesLine."Line No."; RecCarp."No.":=recSalesLine."No."; RecCarp."No. Molde" := recSalesLine."Nº Molde"; RecCarp.Quantity:=recSalesLine.Quantity; RecCarp."Delivery Date":= recSalesLine."Planned Delivery Date"; RecCarp.Estado := Estado::Lançar; RecCarp."Tipo Operação" := "Tipo Operação"::Construção; RecCarp."Sistema Moldação" := recSalesLine."Local de Producao"; IF RecExtra.FINDFIRST THEN RecCarp."No. Equipamento" := RecExtra.Code; RecCarp.INSERT; // MESSAGE('%1', RecCarp."No. Equipamento"); recSalesLine.Atribuir := FALSE; recSalesLine.MODIFY; // recSalesLine.NEXT; UNTIL recSalesLine.NEXT = 0;
Comments
are you sure you have value in RecExtra.Code?
Put a message after
IF RecExtra.FINDFIRST THEN
Message('%1',RecExtra.Code);
to check whether you got right record or not..
if not check where you are filtering RecExtra..
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
What does it do?
I never used this kind of code :-k
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
or simply put messages and check where the value is missing..
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
The thing is, I tried to transfer 7 lines, and only the first 2 had the "No. Equipamento", the rest were empty. What am I missing?