SPComplexToSimpleDropdown when column is required

Aug 24, 2012 at 9:30 PM
Edited Aug 25, 2012 at 2:19 AM

When the Look up fields are converted from complex drop down to simple drop down, if the loop field is required ,once after the conversion default value appears in the look up.

 

According to our requirement it should not default to some value in the look up field ,it should be blank and it should validate when i click on 'OK' button to select.For achieving this do i need to do ant thing.

Thanks in Advance

Bindu

Coordinator
Sep 11, 2012 at 2:36 PM
Edited Sep 13, 2012 at 1:52 AM

Bindu:

It sounds like you want the dropdown to behave differently then that way lookup columns do by default. To make SPServices as unobtrusive as possible while adding value, I replicate the out of the box behavoir as much as possible. If you have a blank value in a required dropdown and the user leaves it selected, you'll get an ugly ewrror. However, you can certainly add that value yourself.

Sorry for the delayed response, but I was on holiday.

M.

Sep 12, 2012 at 9:43 PM
Edited Sep 12, 2012 at 9:47 PM
Hey Marc,

Thanks a lot for the reply

Yes u r correct it behaves as if the out of box look up field,one of our requirement was that by default it should not populate the value ,if not selected then an error message should be provided.
Is there a way where i can fulfill this requirement .

Also we have a around 20 look up fields in the form and these look up fields refers to only master list and then by using $().SPServices.SPFilterDropdown look up's are filtered using caml query and applied to each look up field .
Here we have a performance issue ,the form loads very slowly than usually .Is there any way where i can increase the performance of the form(like new and edit forms of the list).

Thanks in Advance
Bindu

Coordinator
Sep 13, 2012 at 1:57 AM

You can provide sensical error messages by using the PreSaveActions() function. I have a couple of blog posts that talk about how to do that.

If you're using SPFilterDropdown on 20 lookup columns in a form, you'll definitely see some performance issues. There will be Web Services calls going on for each instance and the time required to do them will add up.

In the beta of v0.7.2, I've added some caching which should help. (There will potentially be fewer calls to GetList, assuming your values are coming from fewer than 20 lists.) I'd be interested if you see performance improvements if you try it.

M.

Sep 13, 2012 at 2:16 PM

Can we use beta of v0.7.2 version on production site ,20 lookup columns refers to one list and caml query is applied on it.There are at least 2000 rows in the list as the each look up column refers to  the same list there is lot of performance issue.

 

Looking for a solution where i can increase the performance of the page.

 

Thanks

Bindu

Coordinator
Sep 13, 2012 at 2:32 PM

Bindu:

If you're using one list as the source for 20 lookup columns, you might want to reconsider your architecture. It's hard to say.

It's really up to you whether you want to use the beta in production. I've had no issues reported other than the jQuery 1.8 incompatibility I fixed in BETA2.

M.

Sep 13, 2012 at 2:49 PM

Do you suggest to change the Architecture ? we came for this only to reduce the no of master lists in the applications.

Thanks

Bindu

Coordinator
Sep 13, 2012 at 2:55 PM

I really can't say besed on what I know. It just seems the using one list as the source for 20 lookup columns may not be the right approach.

M.

Sep 27, 2012 at 10:34 PM

Hi Marc,

Initially we have a list which has all choice fields ,as we don't want to use the Choice fields we did the prototype of the list and used look up fields with the filter logic.We are able to do every thing successfully but when we plan for the migrating the data from that list our list we ended up with the problem that we are not able to copy the following four fields data

1.Created

2.Created By

3.Modified

4.Modified By

Marc if you could let me know whether there is any way to migrate the data from one list to another list which includes the above 4 fields too.

I appreciate for the help

 

Thanks

Bindu

 

Coordinator
Oct 8, 2012 at 4:21 PM

Bindu:

You can't preserve the values in those columns via the Web Services. You'd need to turn to code or a third party tool.

M.

Nov 14, 2012 at 2:27 PM

Hi Marc,

For required look up fields i want to add a blank and show the error message once they click on OK button.You suggested to write the same in PreSaveAction() function.

Could you please suggest me some blogs for doing the same.

 

Thanks in Advance

Bindu

Coordinator
Nov 21, 2012 at 4:42 AM

Bindu:

I have some posts about PreSaveAction on my blog if you do a search there.

M.