Page Index Toggle Pages: [1] 2  Send Topic Send Topic Print Print
Hot Topic (More than 10 Replies) xpost question (Read 3663 times)
FlipGilbert
Full Member
***
Offline


Running Ver 2.6.4

Posts: 236
Location: Sandy Eggo
Joined: Mar 8th, 2005
xpost question
Mar 5th, 2013 at 9:36pm
Print Post Print Post  
I have a database (Orders) that xposts to another database (inventory)
My question is there a way to @msg the user that is completing an orders form to be notified that someone is in the inventory form that is to be posted to?
I hope that makes sense
Thank you for your assistance.
flip
  

It's not what a man says that matters or how he says it, but what he does and how he does it.
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: xpost question
Reply #1 - Mar 5th, 2013 at 10:04pm
Print Post Print Post  
Hello Flip,

You can do this by using @XResultSetSearch(), @XResultSetLocked() and XResultSetValue() instead of using XPost().

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
FlipGilbert
Full Member
***
Offline


Running Ver 2.6.4

Posts: 236
Location: Sandy Eggo
Joined: Mar 8th, 2005
Re: xpost question
Reply #2 - Mar 26th, 2013 at 8:09pm
Print Post Print Post  
Hi Ray, I did read this, still trying to figure it out.....I understand the idea, just not quite how to write it.
  

It's not what a man says that matters or how he says it, but what he does and how he does it.
Back to top
 
IP Logged
 
lksseven
Full Member
***
Offline



Posts: 416
Location: Southwest
Joined: Jan 26th, 2009
Re: xpost question
Reply #3 - Mar 27th, 2013 at 3:32am
Print Post Print Post  
Flip,

Part of my sales order print/save routine is to post from the Orders record that I've just created/am saving to the sales order number (SONum), the sales order date (SODate), and the name of the person placing the order (Orderer) into three fields in that client's record in my Client database.  If that particular client record is locked by another user, the programming will writeln a message on the screen alerting the person inputting saving the Order.   Here is the relevant part of that code:

                  vRSdni = @XResultSetSearch(@FN, "Client", SEARCH_MODE_AND, SEARCH_SYNTAX_QA, "!ClientID=" + vClientID)
                  If vRSdni > -1
                         {
                           If @XResultSetTotal = 1      // if vRSdni consists of only one record
                                       {
                                          If @XResultSetLocked(vRSdni) = 0          // if this ClientID form is
                                                                                                 //  NOT locked, then post
                                                                                                 //  the data to the fields
                                           {
                                             XResultSetValue(vRSdni, "LastSONum", vSONum)
                                             XResultSetValue(vRSdni, "LastSODate", vSODate)
                                             XResultSetValue(vRSdni, "LastOrderer", vOrderer)
                                           }      // ends if vRSdni is not locked
                                             Else If @XResultSetLocked(vRSdni) = 1      // if this ClientID form
                                                                                                        // is currently locked
                                                                                                       //  by another user
                                                     {
                                                         Writeln(vSONum + "; " + vSODate + ";  weren't written
                                                                     to this client record because the client record
                                                                     is locked")
                                                     }

                                     }  // ends if @XResultSetTotal = 1

                          } // ends if vRSdni > -1
                      XResultSetClose(vRSdni)
  

Larry
Back to top
IP Logged
 
FlipGilbert
Full Member
***
Offline


Running Ver 2.6.4

Posts: 236
Location: Sandy Eggo
Joined: Mar 8th, 2005
Re: xpost question
Reply #4 - Apr 1st, 2013 at 3:54pm
Print Post Print Post  
Thank you Larry,
Very helpful in so many ways. I appreciate your input.
It is the same thing I'm trying to build into my database also.

Thank you all for your support!

  

It's not what a man says that matters or how he says it, but what he does and how he does it.
Back to top
 
IP Logged
 
FlipGilbert
Full Member
***
Offline


Running Ver 2.6.4

Posts: 236
Location: Sandy Eggo
Joined: Mar 8th, 2005
Re: xpost question
Reply #5 - May 14th, 2013 at 11:43pm
Print Post Print Post  
Not grasping the @XResultSetSearch idea.
The book shows alot of variables, loops, and optional arguments.
I'm looking for a specific form in a database to see if is unlocked.

vPartNo = "PartNumber"
vRSSinv = @XResultSetSearch(@FN, "Inventory", SEARCH_MODE_AND, SEARCH_SYNTAX_QA, "!InventoryFormPartNo=vPartNo")...?
Whats the field name? is that whats "in" the element?

If vRSSinv > -1
     {
           If @XResultSetTotal = 1      
                     {
                       If @XResultSetLocked(vRSSinv) = 0         
                                     {
                                             Xpost(@fn,brp_1,"Inventory!brp_no",Qty1,"Shopqty","SUB")
                                   Xpost(@fn,brp_1,"Inventory!brp_no",Qty1,"shopsales","ADD")
                                   Xpost(@fn,brp_1,"Inventory!brp_no",ListPrice1,"SalesShop","ADD")
                                        }
                       Else If @XResultSetLocked(vRSSinv) = 1      
                                     {
                                             Writeln("All The Inventory Items Have NOT Been Updated"; "An Invintory Item Record is Locked"; "Please Check Which Item was not posted and try again")
                                             }
                            }   
     } 

It will need to do this on each line item (which has a different part number) for a total of 14 times
I'm sooo confused, I'm not even sure if I am explaining it correctly anymore...
  

It's not what a man says that matters or how he says it, but what he does and how he does it.
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: xpost question
Reply #6 - May 15th, 2013 at 1:13pm
Print Post Print Post  
Hello Flip,

Looking at your other code I believe
Code
Select All
vPartNo = "PartNumber" 


will want to be
Code
Select All
vPartNo = brp_1 



then
Code
Select All
vRSSinv = @XResultSetSearch(@FN, "Inventory", SEARCH_MODE_AND, SEARCH_SYNTAX_QA, "!InventoryFormPartNo=vPartNo")...? 


will want to be
Code
Select All
vRSSinv = @XResultSetSearch(@FN, "Inventory", SEARCH_MODE_AND, SEARCH_SYNTAX_QA, "!brp_no=" + vPartNo)...? 



Then

Code
Select All
Var vRSSinv as Int

If vRSSinv > -1
{
	If @XResultSetTotal(vRSSinv) = 1
	{
		If @XResultSetLocked(vRSSinv) = 0
		{
			XResultSetValue(vRSSinv, "Shopqty", @TN(@XResultSetValue(vRSSinv, "Shopqty")) - Qty1)
			XResultSetValue(vRSSinv, "shopsales", @TN(@XResultSetValue(vRSSinv, "shopsales")) + Qty1)
			XResultSetValue(vRSSinv, "SalesShop", @TN(@XResultSetValue(vRSSinv, "SalesShop")) - ListPrice1)
		}
		Else
		{
			Writeln("All The Inventory Items Have NOT Been Updated"; "An Invintory Item Record is Locked"; "Please Check Which Item was not posted and try again")
		}
	}
	XResultSetClose(vRSSinv)
}
 



-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
FlipGilbert
Full Member
***
Offline


Running Ver 2.6.4

Posts: 236
Location: Sandy Eggo
Joined: Mar 8th, 2005
Re: xpost question
Reply #7 - May 22nd, 2013 at 5:52pm
Print Post Print Post  
Ray,
Thank you for your patients. I don't think i'm getting it because i'm not applying it correctly to my code.
Especially to the xpost at the end.... (banging my head on the keyboard)

This is my actual xpost code in a subroutine in Global Code. I'm thinking I dont close the XResultSetClose(vRSSinv) untill the very end?

Code
Select All
If (CallStatus = "COMPLETE") and (Not (JobType = "Estimate")) And (Not @IsBlank(qty1)) and (Not @IsBlank(brp_1)) and ((@IsBlank(Post1)) and (not @IsBlank(Location1)))
	{
		If Location1 = "Shop"
			{
				Xpost(@fn,brp_1,"Inventory!brp_no",Qty1,"Shopqty","SUB")
				Xpost(@fn,brp_1,"Inventory!brp_no",Qty1,"shopsales","ADD")
				Xpost(@fn,brp_1,"Inventory!brp_no",ListPrice1,"SalesShop","ADD")
			}
		Else If Location1 = "2-T"
			{
				Xpost(@fn,brp_1,"Inventory!brp_no",Qty1,"truck_2","SUB")
				Xpost(@fn,brp_1,"Inventory!brp_no",Qty1,"trk2sales","ADD")
				Xpost(@fn,brp_1,"Inventory!brp_no",ListPrice1,"Sales2","ADD")
			}
		Else If Location1 = "3-T"
			{
				Xpost(@fn,brp_1,"Inventory!brp_no",Qty1,"truck_3","SUB")
				Xpost(@fn,brp_1,"Inventory!brp_no",Qty1,"trk3sales","ADD")
				Xpost(@fn,brp_1,"Inventory!brp_no",ListPrice1,"Sales3","ADD")
			}
		Else If Location1 = "4-T"
			{
				Xpost(@fn,brp_1,"Inventory!brp_no",Qty1,"truck_4","SUB")
				Xpost(@fn,brp_1,"Inventory!brp_no",Qty1,"trk4sales","ADD")
				Xpost(@fn,brp_1,"Inventory!brp_no",ListPrice1,"Sales4","ADD")
			}
		Else If Location1 = "5-T"
			{
				Xpost(@fn,brp_1,"Inventory!brp_no",Qty1,"truck_5","SUB")
				Xpost(@fn,brp_1,"Inventory!brp_no",Qty1,"trk5sales","ADD")
				Xpost(@fn,brp_1,"Inventory!brp_no",ListPrice1,"Sales5","ADD")
			}
		Else If Location1 = "6-T"
			{
				Xpost(@fn,brp_1,"Inventory!brp_no",Qty1,"truck_6","SUB")
				Xpost(@fn,brp_1,"Inventory!brp_no",Qty1,"trk6sales","ADD")
				Xpost(@fn,brp_1,"Inventory!brp_no",ListPrice1,"Sales6","ADD")
			}
		Else If Location1 = "7-T"
			{
				Xpost(@fn,brp_1,"Inventory!brp_no",Qty1,"truck_7","SUB")
				Xpost(@fn,brp_1,"Inventory!brp_no",Qty1,"trk7sales","ADD")
				Xpost(@fn,brp_1,"Inventory!brp_no",ListPrice1,"Sales7","ADD")
			}
		Else If Location1 = "8-T"
			{
				Xpost(@fn,brp_1,"Inventory!brp_no",Qty1,"truck_8","SUB")
				Xpost(@fn,brp_1,"Inventory!brp_no",Qty1,"trk8sales","ADD")
				Xpost(@fn,brp_1,"Inventory!brp_no",ListPrice1,"Sales8","ADD")
			}
		Else If Location1 = "9-T"
			{
				Xpost(@fn,brp_1,"Inventory!brp_no",Qty1,"truck_9","SUB")
				Xpost(@fn,brp_1,"Inventory!brp_no",Qty1,"trk9sales","ADD")
				Xpost(@fn,brp_1,"Inventory!brp_no",ListPrice1,"Sales9","ADD")
			}
		Else If Location1 = "10-T"
			{
				Xpost(@fn,brp_1,"Inventory!brp_no",Qty1,"truck_10","SUB")
				Xpost(@fn,brp_1,"Inventory!brp_no",Qty1,"trk10sales","ADD")
				Xpost(@fn,brp_1,"Inventory!brp_no",ListPrice1,"Sales10","ADD")
			}
		Else If Location1 = "11-T"
			{
				Xpost(@fn,brp_1,"Inventory!brp_no",Qty1,"truck_11","SUB")
				Xpost(@fn,brp_1,"Inventory!brp_no",Qty1,"trk11sales","ADD")
				Xpost(@fn,brp_1,"Inventory!brp_no",ListPrice1,"Sales11","ADD")
			}

		Xpost(@fn,brp_1,"Inventory!brp_no",Qty1,"QTYToDate","ADD")
		Xpost(@fn,brp_1,"Inventory!brp_no",CallDate,"LastSold","")
		Xpost(@fn,brp_1,"Inventory!brp_no",CallNumber,"WO","")
		Xpost(@fn,brp_1,"Inventory!brp_no",CompanyName,"SoldTo","")
		ReadOnly(Post1, 0)
		Post1 = "X"
		ReadOnly(Post1, 1)
		Xpost(@fn,brp_1,"Inventory!brp_no",Post1,"ChangedForm","")
	}
 



Please, feel free to criticize any of this, it would be appreciated. I have tons more just like it.
  

It's not what a man says that matters or how he says it, but what he does and how he does it.
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: xpost question
Reply #8 - May 23rd, 2013 at 12:57pm
Print Post Print Post  
Hello Flip,

Yes, you would replace all the XPost with XResultSetValues() and then after the last one call XResultSetClose().

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
FlipGilbert
Full Member
***
Offline


Running Ver 2.6.4

Posts: 236
Location: Sandy Eggo
Joined: Mar 8th, 2005
Re: xpost question
Reply #9 - May 23rd, 2013 at 6:42pm
Print Post Print Post  
Is the XResultSetClose() in the right position?

When XResultSetClose() executes, is that when it writes or updates the other database?

Tested it in Program mode and had no error strings and when tested in preview mode it didn't function.....

Code
Select All
var vPartNo as String
Var vRSSinv as Int

If (CallStatus = "COMPLETE") and (Not (JobType = "Estimate")) And (Not @IsBlank(qty1)) and (Not @IsBlank(brp_1)) and ((@IsBlank(Post1)) and (not @IsBlank(Location1)))
	{
		vPartNo = brp_1
		vRSSinv = @XResultSetSearch(@FN, "Inventory", SEARCH_MODE_AND, SEARCH_SYNTAX_QA, "!brp_no=" + vPartNo)

		If vRSSinv > -1
			{
				If @XResultSetTotal(vRSSinv) = 1
					{
						If @XResultSetLocked(vRSSinv) = 0
							{
								If Location1 = "Shop"
									{
										XResultSetValue(vRSSinv, "Shopqty", @TN(@XResultSetValue(vRSSinv, "Shopqty")) - Qty1)
										XResultSetValue(vRSSinv, "shopsales", @TN(@XResultSetValue(vRSSinv, "shopsales")) + Qty1)
										XResultSetValue(vRSSinv, "SalesShop", @TN(@XResultSetValue(vRSSinv, "SalesShop")) + ListPrice1)
									}
								Else If Location1 = "2-T"
									{
										XResultSetValue(vRSSinv, "truck_2", @TN(@XResultSetValue(vRSSinv, "truck_2")) - Qty1)
										XResultSetValue(vRSSinv, "trk2sales", @TN(@XResultSetValue(vRSSinv, "trk2sales")) + Qty1)
										XResultSetValue(vRSSinv, "sales2", @TN(@XResultSetValue(vRSSinv, "sales2")) + ListPrice1)
									}
								Else If Location1 = "3-T"
									{
										XResultSetValue(vRSSinv, "truck_3", @TN(@XResultSetValue(vRSSinv, "truck_3")) - Qty1)
										XResultSetValue(vRSSinv, "trk3sales", @TN(@XResultSetValue(vRSSinv, "trk3sales")) + Qty1)
										XResultSetValue(vRSSinv, "sales3", @TN(@XResultSetValue(vRSSinv, "sales3")) + ListPrice1)
									}
								Else If Location1 = "4-T"
									{
										XResultSetValue(vRSSinv, "truck_4", @TN(@XResultSetValue(vRSSinv, "truck_4")) - Qty1)
										XResultSetValue(vRSSinv, "trk4sales", @TN(@XResultSetValue(vRSSinv, "trk4sales")) + Qty1)
										XResultSetValue(vRSSinv, "sales4", @TN(@XResultSetValue(vRSSinv, "sales4")) + ListPrice1)
									}
								Else If Location1 = "5-T"
									{
										XResultSetValue(vRSSinv, "truck_5", @TN(@XResultSetValue(vRSSinv, "truck_5")) - Qty1)
										XResultSetValue(vRSSinv, "trk5sales", @TN(@XResultSetValue(vRSSinv, "trk5sales")) + Qty1)
										XResultSetValue(vRSSinv, "sales5", @TN(@XResultSetValue(vRSSinv, "sales5")) + ListPrice1)
									}
								Else If Location1 = "6-T"
									{
										XResultSetValue(vRSSinv, "truck_6", @TN(@XResultSetValue(vRSSinv, "truck_6")) - Qty1)
										XResultSetValue(vRSSinv, "trk6sales", @TN(@XResultSetValue(vRSSinv, "trk6sales")) + Qty1)
										XResultSetValue(vRSSinv, "sales6", @TN(@XResultSetValue(vRSSinv, "sales6")) + ListPrice1)
									}
								Else If Location1 = "7-T"
									{
										XResultSetValue(vRSSinv, "truck_7", @TN(@XResultSetValue(vRSSinv, "truck_7")) - Qty1)
										XResultSetValue(vRSSinv, "trk7sales", @TN(@XResultSetValue(vRSSinv, "trk7sales")) + Qty1)
										XResultSetValue(vRSSinv, "sales7", @TN(@XResultSetValue(vRSSinv, "sales7")) + ListPrice1)
									}
								Else If Location1 = "8-T"
									{
										XResultSetValue(vRSSinv, "truck_8", @TN(@XResultSetValue(vRSSinv, "truck_8")) - Qty1)
										XResultSetValue(vRSSinv, "trk8sales", @TN(@XResultSetValue(vRSSinv, "trk8sales")) + Qty1)
										XResultSetValue(vRSSinv, "sales8", @TN(@XResultSetValue(vRSSinv, "sales8")) + ListPrice1)
									}
								Else If Location1 = "9-T"
									{
										XResultSetValue(vRSSinv, "truck_9", @TN(@XResultSetValue(vRSSinv, "truck_9")) - Qty1)
										XResultSetValue(vRSSinv, "trk9sales", @TN(@XResultSetValue(vRSSinv, "trk9sales")) + Qty1)
										XResultSetValue(vRSSinv, "sales9", @TN(@XResultSetValue(vRSSinv, "sales9")) + ListPrice1)
									}
								Else If Location1 = "10-T"
									{
										XResultSetValue(vRSSinv, "truck_10", @TN(@XResultSetValue(vRSSinv, "truck_10")) - Qty1)
										XResultSetValue(vRSSinv, "trk10sales", @TN(@XResultSetValue(vRSSinv, "trk10sales")) + Qty1)
										XResultSetValue(vRSSinv, "sales10", @TN(@XResultSetValue(vRSSinv, "sales10")) + ListPrice1)
									}
								Else If Location1 = "11-T"
									{
										XResultSetValue(vRSSinv, "truck_11", @TN(@XResultSetValue(vRSSinv, "truck_11")) - Qty1)
										XResultSetValue(vRSSinv, "trk11sales", @TN(@XResultSetValue(vRSSinv, "trk11sales")) + Qty1)
										XResultSetValue(vRSSinv, "sales11", @TN(@XResultSetValue(vRSSinv, "sales11")) + ListPrice1)
									}
								XResultSetValue(vRSSinv, "QTYToDate", @TN(@XResultSetValue(vRSSinv, "QTYToDate")) + Qty1)
								XResultSetValue(vRSSinv, "LastSold", CallDate)
								XResultSetValue(vRSSinv, "WO", CallNumber)
								XResultSetValue(vRSSinv, "SoldTo", CompanyName)
								ReadOnly(Post1, 0)
								Post1 = "X"
								ReadOnly(Post1, 1)
								XResultSetValue(vRSSinv, "ChangedForm", Post1)
							}
						XResultSetClose(vRSSinv)
					}
			}
	} 

  

It's not what a man says that matters or how he says it, but what he does and how he does it.
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: xpost question
Reply #10 - May 23rd, 2013 at 6:58pm
Print Post Print Post  
Hello Flip,

You are one line off it should be outside of the curly brace below there so

Code
Select All
var vPartNo as String
Var vRSSinv as Int

If (CallStatus = "COMPLETE") and (Not (JobType = "Estimate")) And (Not @IsBlank(qty1)) and (Not @IsBlank(brp_1)) and ((@IsBlank(Post1)) and (not @IsBlank(Location1)))
	{
		vPartNo = brp_1
		vRSSinv = @XResultSetSearch(@FN, "Inventory", SEARCH_MODE_AND, SEARCH_SYNTAX_QA, "!brp_no=" + vPartNo)

		If vRSSinv > -1
			{
				If @XResultSetTotal(vRSSinv) = 1
					{
						If @XResultSetLocked(vRSSinv) = 0
							{
								If Location1 = "Shop"
									{
										XResultSetValue(vRSSinv, "Shopqty", @TN(@XResultSetValue(vRSSinv, "Shopqty")) - Qty1)
										XResultSetValue(vRSSinv, "shopsales", @TN(@XResultSetValue(vRSSinv, "shopsales")) + Qty1)
										XResultSetValue(vRSSinv, "SalesShop", @TN(@XResultSetValue(vRSSinv, "SalesShop")) + ListPrice1)
									}
								Else If Location1 = "2-T"
									{
										XResultSetValue(vRSSinv, "truck_2", @TN(@XResultSetValue(vRSSinv, "truck_2")) - Qty1)
										XResultSetValue(vRSSinv, "trk2sales", @TN(@XResultSetValue(vRSSinv, "trk2sales")) + Qty1)
										XResultSetValue(vRSSinv, "sales2", @TN(@XResultSetValue(vRSSinv, "sales2")) + ListPrice1)
									}
								Else If Location1 = "3-T"
									{
										XResultSetValue(vRSSinv, "truck_3", @TN(@XResultSetValue(vRSSinv, "truck_3")) - Qty1)
										XResultSetValue(vRSSinv, "trk3sales", @TN(@XResultSetValue(vRSSinv, "trk3sales")) + Qty1)
										XResultSetValue(vRSSinv, "sales3", @TN(@XResultSetValue(vRSSinv, "sales3")) + ListPrice1)
									}
								Else If Location1 = "4-T"
									{
										XResultSetValue(vRSSinv, "truck_4", @TN(@XResultSetValue(vRSSinv, "truck_4")) - Qty1)
										XResultSetValue(vRSSinv, "trk4sales", @TN(@XResultSetValue(vRSSinv, "trk4sales")) + Qty1)
										XResultSetValue(vRSSinv, "sales4", @TN(@XResultSetValue(vRSSinv, "sales4")) + ListPrice1)
									}
								Else If Location1 = "5-T"
									{
										XResultSetValue(vRSSinv, "truck_5", @TN(@XResultSetValue(vRSSinv, "truck_5")) - Qty1)
										XResultSetValue(vRSSinv, "trk5sales", @TN(@XResultSetValue(vRSSinv, "trk5sales")) + Qty1)
										XResultSetValue(vRSSinv, "sales5", @TN(@XResultSetValue(vRSSinv, "sales5")) + ListPrice1)
									}
								Else If Location1 = "6-T"
									{
										XResultSetValue(vRSSinv, "truck_6", @TN(@XResultSetValue(vRSSinv, "truck_6")) - Qty1)
										XResultSetValue(vRSSinv, "trk6sales", @TN(@XResultSetValue(vRSSinv, "trk6sales")) + Qty1)
										XResultSetValue(vRSSinv, "sales6", @TN(@XResultSetValue(vRSSinv, "sales6")) + ListPrice1)
									}
								Else If Location1 = "7-T"
									{
										XResultSetValue(vRSSinv, "truck_7", @TN(@XResultSetValue(vRSSinv, "truck_7")) - Qty1)
										XResultSetValue(vRSSinv, "trk7sales", @TN(@XResultSetValue(vRSSinv, "trk7sales")) + Qty1)
										XResultSetValue(vRSSinv, "sales7", @TN(@XResultSetValue(vRSSinv, "sales7")) + ListPrice1)
									}
								Else If Location1 = "8-T"
									{
										XResultSetValue(vRSSinv, "truck_8", @TN(@XResultSetValue(vRSSinv, "truck_8")) - Qty1)
										XResultSetValue(vRSSinv, "trk8sales", @TN(@XResultSetValue(vRSSinv, "trk8sales")) + Qty1)
										XResultSetValue(vRSSinv, "sales8", @TN(@XResultSetValue(vRSSinv, "sales8")) + ListPrice1)
									}
								Else If Location1 = "9-T"
									{
										XResultSetValue(vRSSinv, "truck_9", @TN(@XResultSetValue(vRSSinv, "truck_9")) - Qty1)
										XResultSetValue(vRSSinv, "trk9sales", @TN(@XResultSetValue(vRSSinv, "trk9sales")) + Qty1)
										XResultSetValue(vRSSinv, "sales9", @TN(@XResultSetValue(vRSSinv, "sales9")) + ListPrice1)
									}
								Else If Location1 = "10-T"
									{
										XResultSetValue(vRSSinv, "truck_10", @TN(@XResultSetValue(vRSSinv, "truck_10")) - Qty1)
										XResultSetValue(vRSSinv, "trk10sales", @TN(@XResultSetValue(vRSSinv, "trk10sales")) + Qty1)
										XResultSetValue(vRSSinv, "sales10", @TN(@XResultSetValue(vRSSinv, "sales10")) + ListPrice1)
									}
								Else If Location1 = "11-T"
									{
										XResultSetValue(vRSSinv, "truck_11", @TN(@XResultSetValue(vRSSinv, "truck_11")) - Qty1)
										XResultSetValue(vRSSinv, "trk11sales", @TN(@XResultSetValue(vRSSinv, "trk11sales")) + Qty1)
										XResultSetValue(vRSSinv, "sales11", @TN(@XResultSetValue(vRSSinv, "sales11")) + ListPrice1)
									}
								XResultSetValue(vRSSinv, "QTYToDate", @TN(@XResultSetValue(vRSSinv, "QTYToDate")) + Qty1)
								XResultSetValue(vRSSinv, "LastSold", CallDate)
								XResultSetValue(vRSSinv, "WO", CallNumber)
								XResultSetValue(vRSSinv, "SoldTo", CompanyName)
								ReadOnly(Post1, 0)
								Post1 = "X"
								ReadOnly(Post1, 1)
								XResultSetValue(vRSSinv, "ChangedForm", Post1)
							}
					}
					XResultSetClose(vRSSinv)
			}
	}  



This way it closes the XResultSet no matter what as long as it was opened successfully.

The XResultSetClose unlocks that record and closes the resultset. As for why no values are being change you're gonna wanna place some writeln() statements to see the value of vRSSinv and also @XResultSetTotal(vRSSinv)

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
FlipGilbert
Full Member
***
Offline


Running Ver 2.6.4

Posts: 236
Location: Sandy Eggo
Joined: Mar 8th, 2005
Re: xpost question
Reply #11 - May 23rd, 2013 at 10:53pm
Print Post Print Post  
Thanks Ray,
my return on vRSSinv = 0, Hence the reason not the desired outcome.
The "!brp_no=" references the Element in the inventory database, reading the book over and over it talks about search spec for the "field name" (whats in the field?), in my case wouldn't it be what ever the string is in the brp_1 Element used in the variable vPartNo?
The Element Name brp_no is a key field in Inventory.db

Code
Select All
vRSSinv = @XResultSetSearch(@FN, "Inventory", SEARCH_MODE_AND, SEARCH_SYNTAX_QA, "!vPartNo=")
 



But It still returns 0
  

It's not what a man says that matters or how he says it, but what he does and how he does it.
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: xpost question
Reply #12 - May 24th, 2013 at 7:06pm
Print Post Print Post  
Hello Flip,

vRSSInv being 0 is alright as that means we have a valid resultset so the original XResultSetSearch() code is the one you want.

What is the value of @XResultSetTotal(vRSSinv) you can find this out by inserting the following line into your programming inside the if statement for If vRSSInv > -1

Code
Select All
writeln(@XResultSetTotal(vRSSinv)) 



-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
FlipGilbert
Full Member
***
Offline


Running Ver 2.6.4

Posts: 236
Location: Sandy Eggo
Joined: Mar 8th, 2005
Re: xpost question
Reply #13 - May 24th, 2013 at 7:35pm
Print Post Print Post  
writeln(@XResultSetTotal(vRSSinv)) returns 0 also
  

It's not what a man says that matters or how he says it, but what he does and how he does it.
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: xpost question
Reply #14 - May 28th, 2013 at 2:19pm
Print Post Print Post  
Hello Flip,

Double check that the field name is brp_no as it may differ from the element name.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send Topic Send Topic Print Print