I need some help for setting a value to a lookup field like assignee. But I need to do it without using "Defaults" feature of data constraints. Any idea?
Sorry for my late answer. Actually I found my own method. That's not actually I looked for but it worked for my case.
I set the assignee field readonly for the first initial problem page and then create a hidden field which will set the assignee as login user.
<PDM_IF "$args.id" == "0">
<PDM_IF "$args..." = "X"> <INPUT TYPE=hidden NAME=SET.assignee VALUE='$cst.id'>
<PDM_ELIF "$args..." = "Y">
<INPUT TYPE=hidden NAME=SET.assignee VALUE='$cst.supervisor_uuid.id'>
As I said not the desired solution but for now it works.
Thank you all for the ideas and support
there is 2 ways I use:
PRESET not works for my current scenario. I'll give a try to second option.
Utku, you mean set a default value to the lookup field if it is empty? or have some additional condition attached to the
lookup? I am thinking you could modify the schema on ON_NEW or use extraurl="ADDITIONAL_WHERE..." . My 2cents. Thanks _Chi
What do you want to base the pre-populated field on? Meaning, for your example of populating the assignee field, what determines the value that will populate in that field? Does it change per user, per category, per group??
Utku - also, why is it that you dont want to do this with a data partition constraint? Any reason?
for problems I want to set the assignee by initial popup window but for request and incident I dont want that.
there are also a couple custome fields with similar scenario
Hi Utku, when you say "set the assignee by initial popup window" what do you mean exactly? Also are you looking to auto-populate the request and incident tickets with assignee? I am a bit confused on to the exact scenario here - I need more information on that. If you are looking to auto-populate the request and incident tickets, what do you want the assignee to populate with? How do you want to drive that value - or what do you want to base that value on?
Please give us some clarification and a more complete use case so we can help you on this.
I think the scenarios are not important. My goal is to set default values for a few lookup fields which should not have the same value for request and problem. By default, I mean by clicking on New Request or New Problem link.
For example : for request I would like to set the group field to Group X but for problems I would like to set to Group Y.
As I said, I have a lot of fields which should have different initial value for requests and problems
The only supported way to do that is to use data partition constraints (default type). Outside of that it requires customization at the file level which is not supported, and we cannot assist you on that part as its outside of our scope.
Is there a reason as to why you didnt want to use data partition constraints to do this?
Let us know,
I think it's not possible with data constraint to set different default values for problem and requests, is it? There aren't different table names for problem and request.
Ah Yes you are correct - that will be a challenge. For that you will need some custom code most likely. I believe there is a way to do this via the forms (detail_cr vs. detail_pr), but its not something that I have played around with myself. I know there are folks out here on the community that have set defaults via the forms in the code. I found a couple of posts that might help you a bit here.
Check out these two:
Let us know,Jon I.
I try my best to help wherever and however I can. I am glad you got something to work for you at least to some extend.
I will mark your own post as correct
Retrieving data ...