JmsWebDesign
unread,Mar 26, 2008, 12:49:39 PM3/26/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to AdWords API Forum
Basically I have two Functions that contain two different SOAP calls
that export data to two different tables in our backend system.
Basically what I want to happen is combine these two SOAP's into one
function so that I can make the first SOAP call wait for a response
and then determine whether to continue executing the code or to end
it. What is happening is we're sending an invoice in and it sends the
invoice header information first. If the invoice already exsist our
system will send a -1 as the response but as of now, it will continue
to the next function which will add the invoice detail information to
the invoice that is already in our system. We want for if our web
service returns a -1 for the function to end and not go on.... I'm not
100% sure what I'm talking about or if I'm just babbiling but it seems
that it is possilbe... Any help would be soo much appreciated. THANK
YOU!!
-Jerad
P.S- I will attach the two functions below just so you can have an
idea. Thanks again!
Function Mnfld_InvokeInvoiceHeaderAdd(bInter, bDebug)
Mnfld_InvokeInvoiceHeaderAdd = true
'Main_Page
' Details
' LineItem
If (currentObj.Variable("TYPE") <> "Main_Page") Then
Writelog "This action must be called at the Main_Page level"
Mnfld_InvokeInvoiceHeaderAdd = false
Exit function
End If
pVendorID = CurrentObj.FindChild("Vendor_Number").Text
pInvoiceDate = CurrentObj.FindChild("Invoice_Date").Text
pInvoiceNumber = CurrentObj.FindChild("Invoice_Number").Text
pInvoiceType = "C"
pDueDate = CurrentObj.FindChild("DueDate").Text
pInvoiceAmount = CurrentObj.FindChild("Invoice_Total").Text
pDiscountedAmount = CurrentObj.FindChild("Invoice_Total").Text
pState = CurrentObj.FindChild("Vendor_State").Text
pTermCode =
CurrentObj.FindChild("Details").GetChild(0).FindChild("TerminalCode").Text
On Error Resume Next
SOAPCaller.Call_MOCInvoiceHeaderAdd pVendorID, pInvoiceDate,
pInvoiceNumber, pInvoiceType, pDueDate, pInvoiceAmount,
pDiscountedAmount, _
pState, pTermCode
If Err.number <> 0 Then
Writelog "Error in InvokeInvoiceHeaderAdd : " &
Err.Description
Err.Clear
Mnfld_InvokeInvoiceHeaderAdd_Page = false
End If
End Function
Function Mnfld_InvokeInvoiceDetailAdd(bInter, bDebug)
Mnfld_InvokeInvoiceDetailAdd = true
'Main_Page
' DEtails
' LineItem
'If (currentObj.Variable("TYPE") <> "LineItem") Then
' Writelog "This action must be called at the LineItem field
level"
' Mnfld_InvokeInvoiceDetailAdd = false
' Exit function
'End If
pVendorID =
CurrentObj.Parent.Parent.FindChild("Vendor_Number").Text
pInvoiceDate =
CurrentObj.Parent.Parent.FindChild("Invoice_Date").Text
pInvoiceNumber =
CurrentObj.Parent.Parent.FindChild("Invoice_Number").Text
pProduct = "FRT"
pUnitCost = CurrentObj.FindChild("Price").Text
pGrossGallons = CurrentObj.FindChild("Gross_Gallons").Text
pNetGallons = CurrentObj.FindChild("Gross_Gallons").Text
pExtendedAmount = CurrentObj.FindChild("LineTotal").Text
pDiscountedUnitCost = CurrentObj.FindChild("Price").Text
pDiscountedExtAmount = currentobj.FindChild("LineTotal").Text
pShipDate = CurrentObj.FindChild("Date_Shipped").Text
pState = CurrentObj.Parent.Parent.FindChild("Vendor_State").Text
pTermCode = CurrentObj.FindChild("Terminal").Text
pBOLNumber = CurrentObj.FindChild("BOL_Number").Text
On Error Resume Next
SOAPCaller.Call_MOCInvoiceDetailAdd pVendorID, pInvoiceDate,
pInvoiceNumber, pProduct, pUnitCost, pGrossGallons, pNetGallons,
pExtendedAmount, _
pDiscountedUnitCost,
pDiscountedExtAmount, pShipDate, pState, pTermCode, pBOLNumber
If Err.number <> 0 Then
Writelog "Error in InvokeInvoiceDeatilAdd : " &
Err.Description
Err.Clear
Mnfld_InvokeInvoiceDetailAdd = false
End If
End Function