yzhums Sorry, I did not do a good job explaining!
In my Sales Header tableextension, I have the following code:
field(50101; "MyPOFlowfield"; Text[50])
{
Caption = 'Flow PO #:';
FieldClass = FlowField;
CalcFormula = lookup("Sales Line"."Purchase Order No." where("Document No." = field("No.")));
}
I also have a PageExtension for the sales order, to display this value, and can see this value on the sales order. That part works! What I cannot figure out is how to transfer this value to the sales invoice once it's been posted. I have a TableExtension for the sales invoice, declaring a blank field in which I can put my new value, seen here:
field(50101; "MyPOFlowfield"; Text[50]) // Note this is not a flowfield, just a normal field.
{
Caption = 'Flow PO #:';
DataClassification = ToBeClassified;
}
I have attempted to directly assign the Sales Invoice field the value of the Sales Header flowfield, but it doesn't seem to work. Here is that code in the sales order PageExtension:
actions
{
modify(Post)
{
trigger OnAfterAction()
var
SalesInvoiceRecord1: Record "Sales Invoice Header";
begin
SalesInvoiceRecord1."MyPOFlowfield" := Rec."MyPOFlowfield";
end;
}
}
I think it does not work because either A) the flowfield is deleted after posting or B) because I cannot assign a flowfield calculated value to a "normal" value? I am not sure which. I've been trying for hours, if you would be able to help I'd be very grateful..