Highlighted
forumadmin Absent Member.
Absent Member.
7749 views

How can you update a record in an aux table in a workflow?


Question posted 8/22/08 by Greg Wilson
Details:

I know using a post transition I can add a record to an aux table, but what if I want to update said record at a later time?
I am guessing I would use teamscript, and probably the SetFielfValue() method, but there is no example of it's use in the reference guide.
So my first question is: Is there a way to update an aux record without using teamscript? Second: if not, can someone show me a generic example of doing it via teamscript?
Thanks

0 Likes
15 Replies
forumadmin Absent Member.
Absent Member.

Re: How can you update a record in an aux table in a workflow?


Comment posted 8/25/08 by mtcarver

I've never done this, we use manage data to add and update records which is a manual process. Sounds like TeamScript to me.
I can't say what the code would be exactly however I think once you create a record object you can use that object to update the code. You'll most likely have to lock - update - unlock.
record.lock
record.update
record.unlock
Good luck

0 Likes
forumadmin Absent Member.
Absent Member.

Re: How can you update a record in an aux table in a workflow?


Comment posted 8/25/08 by Greg Wilson

Yeah, I thought about manage data for a minute, but i really want a process for the adding and deleting. Meaning I don't just want someone to go willy nilly and change a record, once it is in, i want an approval process for modifying data.
Our shop is pretty small, so I don't think I would NEED to lock, but it certainly isnt bad practice to do such.
I'll play around in my dev environment and see if i can figure it out.

0 Likes
forumadmin Absent Member.
Absent Member.

Re: How can you update a record in an aux table in a workflow?


Comment posted 8/25/08 by mtcarver

The lock is a program requirement doesn't matter on shop size. With TT item records on transition a lock isn't necessary because the TT has already taken care of this for you. However when deleting, updating an aux record( info outside of TT item record) the lock should be required. You can try it, if it doesn't work check your event logs it should say if a lock was needed.

0 Likes
forumadmin Absent Member.
Absent Member.

Re: How can you update a record in an aux table in a workflow?


Comment posted 8/25/08 by Lynn Mattie

You don't need the lock/unlock calls. If a user happens to have the same record opened in a browser, then your update call will fail unless you set the optional stealLock parameter to True. In the latter case, the user will get an error when they hit OK. My guess is you won't let the user edit the records directly if you're using a script to update and add them so this really isn't a concern in your case. Another option maybe to create the relationships to the primary table instead of an aux table. Your workflow would only make the item active when everything is approved in this case (which may seem a bit bizarre, but only active items are enabled in the lists that use this table).

0 Likes
forumadmin Absent Member.
Absent Member.

Re: How can you update a record in an aux table in a workflow?


Comment posted 8/25/08 by Greg Wilson

I thought about the prmary table idea too, my only concern is bloating the primary table, it is already pretty big. When ever possible I like to break away and use aux tables to clean up the data a bit.
I am pretty sure I will be able to do it, but it will require a bunch of teamscript. For editing I would have to use a single relational table to point ot the aux table, then use sub-relational fields to grab the values, then use some teamscript to assign those values to empty input fields (i.e. text and numeric fields), then after making what ever changes using teamscript to update the aux table.

0 Likes
forumadmin Absent Member.
Absent Member.

Re: How can you update a record in an aux table in a workflow?


Comment posted 8/25/08 by Lynn Mattie

I meant in a separate primary table. The only real difference btw primary and aux tables is the workflow that is associated with primary table items. The disadvantage of this approach is that you add another Tab to the user interface.

0 Likes
forumadmin Absent Member.
Absent Member.

Re: How can you update a record in an aux table in a workflow?


Comment posted 8/25/08 by Greg Wilson

ah, I may want this to have access to some of the other aux tables in the tab it is going to live on. I also have some sub tasks for things like documentation and such where I like them to all be under the same tab, just different project hierarchies

0 Likes
forumadmin Absent Member.
Absent Member.

Re: How can you update a record in an aux table in a workflow?


Comment posted 8/25/08 by Lynn Mattie

All aux tables are available for all tabs. I believe that some day Business Mashups will allow you to group multiple primary tables within one Tab. I personally don't like to put significantly different types of things within one primary table, because it doesn't feel object oriented and it adds a lot of wasted columns within your primary table.

0 Likes
forumadmin Absent Member.
Absent Member.

Re: How can you update a record in an aux table in a workflow?


Comment posted 8/25/08 by Greg Wilson

Ugh, you know what, i have always been putting applications (each tab) in its own mashup to make it easier to work on them, in those circumstances aux tables aren't available outside of each tab. I never considered that multiple applications from with in the dsame mashup would be any different. Simply put I thought with the new model, aux tables were only available with in each tab, thus diminishing it value.
So is this the case for reporting too? Meaning I can report between tabs as long as they are in the same mashup?

edit:
And yes, I did not like having to have all that crap in the same primary table too, it was a big shorting I thought of mashups. I even asked about this during my mashup training class, but it was the first one, and everyone was new to it, so no one really knew a lot of the answers.

0 Likes
forumadmin Absent Member.
Absent Member.

Re: How can you update a record in an aux table in a workflow?


Comment posted 9/5/08 by Linda Denny

Is it true that aux tables are only available within each tab when you move to mashups?

0 Likes
forumadmin Absent Member.
Absent Member.

Re: How can you update a record in an aux table in a workflow?


Comment posted 9/5/08 by Greg Wilson

this is tricky. Aux tables are available only to projects within that mashup. Consider a tab as basically a primary table. That is now called an "application". So, a tab has a primary table, and it is considered an application. The trick is you can have more than 1 application in a mashup.
Think of a mashup as another level of container. So if I have tab A and tab B that means I have application A and application B. Say I put both of those into the same mashup. IfI put an aux table in application A, then the stuff from tab B can access it. Now, say I create a new mash up with one application in it called C. I would then have a new tab called.. yes you guessed it, C. Tab C can NOT access stuff from the tab A aux table.
What is odd is when in the user interface you don't really see a difference, meaning there is no indication that tab A and B are in one mashup and tab C is in another. I don't even think you can see that distinction in administrator.
Because of this I am basically having to redo all of my mashups into 1 mashup with several applications inside.
If I am not on the mark with this, someone please correct me.

Edit:
I got the teamscript now to edit entries in an aux table if anyone needs it. It's kind of nice because i have a process that posts dats into the table, then if it needs updating, I have an approval process in a workflow to submit changes, review them then update the table in question.

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.