Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, February 21, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Web Forums - SalesLogix Web Client (Pre-7.2)
Forum to discuss using & developing the legacy SalesLogix Web Client (For versions 7.0 and earlier). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Web Client (Pre-7.2) | New ThreadView:  Search:  
 Author  Thread: DoUpdate() updating custom tables
Hilary Anglin
Posts: 17
 
DoUpdate() updating custom tablesYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 09 Apr 07 8:43 AM
Hello,

I am working with Web Client (6.2.6). I read in a blog that if I
added fields to the accinfo template from a table that is 1:1
with ACCOUNT that the updateaccount() action that includes the
DoUpdate() function will automatically loop through the aliases
and update BOTH tables. I read in a blog to make this happen I
need to include a hidden field to my custom table and that the
field name and the alias name have to match.

I added this to accinfo:
<input type="hidden" name="caccountextid" value="<#F
name=caccountextid>">
This alias is the key to my custom table C_ACCOUNT_EXT that is
globally joined (1:1) with ACCOUNT.

When I add this hidden field to the accinfo template, fields for
C_ACCOUNT_EXT update, but fields for account ACCOUNT do not. If I take this hidden field
out ACCOUNT updates, but C_ACCOUNT_EXT does not. I can get one or the other table to update but not both.

I am sure I am missing something simple, any help would greatly
be appreciated so I can get BOTH tables to update.

[Reply][Quote]
Jeff Ballard
Posts: 326
 
Re: DoUpdate() updating custom tablesYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Apr 07 3:04 PM
fiogf49gjkf0d
Hilary,

Not sure if you got it working, but I didn't have any issue. Do your aliases to your custom table start at the account table and then join to your custom field? the data path for "TESTFIELD" on C_ACCOUNT_TEST should be:

Account.C_ACCOUNT_EXT.TESTFIELD

and NOT

C_ACCOUNT_EXT.TESTFIELD

That could be an issue.

Also, you shouldn't need the

 <input type="hidden" name="caccountextid" value="<#F name=caccountextid>"> 


on your template - you don't need the ID to your custom table - the DLL and OLEDB provider know what your primary key field is.

I had a field named test field on my form below industry, like this:

<tr>
<td></td>
<td><input type="text" name="testfield" value="<#FIELD name=testfield>"></td>
</tr>


and my alias started at account and joined to c_account_ext.testfield (as above) and it all worked fine. Check where your alias starts and try removing the hidden input with your #FIELD that references the ID.

Jeff

[Reply][Quote]
Hilary Anglin
Posts: 17
 
Re: DoUpdate() updating custom tablesYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Apr 07 3:14 PM
Thanks Jeff for the response. I did get this fixed. I had the alias set up correctly. It was a read only text field that was causing the problem. Once I fixed that, the update worked..

Now I am working on INSERTING an opportunity with custom data in a 1:1 C_OPPORTUNITY table. (in the previous example, new Accounts are not allowed to be entered through the Web Client therefore the C_Account_Ext already exists from the regular Sales Client). I wish there was better documentation.. Do you know where I might find the instructions how to automatically INSERT a record into C_OPPORTUNITY when the INSERT occurs for the main OPPORTUNITY table???
[Reply][Quote]
Jeff Ballard
Posts: 326
 
Re: DoUpdate() updating custom tablesYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Apr 07 3:19 PM
Hilary,

One other thing, that I just tested and actually learned.

When adding a contact/account (the template conadd2), but you don't have any data to be inserted into your custom, 1:1 table, if you include the

 <input type="hidden" name="caccountextid" value=""> 


it will insert the 1:1 record for you. All it will insert is the accountid, createuser, createdate, modifyuser and modifydate.

In this scenario, you still need to make sure that the alias starts at the account table and uses the join to get to C_ACCOUNT_EXT.

I've never been able to figure out how to get the data into the 1:1 table on insert if I had no actual data to post without going through a real workaround, but by using the alias to the extension table id field with no value in the hidden input control, it will do the insert.

Seven years with the slx web client and I'm still learning.

Jeff
[Reply][Quote]
Jeff Ballard
Posts: 326
 
Re: DoUpdate() updating custom tablesYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Apr 07 3:22 PM
Hilary,

Wow...your reply and my next reply crossed - I was testing what you were asking about based on your original post (having the value of the ID field on the template got me thinking that maybe it would work on the 1:1 insert). Read my second reply to your first message. A short summary:

Basically, create an alias that starts at oppty. and uses the join to your custom table, put that on your template in a hidden field with a blank value. It should do the auto-insert. At least it did for account.

If you run into issues, let me know, and I can probably test it on the oppty. as well.

Jeff
[Reply][Quote]
Hilary Anglin
Posts: 17
 
Re: DoUpdate() updating custom tablesYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Apr 07 3:32 PM
7 years?? Try 7 weeks (ha ha ha) I took the web class in Scottsdale two years ago and then we decided not to use it... Well, now we are attempting to kick off a pilot and I am suffering for it.

Now for my other custom table C_Opportunity 1:1 with Opportunity.....

In Oppadd1, I noticed it looked like they were inserting blank records into competitors, products, etc by the code you just mentioned so I did the same <input type="hidden" name="copportunityid" value=""> and the alias starts at Opportunity.C_Opportunity. I AM NOT getting a record inserted into C_Opportunity.

This is the only line of code I added to the form:
<input type="hidden" name="copportunityid" value="">

alias: copportunityid
path: Opportunity.C_OPPORTUNITY.Opportunityid

Do you see what's wrong??? Jeff, if you help me with this I will send you lunch!
[Reply][Quote]
Hilary Anglin
Posts: 17
 
Re: DoUpdate() updating custom tablesYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Apr 07 3:42 PM
Hmmm. is it because the AddOpportunity action uses RecordAdd instead of AddPostedValues??? my web dev reference says "to add a record to a user-define table with a 1:1 relationship with another table, use AddPostedValues (p.42) instead of this WAPI to use the primary key of another table.)

AddOpportunity doesn't use AddPostedValues is that why it's not adding the custom table record?

[Reply][Quote]
Jeff Ballard
Posts: 326
 
Re: DoUpdate() updating custom tablesYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Apr 07 3:48 PM
Hilary,

You're on the right track, so I'll let you out of buying me lunch. Just kidding - even if you *weren't* on the right track, you wouldn't owe me lunch - I'm just glad to share knowledge!

It *is* because it doesn't used AddPostedValues. I added this line to the action:

   RecordAdd dbHandle, "coppid", "" 


below the line

   RecordAdd dbHandle, "oppresellerid", PostedGetValue("oppresellerid") 


That worked. Basically, it bypasses the AddPostedValues function but does the same thing that function does.

Jeff
[Reply][Quote]
Hilary Anglin
Posts: 17
 
Re: DoUpdate() updating custom tablesYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Apr 07 4:00 PM
Jeff,

You are my hero! I thought I was going to have to do this:

coppHandle=CreateRecord("INSERT C_OPPORTUNITY")
AddPostedValues coppHandle, "C_OPPORTUNITY"

and add it in the same AddOpportunity action and see if that would have worked.

I jumped shipped on that idea when I saw your work around. THANK YOU SO MUCH... Unfortunately you will not see the last of me in this forum. I have so much to do in so little time. I hope this helped you to for inserting a blank record!

Bonus question: Do you know how set a picklist to be Options = R and Options = S.. I can't figure out the syntax to use 2 options... (I know I am taking advantage of you at this point
[Reply][Quote]
Jeff Ballard
Posts: 326
 
Re: DoUpdate() updating custom tablesYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Apr 07 4:19 PM
Bonus Answer:

<#PL list="mylist" options=RS>

should do it.

And I'm glad to help when I can!

Jeff

[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 2/21/2025 5:45:03 AM