Re: Update List Records (Sort)

63 views
Skip to first unread message

ibuchanan

unread,
Jun 18, 2012, 3:36:23 PM6/18/12
to version...@googlegroups.com
Dan,
 
The quick answer is as follows:
 
HTTP POST to URL: https://www14.v1host.com/v1sdktesting/rest-1.v1/Data/Custom_Notes/10209
 
XML Data: <Asset> <Attribute name="Order" act="set">0+</Attribute> </Asset>
It's not exactly an answer to your question because Order is an "opaque value". That means we have an internal meaning for it and you can't set the value directly, you have to set it relative to something else. In the example above, the request tells VersionOne to put the list value just after 0 (some Order values are negative so 0 is not guaranteed to be first within the system). When we iterate over each list value and set Order to 0+, this works like pushing values onto a stack. Each list value will get added after 0 and pushes all the other list values down. Therefore, if you "push" them in reverse alphabetical order, the list will become alphabetized.
 
Does that answer your question?
 
Ian
 
 

On Monday, June 18, 2012 3:16:28 PM UTC-4, danno wrote:
There is a list table (http://xxx/VersionOne/rest-1.v1/Data/List?where=AssetType='Custom_business_owners') that I would like to set the sort order on the records based on the owner name so they are alphabetical and not showing in order they were added.
 
What I am looking for is the POST URL syntax that I need in order to set the Order attribute to a particular value for a specific record.
 
Thanks,
Dan
 

Acey Bunch

unread,
Jun 19, 2012, 9:43:30 AM6/19/12
to version...@googlegroups.com

The XSL is used for transforming the data for display. Try removing “?xsl='\\V1StoryToExcel\apiPostOwnerSort.xsl'” from the URL that you are posting to.

 

Acey Bunch

 

From: version...@googlegroups.com [mailto:version...@googlegroups.com] On Behalf Of danno
Sent: Tuesday, June 19, 2012 9:28 AM
To: version...@googlegroups.com
Subject: Re: Update List Records (Sort)

 

This is the URL I am posting:

 

 

The contents of the file are below:

 

<Asset>
 <Attribute name="Order" act="set">0+</Attribute>
</Asset>

 

I get a response 400. Am I missing something in the xsl file?


On Monday, June 18, 2012 3:16:28 PM UTC-4, danno wrote:

There is a list table (http://xxx/VersionOne/rest-1.v1/Data/List?where=AssetType='Custom_business_owners') that I would like to set the sort order on the records based on the owner name so they are alphabetical and not showing in order they were added.

 

What I am looking for is the POST URL syntax that I need in order to set the Order attribute to a particular value for a specific record.

 

Thanks,

Dan

 

--
You received this message because you are subscribed to the Google Groups "VersionOne-dev" group.
To view this discussion on the web visit https://groups.google.com/d/msg/versionone-dev/-/urdGOIRAa-IJ.
To post to this group, send email to version...@googlegroups.com.
To unsubscribe from this group, send email to versionone-de...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/versionone-dev?hl=en.

Acey Bunch

unread,
Jun 19, 2012, 11:25:53 AM6/19/12
to version...@googlegroups.com

Sorry if I wasn’t clear, you need to remove everything after the /Custom_business_owners/7241.

 

Try this for your URL: http://server/VersionOne/rest-1.v1/Data/Custom_business_owners/7241/

 

-Acey

 

From: version...@googlegroups.com [mailto:version...@googlegroups.com] On Behalf Of danno
Sent: Tuesday, June 19, 2012 11:23 AM
To: version...@googlegroups.com
Subject: Re: Update List Records (Sort)

 

Acey,

 

Thank you for your help.

 

I have removed the ? which now looks like:

 

 

and I got a 404 response now. Looks like this should be simple... Here is the vba code I am running - do you see anything incorrect?

 

    strURL = "http://server/VersionOne/rest-1.v1/Data/Custom_business_owners/7241 xsl='\\V1StoryToExcel\apiPostOwnerSort.xsl'"
    Set objWinHttp = CreateObject("Msxml2.XMLHTTP.3.0")
            
    objWinHttp.Open "POST", strURL, False, strUserName, strPassword
    objWinHttp.send

    If objWinHttp.status <> 200 Then
        MsgBox (objWinHttp.status)
        Exit Function
    End If


On Monday, June 18, 2012 3:16:28 PM UTC-4, danno wrote:

There is a list table (http://xxx/VersionOne/rest-1.v1/Data/List?where=AssetType='Custom_business_owners') that I would like to set the sort order on the records based on the owner name so they are alphabetical and not showing in order they were added.

 

What I am looking for is the POST URL syntax that I need in order to set the Order attribute to a particular value for a specific record.

 

Thanks,

Dan

 

--
You received this message because you are subscribed to the Google Groups "VersionOne-dev" group.

To view this discussion on the web visit https://groups.google.com/d/msg/versionone-dev/-/EOzQ3WU7eeIJ.

Acey Bunch

unread,
Jun 20, 2012, 3:24:02 PM6/20/12
to version...@googlegroups.com

Hi Dan,

 

One thing that you may find helpful is to use the HTTP Tester that is included with VersionOne API. This will allow you try out different syntax in a structured way and see the result immediately by changing the URL and XML payloads that you POST.

 

You can access the tester with the following URL in your V1 instance: http://{servername}/VersionOne/http.html.

 

In addition, here are some examples on how to update scalar attribute values on V1 assets: http://community.versionone.com/sdk/Documentation/DataAPI.aspx#lbe.update.

 

-Acey

 

From: version...@googlegroups.com [mailto:version...@googlegroups.com] On Behalf Of danno
Sent: Wednesday, June 20, 2012 2:38 PM
To: version...@googlegroups.com
Subject: Re: Update List Records (Sort)

 

Any additional suggestions from my last reply below??


On Monday, June 18, 2012 3:16:28 PM UTC-4, danno wrote:

There is a list table (http://xxx/VersionOne/rest-1.v1/Data/List?where=AssetType='Custom_business_owners') that I would like to set the sort order on the records based on the owner name so they are alphabetical and not showing in order they were added.

 

What I am looking for is the POST URL syntax that I need in order to set the Order attribute to a particular value for a specific record.

 

Thanks,

Dan

 

--
You received this message because you are subscribed to the Google Groups "VersionOne-dev" group.

To view this discussion on the web visit https://groups.google.com/d/msg/versionone-dev/-/wQiF0kOP9kcJ.

Reply all
Reply to author
Forward
0 new messages