Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
New Member
Posts: 12
Registered: ‎10-12-2010

Query on child entity in SData

This may be an administration issue, but here goes.  When adding a contact via SLXMobile, we don't want to see users that are not enabled when selecting an owner.  Can this be done in a queryWhere property?    I have tried a few things like User.Enabled eq "true".  I can load the child entity in a feed, but I haven't figured out how or if I can query on the child entity.  Thanks!

Bronze Contributor
Posts: 95
Registered: ‎07-11-2011

Re: Query on child entity in SData

While I can't answer your question directly, hopefully this will help a bit on the mobile side of things:

 

You can do this two ways:

 

1) Make all requests on the Owner List View have that where expression; or

2) Make the Contact Edit owner field pass the where expression to the Owner List, just for that lookup control.

 

(assuming mobile 1.2)

 

For method #1:

In your ApplicationModule.js add:

Ext.override(Mobile.SalesLogix.Owner.List, {
    queryWhere: 'Enabled eq true'
});

 

For method #2

In your ApplicationModule.js add:

this.registerCustomization('edit', 'contact_edit', {
   at: function(row) { return row.name == "Owner";},
   type: 'modify',
   value: {
      where: 'Enabled eq true'
   }
});

 

In both cases the where expression will be against this feed:

http://localhost/sdata/slx/dynamic/-/owners?format=json

 

This is because it is using a "lookup" control that takes you out of the Edit View and into an entirely new List View with its own entity kind, querySelect, queryWhere, etc and in this case its argos-saleslogix/src/views/Owner/List.js. Meaning that the where expression is already in context of Owner so it doesn't need the "Owner." part.

 

The reason this doesn't answer your question directly is because I don't see any sort of "enabled" property exposed in the SData feed for owners, at least using the eval database with a basic no thrills saleslogix install.

Highlighted
New Member
Posts: 12
Registered: ‎10-12-2010

Re: Query on child entity in SData

When the owner is Type=User, the owner has a user child entity. The user entity has an "enabled" property. The owner/list.js returns all users, departments and teams. I want to restrict this to enabled users. I can include the child data in a feed (http://localhost/sdata/slx/dynamic/-/owners?include=users&select=OwnerDescription&orderby=OwnerDescription&format=json&_t=1341261181305) but I can't figure out how to query against the child.
Bronze Contributor
Posts: 95
Registered: ‎07-11-2011

Re: Query on child entity in SData

My apologies I do see that now, the mobile part stands as for the approaches and the expression used in both would be something like:

 

queryWhere: 'User.Enabled eq true'

 

but it is failing. From the looks of it there is a missing mapping in AA somewhere - trying to pin down where exactly it's causing the exception.

Gold Super Contributor
Posts: 3,087
Registered: ‎03-19-2009

Re: Query on child entity in SData

[ Edited ]

Your post peaked my curiosity.. so I went in and checked both the latest ver 1.2 (extjs based) as well as the new "2.0" (dojo based for vers 8 slx) code.... and sure enough both "suffer" from a design flaw and are inconsistent with the Windows/LAN product and the Web product when it comes to "owner".

 

Both are not only displaying "disabled"/retired users (it is illegal in Slx for a record to be owned by a such) - but they are also displaying "template" users in the lookup - which is also "illegal".

 

Basically, for ANY place where the "owner lookup" is used in the SlxMobile (app), it should ONLY return:

       Users where UserSecurity.Enabled = True and UserSecurity.Type ne 'R' and UserSecurity.Type ne 'T'

as well as allow the names of Teams from SecCode.

 

--
RJ Ledger - rjledger@rjlSystems.net +1 603.369.3047 x101

".. Innovators in Mobility - Experts in Workflow Automation..."
http://www.rjlSystems.net - blog: www.rjlSystems.net/blog.html
Gold Super Contributor
Posts: 3,087
Registered: ‎03-19-2009

Re: Query on child entity in SData

Tony,

    I Posted against the original post... and pointed out it is not as simple as User.Enabled eq true... not all records in the user table are "legit".... (no templates or retired..).. Also, you do have to include teams, etc..

"Broken" in all mobile versions (1.0 thru 2.x)

--
RJ Ledger - rjledger@rjlSystems.net +1 603.369.3047 x101

".. Innovators in Mobility - Experts in Workflow Automation..."
http://www.rjlSystems.net - blog: www.rjlSystems.net/blog.html