Solved

@picklist problem

Posted on 2006-06-22
10
624 Views
Last Modified: 2013-12-18
Hi there,

Any idea why my picklist is always populating the previous value in my form computed field.

For example, if i have the following list of dates:

10/06/2006, 10/07/2006, 10/08/2007, 10/09/2007....

This are populated in the tests view which is called from picklist

Now when I select the first entry 10/06/2006, it seems to be OK and I complete and close the document as required.

However, when I select 10/08/2007 or any other entry next,I get the 10/06/2006 populated still in my field. Then when I select a third entry, 10/07/2006, I then get 10/08/2007 in my field, so it is always populating the previous entry in the field.
It seem like it is caching the entry somewhere but i am not sure where.

Here's my code:

Choice := @PickList([Custom]; "" : ""; "tests"; "Open view"; "Select a test from the list"; 3);
@Command([Compose];"3. test");
@setfield("testdate";Choice)

This is suppose to prompt for a list of tests, then when the user selects - OK , it open a new test document in edit mode and set the value of the testdate to the selected value.

I've tried the testdate field with both computed and computed when composed but still have the same problem.

Any ideas will be much appreciated.

Varvoura
0
Comment
Question by:varvoura
  • 5
  • 3
  • 2
10 Comments
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 300 total points
ID: 16958295
A suggestion: don't put the @Picklist in the button, but in the form.

Button:
    @Command([Compose];"3. test")

Form 3. test:
    field testdate, computed when composed:
        @PickList([Custom]; "" : ""; "tests"; "Open view"; "Select a test from the list"; 3)
0
 
LVL 43

Assisted Solution

by:Steve Knight
Steve Knight earned 200 total points
ID: 16958300
Is Choice being set right from the picklist?  Try a @Prompt([OK];"Choice";@Text(Choice)); before the compose for starters

Have you tried using FIELD TestDate:=Choice; instead of using @SetField too?


0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 16958309
That does sound more sensible sjef :-)
0
 

Author Comment

by:varvoura
ID: 16958378
Sjef, I have use this action from a button in the view where the main product form is selected as the test a response to the product form and unless the product form is selected, I can't compose the test response for it, UNLESS of course you have another suggestion.

Steve, choice is set correctly but I have tried FIELD testdate...
I didn't think that FIELD is necessary in version 6.5
I may give that one a try now.

Thanks guys, I'll let you know shortly how I go.

0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 16958391
I think sjef was getting at create an action button on the view which checks the correct document is already selected if you need to then just does a compose and let the computed when composed field as sjef suggested prompt with the picklist.

You can use either @SetField or FIELD.... and of course you can set using FIELD in the middle of a formula now too of course...
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:varvoura
ID: 16958392
sjef, thought about what you said, feel like a total idiot with my last comment.
Real pain of an application i am working on, i can't wait until it is over.

I'll give both of your suggestions a try and we'll let you know.

Thanks
0
 

Author Comment

by:varvoura
ID: 16958438
Steve,

Choice is given the exact value that I am selecting from picklist
FIELD testdate:= choice (the same problem)

I have a feeling that it has something to do with my field type.

Please guys correct me if I am wrong:

1. I can have the field as editable field because it only validate once the document is opened and in this case setting the field won't happen because the document is already open.

i set the field as computed and computed when composed and to compute to its own value, maybe this is where the problem is.

Now,I am about to try sjef suggestion
0
 

Author Comment

by:varvoura
ID: 16958514
sjef, it works magic, THANK YOU!

Can I ask another question in relation to the same issue and I'll increase the points instead of moving to another question.

Can I create a response document from within a response document using an action button?

For example, a product form, from an action within the product form.
The main reason is to keep the first product form linked to the next one(this only happens on expired products) and not every product form.

Thank you both for your help.

Vavoura
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16958863
New questions are new questions...

But yes, you can. The new document must be created using a response-to-response form, and the current document must be saved on disk before you click the button.
0
 

Author Comment

by:varvoura
ID: 16958938
sjef,

I''ll open another question for this anyway, because I hve to clarify one more thing

Thanks
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now