Sage MAS 90 and 200 Sage MAS 500 blogs Product Feedback Support Training
Reply
Sage MAS 90 Customer
rolandc
Posts: 95
Registered: 06-10-2010
0

Re: In PO entry need to verify that Vendor is the Primary vendor in Inventory Master

Sage Employee
jepritch
Posts: 233
Registered: 08-25-2009
0

Re: In PO entry need to verify that Vendor is the Primary vendor in Inventory Master

Roland, the big difference is that all SetWarning() does is set a warning flag for our objects and then in our code we issue the MessageBox().  The problem as you noted and is noted in the Scripting.doc that if we override the error message or return value you won't get this message.  We probably override this more often than not.

 

 

Elliott

Sage MAS 90 Customer
rolandc
Posts: 95
Registered: 06-10-2010
0

Re: In PO entry need to verify that Vendor is the Primary vendor in Inventory Master

Thanks Elliott!

Sage MAS 90 Customer
mroman98
Posts: 152
Registered: 04-05-2010
0

Re: In PO entry need to verify that Vendor is the Primary vendor in Inventory Master

Hi guys,

 

seems like the message works fine... it doesn't freeze up anymore....

my problem now is that i am not getting the VendorNo$ from the P/O Header.  I am getting a blank field.

The follwoing i the code that i am using...

 

ItemCode = ""
itemtype = ""
LineKey=""
oCIItem = 0
CIVendorNo = ""
POVendorNo = ""
retVal = 0

 

if oBusObj.EditState=2 then

 oItemSvc = oBusObj.GetChildHandle("ItemCode")
 if oItemSvc <> 0 then
  Set oItemSvc = oBusObj.AsObject(oItemSvc)
  
end If

retVal = oBusObj.GetValue("ItemType$", itemtype)
retVal = oBusObj.GetValue("ItemCode$", ItemCode)

 


rVal=0
rVal = oScript.DebugPrint("i am in")

 oCIItem = oSession.GetObject("CI_ItemCode_svc")
  
  if oCIItem then
  Set oCIItem = oScript.AsObject(oCIItem)
  retVal = oBusObj.GetValue("VendorNo$", POVendorNo)
  retVal = oCIItem.SetKeyValue("ItemCode$", ItemCode)
  retVal = oCIItem.Find()

if retVal then
    
retVal = oCIItem.GetValue("PrimaryVendorNo$", CIVendorNo)
retval = oCIItem.GetValue("ItemType$",itemtype)

 if itemtype = "1" then
rVal=0
rVal = oScript.DebugPrint(CIVendorNo)
rVal = oScript.DebugPrint(POVendorNo)

if  CIVendorNo<>POVendorNo then

strMsg = "P/O Vendor is not the Primary Vendor"
retVal = oSession.AsObject(oSession.UI).MessageBox("",strMsg)

end if
   end if
  end if
 end if
end if

 

I am using Column Pre-validate on Item Code

Do i need to do something else to get the VendorNo$ from the P/O Header?

 

Regards,

Manuel

Providex Developer
Sage Employee
jepritch
Posts: 233
Registered: 08-25-2009
0

Re: In PO entry need to verify that Vendor is the Primary vendor in Inventory Master

Manuel,

 

You are using the incorrect object handle, since the VendorNo$ is in the header object and not in the line detail, you should use the oHeaderObj handle.

 

retVal = oHeaderObj.GetValue("VendorNo$", POVendorNo)

 

 

HTH

Elliott

Sage MAS 90 Customer
mroman98
Posts: 152
Registered: 04-05-2010
0

Re: In PO entry need to verify that Vendor is the Primary vendor in Inventory Master

Thanks Elliott,

 

Totally missed that !!!!!

 

Regards,

Manuel

Providex Developer
Sage MAS 90 Customer
mroman98
Posts: 152
Registered: 04-05-2010
0

Re: In PO entry need to verify that Vendor is the Primary vendor in Inventory Master

Thanks, that worked !!!

 

Regards,

Manuel

Providex Developer