Alpha Video Training
Page 1 of 2 12 LastLast
Results 1 to 30 of 35

Thread: Guidance needed- copy record

  1. #1
    Member
    Real Name
    Ken Boucher
    Join Date
    Feb 2006
    Location
    Manchester, CT
    Posts
    200

    Default Guidance needed- copy record

    I'm frustrated and have tried a for a couple of weeks to get the following done. If someone has any suggestions how to do this, it would be greatly appreciated.

    Objective:
    To allow members to view each other's inventories and send offers to trade. I have attempted two different ways to no avail.

    (1) A user views an inventory of items and after they select to view the details of a specific item they can click a link/button that will send the owner of that item a filtered link of their inventory. The owner can then click that link and go to that inventory, without needing to log in until they decide to act on it. I am able to get an email sent but it does not accept any filter expression. (there are a couple of threads on this in the forum).

    (2) A user views an inventory of items and after they select to view the details of a specific item they can click a link/button that places that item in a different database table (call it OFFER) and it sends a general text email to the owner who can then click it to see what it is. They will need to log in so it will filter only offers to them. I thought of this when I couldn't figure out the filter email. This one I have not gotten too far with and there is little I can find to guide me in regards to web pages.

    I have received ideas from past post, that I have truly appreciated, but have still been unsuccessful. Am I going about it wrong or making it too difficult or does anyone have any other thoughts as to making this work?

    Thanks in advance

    Ken

  2. #2
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Grand Rapids, Michigan
    Posts
    4,212

    Default

    Quote Originally Posted by vinyltap
    (1) A user views an inventory of items
    Ken,

    Are you basing this on application that are web based interface or network-PC applications?

    Mike W

  3. #3
    Member
    Real Name
    Ken Boucher
    Join Date
    Feb 2006
    Location
    Manchester, CT
    Posts
    200

    Default Web Based

    Sorry- these are Alpha5 databases and components only.

    Ken

  4. #4
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Grand Rapids, Michigan
    Posts
    4,212

    Default Can't help

    Ken,

    Sorry I haven't ventured to the web application yet, so I can't help. Good luck..

    Mike w

  5. #5
    Member
    Real Name
    Martin Horzempa
    Join Date
    Oct 2005
    Posts
    224

    Default

    hi ken

    let me make sure i have this right

    you would like to set up a trading site
    and this would involve swaps of things

    so Alex would list his inventory on your site A.inv
    in the INV table
    and Sue would list her inventory on our site S.inv
    in the INV table

    now when one of your users see something that he/she
    would like to have he/she would notify the owner of the
    coveted item that there is interest in a trade and present to that
    owner a list of things that the swappee would like to trade

    am i anywhere close???

    if i am then i would use 2 tables for the offer

    then if Alex liked an item S.inv.thing1 he must
    move to the offer table a list of those things he is willing to trade
    this list must be filtered because he has the Hope Diamond in his
    list and only wants a to obtain Sue's 15 year old 10 speed.

    i think i would structure the offer so that the following
    information is available to Sue when she sees what is offered

    1) Alex member id
    2) Sue member id
    3) Sue Inv Item number

    and of course the things that alex would want to trade

    i think that i would use 2 tables
    1) offerhead
    this tables should have the following
    1) a unique offer id (an auto increment number field)
    2) Alex member id
    3) Sue member id
    4) Sue Inv Item number
    and possibly
    5) a counteroffer field id (in case you want to use counter offers)
    2)offerlist
    this table would hold the info for each item in the list
    and a selector field to choose items in the list ?????

    then when Alex creates his offer then i would send an email
    to Sue that contains a link to the page that has
    2 components on it 1)the header and 2)the list of the item offered
    the filter for the list would be the unique offer id from the offerhead table
    HTML Code:
    <A name="trademe" href = "http://myserver.com/mypage.a5w?mygridlinker_filter=myofferid=XXX"><Lets Trade>


    i am not sure how you go about adding the filtered list of items to the
    email message i must defer to someone much more knowledgable about
    sending emails
    but it seems to me that it would be much simpler to just use a link to the offer page in the email

    thats my 2 cents worth - hope i havent muddied the waters too much

    regards
    martin

  6. #6
    Member
    Real Name
    Ken Boucher
    Join Date
    Feb 2006
    Location
    Manchester, CT
    Posts
    200

    Default To simplify/expand on thought

    To simplify my trade will always be one for one as all the items will be of the same type. I have the table for items available that can be filtered by user.

    Using your example;

    Alex would see something he likes, click a link and on that click take that item and put into a Swap table. Then fire an email back to Sue with a link to a page with a component that shows that offer (she will have to log in to see it).

    I can't seem to figure out how to get that item plunked into the new table.

    Thanks for help so far.

    Ken

  7. #7
    Member
    Real Name
    Martin Horzempa
    Join Date
    Oct 2005
    Posts
    224

    Default

    Ken

    here are some links to the help files

    linksyntax i meant to send this with my last reply

    http://support.alphasoftware.com/alp...der_Syntax.htm

    there are 3 functions that you might use for this
    tbl.copy_record_to, tbl.copy_records_to and tbl.record_clone
    the links below are to the help files again and they have EXAMPLES to help you

    http://support.alphasoftware.com/alp...ECORD_TO().htm
    http://support.alphasoftware.com/alp...CORDS_TO().htm
    http://support.alphasoftware.com/alp...RD_CLONE().htm

    as you can see the fields in each table must have the same names and must be defined as the same type and size

    i think that the tables must be mirror images of each other for the clone method to work properly

    of course you can do this by code also without those restrictions
    and also note that if you have an autoincrement number field this may be a problem also

    here is how i used the clone function
    Code:
              ' Move the completed order from the temp files to the main files
              ' the orderhead is an autoincrement file so we must save it and then find it with the torder number
              ' to retrieve the ordernumber
              on error goto failed_to_copy
                                  ' the header file
              				tbl2 = table.open("[PathAlias.ADB_Path]\TordHead",FILE_RW_SHARED)                                                                   				
              				t2index = tbl2.index_primary_put("Order_Id")
                                  tbl2.fetch_find(MyOrderNum)
                                  tbl2.change_begin()
                                  tbl2.Tord_Id = MyOrderNum
                                  tbl2.change_end(.T.)                                                           
                                  result = tbl2.copy_record_to("[PathAlias.ADB_Path]\OrdHead")
                                  t2index.close()
    		                    tbl2.close()
    		                    ' now find the new ORDER NUM and use this for the dependent records
    		                    tbl3 = table.open("[PathAlias.ADB_Path]\OrdHead",FILE_RW_SHARED)
    		                    t3index = tbl3.index_primary_put("Torder_Id")
    		                    tbl3.fetch_find(MyOrderNum)
    		                    MyNewOrdNum = tbl3.Order_id		                    
    		                    tbl3.close()
                                                                
                                  ' the  "CC" payment file                              
                  				tbl2 = table.open("[PathAlias.ADB_Path]\TordCC",FILE_RW_SHARED)
              				t2index = tbl2.index_primary_put("Payment_Order_Id")
                                  tbl2.fetch_find(MyOrderNum)
                                  tbl3 = table.open("[PathAlias.ADB_Path]\OrdCC",FILE_RW_SHARED)
                                  'result = tbl2.copy_record_to("[PathAlias.ADB_Path]\OrdCC.dbf")
                                       tbl3.enter_begin()
                                       tbl3.record_clone(tbl2)
                                       tbl3.Payment_Order_Id = MyNewOrdNum
                                       tbl3.enter_end(.T.)
                                  tbl3.close()     
                                  t2index.close()
    		                    tbl2.close()
                                                        
                                  'the following tables have multiple records to copy
                                  ' the condition file'
                  				tbl2 = table.open("[PathAlias.ADB_Path]\TordCond",FILE_RW_SHARED)
              				t2index = tbl2.index_primary_put("Cond_Id")
                                  tbl2.fetch_find(MyOrderNum)
                                  tbl3 = table.open("[PathAlias.ADB_Path]\OrdCond",FILE_RW_SHARED)
                                  'result = tbl2.copy_records_to("[PathAlias.ADB_Path]\OrdCond","Cond_Id =" + S_QUOTE(MyOrderNum))
                                  while .NOT. tbl2.fetch_EOF()
                                       if tbl2.cond_id = MyOrderNum then
                                             tbl3.enter_begin()
                                             tbl3.record_clone(tbl2)
                                             tbl3.Cond_Id = MyNewOrdNum
                                             tbl3.enter_end(.T.)
                                       end if     
                                       tbl2.fetch_next()
                                  end while
                                  tbl3.close()                 
                                  t2index.close()
    		                    tbl2.close()
                  				tbl2 = table.open("[PathAlias.ADB_Path]\TordBody",FILE_RW_SHARED)
              				t2index = tbl2.index_primary_put("Body_Id")
                                  tbl2.fetch_find(MyOrderNum)
                                  tbl3 = table.open("[PathAlias.ADB_Path]\OrdBody",FILE_RW_SHARED)                              
                                  'result = tbl2.copy_records_to("[PathAlias.ADB_Path]\OrdBody","Body_Id =" + S_QUOTE(MyOrderNum))
                                   while .NOT. tbl2.fetch_EOF()
                                       if tbl2.Body_Id = MyOrderNum then    
                                            tbl3.enter_begin()
                                            tbl3.record_clone(tbl2)
                                            tbl3.Body_Id = MyNewOrdNum
                                            tbl3.enter_end(.T.)
                                       end if
                                       tbl2.fetch_next()
                                  end while
                                  tbl3.close()                             
                                  t2index.close()
    		                    tbl2.close()
                  on error goto 0
    hth
    regards
    martin

  8. #8
    Member
    Real Name
    Ken Boucher
    Join Date
    Feb 2006
    Location
    Manchester, CT
    Posts
    200

    Default Grab the record

    I saw those links in my research.

    How do I tell it to get the record being viewed/click. Their example was in putting the specific record # in but in this case it will change depending on what is being clicked? There wasn't anything explaining how to put a variable in there.

    Ken

  9. #9
    Member
    Real Name
    Martin Horzempa
    Join Date
    Oct 2005
    Posts
    224

    Default

    hi ken
    you have i assume a a5w page with a grid in it
    that has alexes inventory displayed
    and i assume that you have one of the fields set up as a link
    if thats the case then the link should read something like

    'mycodepagename.a5w'

    this should be an a5 page that you can write in any text editor
    but do not use the wyswyg editor

    basically you must read the values sent form the previous page
    and then use them to do what you want

    copy the following code into a text file and save it to
    maybe 'mycodepagename.a5w'

    Code:
    <%a5
    
    		'this code will allow me to see what the refering page has sent to this page ,comment it out to make the page work
    			? "TEST RETURN     Alex's Inventory" 
    			? request.raw
    			end 
    %>
    remember to publish it

    when you run you origianl page and click the link it sould take you to
    mycodepagename.a5w and it sould display the raw data sent from the sending page

    so now you should be able to see what the sending page has sent
    to mycodepagename.a5w

    let me know if you have it working ok
    when you do take a look at this

    Code:
    <%a5
    
    		'this code will allow me to see what the refering page has sent to this page ,comment it out to make the page work
    			'? "TEST RETURN     Addon1" 
    			'? request.raw
    			'end 
    
    
    
    
    
    dim MyProd as N
    dim MyQty as N
    dim MyProd2 as N
    dim MyTUser as N
    dim MyOrderNum as N
    dim MyLineNum as N
    dim tbl as p
    
    dim tbl2 as P
    dim t2index as P
    
    
    dim MyBigString as C
    dim MyLittleString as C
    dim MyEndString as C
    dim MySecondString as C
    dim MyCounter as N
    dim MyCount as N
    dim MyQCounter as N
    dim MQCount as N
    dim myrecord as N
    
    	MyLittleString = "MyID="
    	MyEndString = "&"
    	MySecondString = "MyQTY="
    	MyCounter = 1
    	MyOrderNum = convert_type(session.torder,"N")
    
    'make sure that the user has chosen something and not just pressed the wrong button
    ' get the product id sent from the calling form
    	if eval_valid("request.variables.MyID") = .t. then
    		'how many items chosen
    		
    						'? " In Eval_valid = TRUE" +"<br>"
    						'? request.variables.MyID +"<br>"	
    						'? request.Body 
    						' end
    		MyBigString = request.body
    		MyCount = occurs(MyLittleString,MyBigString)
    
    		if mycount > 0 then
    
    		' get the total item onpage with the Myqty  field
    		MyQCount =occurs(MySecondString,MyBigString)
    		
    		'Got at Least on Item chosen so we need to open the  body file, find the right line # and add the item(s)
    		' remember we saved the TOrder to a session variable so we will use it to get the correct order and line number
    		'MyLineNum = LookupN("L",session.torder,"Body_Linenum","[PathAlias.ADB_Path]\TOrdBody","Body_Id")		
    		tbl = table.open("[PathAlias.ADB_Path]\TOrdbody",FILE_RW_SHARED)
    				tbl2 = table.open("[PathAlias.ADB_Path]\Products",FILE_RW_SHARED)
    				t2index = tbl2.index_primary_put("Productid")
    				
    '? "insidemy qqty > 0 "  + myqcounter +"<br>"			
    			'Get the Item #
    		while MyQCounter <= MyQCount 
    			MyQty =  convert_type(extract_string(MyBigString,MySecondString,MyEndString,myqcounter,.F.,.F.,.F.),"N")
    			if MyQty > 0 then
    				tbl.enter_begin()
    					MyProd = convert_type(extract_string(MyBigString,MyLittleString,MyEndString,mycounter,.F.,.F.,.F.),"N")				
    						MyLineNum = 10 ' addon identifier						
    						tbl.Body_LineNum = MyLineNum 
    						tbl.Body_Id = session.torder			
    						tbl.Body_Item = MyProd
    						tbl.Body_Qty = MyQty
    						tbl.Body_tax = "Y"
    						myrecord = tbl2.fetch_find(MyProd)
    							tbl.Body_Desc = tbl2.Webname
    							tbl.Body_price = tbl2.Currentprice							
    							tbl.Body_Img = tbl2.Whiteimgsm
    							tbl.Body_Code = tbl2.Itemnumber
    							tbl.Body_Seasonal = tbl2.Seasonal
    							tblH.Body_Leadtime = tbl2.Leadtime	
    				tbl.enter_end(.t.)
    				MyCounter = MyCounter + 1
    			end if
    			MyQCounter = MyQCounter + 1
    		end while
    		t2index.close()
    		tbl2.close()		
    		tbl.close()				
                                     
    		
    		end if
    'Add up all sales taxes for the line item and update the sales tax record
    				dim mytab as P
    				dim MyI as P
    				dim MyRec as N
    				dim myline as C
    				dim Taxable as N
    				dim Nontaxable as N
    				dim MyRate as N
    				dim myTax as N
    				dim mySeasonal as C
    				dim myLeadtime as N
    				mySeasonal = ""
    				myLeadtime = 0
    				myTax = 0
    				dim Head as P
    				dim Headindex as P
    
    				MyRate = LookupN("F","JGT","Tax_Rate","[PathAlias.ADB_Path]\Tax","Tax_Code")
    				mytab = table.open("[PathAlias.ADB_Path]\TordBody",FILE_RW_SHARED)
    				myi = mytab.index_primary_put("Body_Id")
    				MyRec = mytab.fetch_find(MyOrderNum)				
    				if Myrec > 0 then
    					mytab.fetch_goto(MyRec)
    					while .NOT. mytab.fetch_eof()						
    						if mytab.BODY_ID == MyOrderNum then
    							if mytab.Body_Tax = "N" then				
    								nontaxable = nontaxable + (mytab.Body_Price * mytab.Body_Qty)							
    							end if											
    							if mytab.Body_Tax = "Y" then				
    								taxable = taxable + (mytab.Body_Price*mytab.Body_Qty)
    							end if
    							if mytab.Body_Seasonal <> "" then
    								mySeasonal = mytab.Body_Seasonal
    							end if
    							if mytab.Body_Leadtime <> 0 then
    								myLeadtime = mytab.Body_Leadtime
    							end if
    						end if
    					mytab.fetch_next()		
    					end while
    				end if
    				myi.close ()				   
    				mytab.close()	
    ' get the sales tax record and enter the amount
    				mytab = table.open("[PathAlias.ADB_Path]\TordBody",FILE_RW_SHARED)
    				myline = STR(MyOrderNum,19,5)+STR(95,19,5)		'		
    				myi = mytab.index_primary_put("Orderandline")
    				Myrec = mytab.fetch_find(myline)
    
    				if Myrec > 0 then
    					mytab.fetch_goto(MyRec)					
    					mytab.change_begin()
    					mytab.Body_Price = Taxable * MyRate
    					myTotal = Taxable + (Taxable * MyRate) + Nontaxable
    					myTax = mytab.Body_Price					
    					mytab.change_end(.t.)								
    				end if	
    				myi.close ()				   
    				mytab.close()
    
    	'Save Order info to the Header File
    	Head = table.open("[PathAlias.ADB_Path]\TordHead",FILE_RW_SHARED)
    	Headindex = head.index_primary_put("Order_Id") 
    	Myrec = Head.fetch_find(MyOrderNum)
    	if Myrec > 0 then
    		Head.fetch_goto(MyRec)					
    		Head.change_begin()
    		Head.total = myTotal
    		if myTax > 0 then
    			Head.Taxable = "Y"
    			Head.Tax = myTax
    		else
    			Head.Taxable = "N"
    			Head.Tax = 0
    		end if
    		Head.Seasonal = mySeasonal
    		Head.Leadtime = myLeadtime						
    		Head.change_end(.t.)								
    	end if	
    	Headindex.close ()				   
    	Head.close()
    		
    		
    		
    	else
    		'goto showcart.a5w		
    		? "In Eval_Valid = FALSE"
    		? request.raw
    	' end -dont stop here goto show cart.a5w
    	end if
    
    
    ' ok now lets show the Cart page
    ' remember the session variable is a char string and we need a numeric
    MyOrderNum = convert_type(session.torder,"N")
    		response.redirect("CartShow.a5w?TordBody_Filter=Body_ID=" + MyOrderNum)
    
    %>

    this page gets the variables sent from the previous page and then
    opens the inventory file finds the record for the users choices and then
    creates records in the order line items table

    all by code

    it then redirects the user to the shopping cart page

    you might use this technique but in your case i think that the copy record or clone record may do the trick

    hth
    regards
    martin

  10. #10
    Member
    Real Name
    Ken Boucher
    Join Date
    Feb 2006
    Location
    Manchester, CT
    Posts
    200

    Default Ran Test

    I ran the test and it's pulling the right record when clicked upon, highlighted below:

    TEST RETURN Test InventoryGET /test.a5w HTTP/1.1 Host: ykeep.com:81 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */* Referer: http://ykeep.com/Swap_Items_All.a5w?...ll_DetailView=14&82052677 Accept-Language: en-us Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Cox High Speed Internet Customer; .NET CLR 1.1.4322) Connection: Keep-Alive Cookie: A5W_Sess_ID=79ae76bf1b0542a4a984cc17fbcd4baa; A5W_LoadBalance=YBS1|81|Fri, 19 May 2006 12:47:55 GMT

    I started dabbling with copy_record_to but couldn't figure out how to get this item to get copied into the table I want it to go.

    Ken

  11. #11
    Member
    Real Name
    Martin Horzempa
    Join Date
    Oct 2005
    Posts
    224

    Default

    hi ken

    ok now we know that the proper page is called and we know
    that the sending page was using the GET method
    so lets make sure that the sending page gives the data a name

    change your sending link to something like

    'mycodepagename.a5w?mythingamabob={alexesinventorynumber or id}

    the{....} above must be from the list of fields that is available in the
    link address setup box in your component builder


    and lets change the code in the mycodepagename.a5w file to


    Code:
    <%a5
    
    		'this code will allow me to see what the refering page has sent to this page ,comment it out to make the page work
    			? "TEST RETURN     Addon1" 
    			? request.raw
    			? "<br>"
    			if eval_valid("request.variables.mythingamabob") = .t. then
    				? "myvariables   <br>"
    				?  request.variables.mythingamabob + "<br>"
    				? "end of variables   <br>"
    			else
    				? "there is no request variable mythingamabob  <br>"
    			end if
    			? "<br>"
    			? "myheaders --- " + request.headers
    			? "<br>"
    			? "myquery --- " + request.Query_String
    			end 
    
    
    %>

    you should take a look at the help file
    http://support.alphasoftware.com/alp...t_Variable.htm
    this will help you understand the differences between post and get and
    the differences in what will be available and when

    now that you have a variable and a value you can pick it up and use it in
    your code

    ok you should be off to the races now

    best of luck
    regards
    martin

  12. #12
    Member
    Real Name
    Ken Boucher
    Join Date
    Feb 2006
    Location
    Manchester, CT
    Posts
    200

    Default Syntax issue?

    Thanks for your help Martin. I'm gettiing the error response, but I feel I may have used your code incorrectly. Let me know if you notice where I may have gone wrong.
    Code:
    <%a5
    
    			? "TEST RETURN     Addon1" 
    			? request.raw
    			? "<br>"
    			if eval_valid("request.variable.Item_no") = .t. then
    				? "myvariables   <br>"
    				?  request.variable.Item_no + "<br>"
    				? "end of variables   <br>"
    			else
    				? "there is no request variable Item_no  <br>"
    			end if
    			? "<br>"
    			? "myheaders --- " + request.headers
    			? "<br>"
    			? "myquery --- " + request.Query_String
    			end 
    
    
    %>
    Here is what I get when I run the above;

    Code:
    TEST RETURN Addon1GET /test2.a5w HTTP/1.1 Host: ykeep.com:81 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */* Referer: http://ykeep.com/Swap_Items_All.a5w?Swap_Items_All_DetailView=1&111059564 Accept-Language: en-us Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Cox High Speed Internet Customer; .NET CLR 1.1.4322) Connection: Keep-Alive Cookie: A5W_Sess_ID=79ae76bf1b0542a4a984cc17fbcd4baa; A5W_LoadBalance=YBS1|81|Mon, 22 May 2006 15:46:06 GMT 
    there is no request variable Item_no 
    
    myheaders --- GET /test2.a5w HTTP/1.1 Host: ykeep.com:81 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */* Referer: http://ykeep.com/Swap_Items_All.a5w?Swap_Items_All_DetailView=1&111059564 Accept-Language: en-us Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Cox High Speed Internet Customer; .NET CLR 1.1.4322) Connection: Keep-Alive Cookie: A5W_Sess_ID=79ae76bf1b0542a4a984cc17fbcd4baa; A5W_LoadBalance=YBS1|81|Mon, 22 May 2006 15:46:06 GMT
    myquery ---
    Thanks again.

    Ken

  13. #13
    Member
    Real Name
    Martin Horzempa
    Join Date
    Oct 2005
    Posts
    224

    Default

    hi ken
    sorry you are having trouble
    a few questions

    are you using a link to get this a5w page?
    are you using the detail view link on your grid?
    did you create a new field for this link?
    does your link code look something like this

    'mycodepagename.a5w?Item_no={alexesinventorynumber or id}

    martin

  14. #14
    Member
    Real Name
    Ken Boucher
    Join Date
    Feb 2006
    Location
    Manchester, CT
    Posts
    200

    Default Here are the details

    Code:
    are you using a link to get this a5w page?
    Yes the link is:
    Swap_Item_Detail.a5w?Swap Item View_filter=Item_no={Item_No}
    Code:
    are you using the detail view link on your grid?
    Yes- but I am getting an error message with it recently that I didn't get before. Should be same above. Note I use the same link for a link field and it works fine.
    The error I'm getting all of a sudden (the detail link was working fine) is:
    Code:
    500 Internal Server Error
    Script Error
    Error:Script: /Swap_Items_All.a5w line:29
    x_Swap_Items_All = a5w_run_Component(tmpl_Swap_Items_All)
    Property is write only 
    tempP.expn subelement not found.

  15. #15
    Member
    Real Name
    Ken Boucher
    Join Date
    Feb 2006
    Location
    Manchester, CT
    Posts
    200

    Default Addition

    As a note if I eliminate the Detail view and use the
    Code:
    Swap_Item_Detail.a5w?Swap Item View_filter=Item_no={Item_No}
    link in both areas the error goes away, but then I can't differentiate from a person just viewing the item to a person wishing to make an offer on the item.

    Ken

  16. #16
    Member
    Real Name
    Martin Horzempa
    Join Date
    Oct 2005
    Posts
    224

    Default

    morning ken

    yes i saw your other post and i expected that you are using the link to the detail section of the grid
    i would suggest that you might just add your own link to the DETAIL section
    and this will probably fix both problems

    to do this
    1 - add a new calculated field to your detail view maybe - mytradelink= ""
    this will place it in the fields list
    2- in the details section choose this field to add to the detail section
    3- make this a "link" type control
    4- set the "display what in link" to static text and and make the text maybe - "make an offer" or whatever
    5- set the "link address type" to "computed from fields in the grid"
    6- set the link address to
    - Swap_Item_Detail.a5w?Swap Item View_filter=Item_no={Item_No}
    ( i am assuming that "Swap Item View" is the the name of the component right? and this is not really "Swap_Item_View")

    this should give you the link you need without fooling with the link used by
    the grid component


    just saw your last message and i think that what you say might reconfirm the above

    btw are we still working to send a variable/value to a code page or have you changed horses on me?

    martin

  17. #17
    Member
    Real Name
    Ken Boucher
    Join Date
    Feb 2006
    Location
    Manchester, CT
    Posts
    200

    Default Error

    After getting your response I thought I remembered doing that before- anyway... still got the message previously noted after making the links identical.

    Swap_Item_Detail.a5w?Swap Item View_filter=Item_no={Item_No}


    Error:

    500 Internal Server Error
    Script Error
    Error:Script: /Swap_Items_All.a5w line:30
    x_Swap_Items_All = a5w_run_Component(tmpl_Swap_Items_All)
    Property is write only
    tempP.expn subelement not found.

    It was working 2 days ago and now it doesn't. Makes little sense to me.

    And yes I am still trying to capture this item and send to a table.

    Ken

  18. #18
    Member
    Real Name
    Martin Horzempa
    Join Date
    Oct 2005
    Posts
    224

    Default

    ken

    did you give it a try to create your own link
    in the detail section?
    and remove any changes to the detail link?

    if so did the error message go away?
    did the link work correctly?


    martin

  19. #19
    Member
    Real Name
    Ken Boucher
    Join Date
    Feb 2006
    Location
    Manchester, CT
    Posts
    200

    Default Link

    I put in my own link- the one noted. Not sure what to delete as for changes. Here is the xbasic for that link

    Code:
    .Fieldname = "OFFER"
    	.Scope = "Local"
    	.DisplayFormat = ""
    	.DisplayUnFormat = ""
    	.Type = "J"
    	.Varname = "OFFER"
    	.Column.LabelPosition = "Left"
    	.Controltype = "Link"
    	.link.InLineStyle = "color: #666699; font-variant: small-caps; font-weight: bolder;"
    	.link.DisplayType = "Static text"
    	.link.DisplayExpression = ""
    	.link.StaticText = "Offer Swap!"
    	.link.StaticImage = ""
    	.link.StaticImageInlineStyle = "border-style: none;"
    	.link.StaticImageAlt = ""
    	.link.AlternateImageControl = ""
    	.link.Type = "DetailView link"
    	.link.ComputedAddress = "Swap_Item_Detail.a5w?Swap Item View_filter=Item_no={Item_No}"
    	.Link.targetFrameOrWindow = "Swap_Item_Detail.a5w?Swap Item View_filter=Item_no={Item_No}"
    	.Link.ClearParameters = .f.
    	.Link.ScrollToDetailView = .t.
    	.BreakType = "None"
    	.nCols = 1
    	.Column.Hide = .f.
    	.Column.Heading = ""
    	.Column.Sort = "<No Sort>"
    It looks okay.

    Ken

  20. #20
    Member
    Real Name
    Martin Horzempa
    Join Date
    Oct 2005
    Posts
    224

    Default

    hi ken

    the lines:
    .link.Type = "DetailView link"
    this should not be a detailview link -

    .link.ComputedAddress = "Swap_Item_Detail.a5w?Swap Item View_filter=Item_no={Item_No}"

    .Link.targetFrameOrWindow = "Swap_Item_Detail.a5w?Swap Item View_filter=Item_no={Item_No}"

    the target should be something to tell the browser where to dispaly the link
    - ie new window the same window parent etc
    its in the dropdown on the component builder

    the fastest way to fix what you have is


    1) duplicate the old grid component to a new name --- save what you have
    2) remove the field from the grid for the link you previously created
    3) add a new link as i described in the previous post

    this should get rid of your error message
    fire it up
    when you click the new link it should take you to Swap_Item_Detail.a5w?
    let me know
    martin

  21. #21
    Member
    Real Name
    Ken Boucher
    Join Date
    Feb 2006
    Location
    Manchester, CT
    Posts
    200

    Default Working Again

    Okay back on track. Thanks so far Martin.

    Now onto capturing that item... I ran the test and it outputs the item being selected.

    Ken

  22. #22
    Member
    Real Name
    Martin Horzempa
    Join Date
    Oct 2005
    Posts
    224

    Default

    hi Ken
    glad you are on your way
    good luck
    regards
    martin

  23. #23
    Member
    Real Name
    Ken Boucher
    Join Date
    Feb 2006
    Location
    Manchester, CT
    Posts
    200

    Default Last question (or 2)

    To get back to the original reason for this post- do you know the syntax to grab that item and plop it into a different table?

    Ken

  24. #24
    VAR Pat Bremkamp's Avatar
    Real Name
    Pat Bremkamp
    Join Date
    Apr 2000
    Location
    Oregon, USA
    Posts
    2,635

    Default May be easier way

    Ken,

    A5 offers a lookup function which displays a grid and allows a user to click on a select button and bring that data into another grid. All the heavy lifting is done for you.

    So, build a table titled MyOffers and build a grid or a dialog with a lookup link. The lookup will be the grid with the available items in it. Map the available to to the offer, and you now have the table you need.

    Pat

  25. #25
    Member
    Real Name
    Ken Boucher
    Join Date
    Feb 2006
    Location
    Manchester, CT
    Posts
    200

    Default Question

    I created a blank table to be filled from the table with the items. No link ever shows to allow a user to select an item, actually no items come up, just a blank grid.

    There must be a way to click on an item and have it copied to a table. there is some inference to it but I can't put my finger on how exactly to do it.

    Ken

  26. #26
    Member
    Real Name
    Martin Horzempa
    Join Date
    Oct 2005
    Posts
    224

    Default

    hi ken

    pat is right you could accomplish what you want i believe
    by using the lookup function

    if you would rather i will walk you though this with your
    original approach.

    let me know
    martin

  27. #27
    Member
    Real Name
    Ken Boucher
    Join Date
    Feb 2006
    Location
    Manchester, CT
    Posts
    200

    Default Look up

    I went and created a grid and made all the field look ups. I mapped from the original table to the desired destined table. But nothing ends up into the grid.

    Amy I using the right funtion you are suggesting?

    Ken

  28. #28
    Member
    Real Name
    Ken Boucher
    Join Date
    Feb 2006
    Location
    Manchester, CT
    Posts
    200

    Default Lookup

    I have it to the point that an item is pulled and displayed in a A5W page, but it appears I can't use the Lookup Function since that would work off the table I want to send the item's data to which does not have item in it yet to map. I tried and created a grid with this new table to pull from the main table but I get 'no records'.

    There must be a way to take what is pulled on this page (filtered to one item) and dump that item's info into that new table.

    If I am using the Lookup function incorrectly please let me know.

    Ken

  29. #29
    Member
    Real Name
    Martin Horzempa
    Join Date
    Oct 2005
    Posts
    224

    Default

    hi ken

    i really cant help that much with the lookup function
    i have never used it
    but dont want to leave you in a lurch

    if you want to retry the original method and have
    30 minutes to work on it let me know and i will walk you through it again

    martin

  30. #30
    Member
    Real Name
    Ken Boucher
    Join Date
    Feb 2006
    Location
    Manchester, CT
    Posts
    200

    Default Original

    I sure would. However it is most convenient for you. I feel I am very close but need to close the deal. I appreciate your assistance.

    Ken

Similar Threads

  1. Copy record to current record not working
    By Larry Ternowski in forum Alpha Five Version 6
    Replies: 3
    Last Post: 07-15-2005, 05:01 AM
  2. Xbasic Guidance Needed
    By forskare in forum Alpha Five Version 5
    Replies: 10
    Last Post: 01-12-2003, 09:18 AM
  3. Copy Record Help Please
    By Keith Hubert in forum Alpha Five Version 5
    Replies: 7
    Last Post: 10-05-2002, 04:49 PM
  4. Guidance needed
    By Scott Emerick in forum Alpha Five Version 5
    Replies: 9
    Last Post: 09-08-2002, 06:51 PM
  5. Record Copy
    By John Bolte in forum Alpha Five Version 4
    Replies: 4
    Last Post: 10-13-2001, 06:15 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •