Skip to content
+1-888-319-3663

COMMUNITY FORUM

Update Freight Cost in Sales Pad Table with Secondary SQL Command Task – SmartConnect

Michael asked 4 months ago

I want to update table in Sales Pad to the add the Freight Cost after updating the GP tables with a SmartConnect Map and this requires me referencing the newly created Sales Document Number. I am using a secondary SQL task to try to do this, but I do not know how to reference the new Sales Document Number just created by the SmartConnect Map.

This is the code I have so far:


INSERT INTO [dbo].[spxSalesDocument]
([Sales_Doc_Num], [xFreightCost])
VALUES ( ‘GlobalRollingColumn’, _FreightCostforTotalOrder);

I am not sure if GlobalRollingColumn is correct to get the Sales_Doc_Num. I am also not sure if I should check the box that reads, “Update global variable with SQL command result?

Michael replied 4 months ago

Any help that anyone could provide would be greatly appreciated!

Michael replied 4 months ago

Any help that anyone could provide would be greatly appreciated!

Answers
Patrick Roth Staff answered 3 months ago

Michael,

I am not sure if GlobalRollingColumn is correct to get the Sales_Doc_Num.

If you use a GP Rolling Column to get the “next sop number” then yes.

I am also not sure if I should check the box that reads, “Update global variable with SQL command result?

Yes. If you do not, then the value would be empty.

patrick

Patrick Roth Staff replied 3 months ago

Actually, i misread the 2nd statement about the checkbox and global.

You are referencing the variable in the SQL Task itself and that SETS the global, it doesn’t use it. You don’t want/care about that.

Instead, the checkbox I was thinking of is on the GP Rolling Column itself there is a checkbox for “use for global variable” and that is the checkbox you want to mark.


If you would like to submit an answer or comment, please sign in to the eOne portal.