Within a project of my own, I created the group "AutodealersOffice". Within this group I have two groups: AutodealersOffice Name Description Office21 Office21 Office45 Office45 Inside Office21 is the name of my user and inside Office45 there is another user. Apart I have an interface with a form with three fields. In the first fields automatically loads, through an expression rule, the office in which I am (Office21) and when I click on the send button, it is stored in my autodealers field, of the BB.DD, as [Group: 66]. What I want to do is convert that [Group: 66] to Office21 and by clicking on the send button it will be saved as Office21. In the a! save I have this but it's wronga!pickerFieldGroups( label: "AutodealersOffice", labelPosition: "ADJACENT", maxSelections: 1, groupFilter: local!gruop, value: rule!getOffice(), saveInto: { a!save(ri!new.autodealers,rule!getOffice(group(togroup(ri!new.autodealers),"description"))) }, required: true, readonly: true, validations: {} ),THANKS
Discussion posts and replies are publicly visible
Hi,
first, your a!save is not particularly readable. I recommend passing parameters explicitly and use newlines now and then.
As to the problem at hand, group() takes groupId as number and property as text. What you are doing in your expression is converting that input (66?) to [Group: 66], instead of a number. group(66,"description"), then, should help.
I do not finish understanding what you want to explain to me. Could you give me an example?
Let's widen the scope a bit. You are saying "it is wrong" - what exactly does not work? What are your inputs and expected outputs?
Currently, after reading your expression again, I also notice:
- You are attempting to save an input into itself, which possibly might lead to problems if not for the fact that..
- The a!save is never executed because your component is readonly, so the user never interacts with it.
Since you say you want to save something on a button press, what's the save action in your send button?
It does not work for me:a!save(ri!new.autodealers,rule!getOffice(group(togroup(ri!new.autodealers),"description")))that is, I want to send, save in my bb.dd, Office21 and not [Group: 66]
This is the action of saving when you press the send button a!buttonWidget( label: "Send", value: true, saveInto: { a!save(ri!new.solicId, local!caseRandom), a!save(ri!new.applicant,loggedInUser()), a!save(ri!new.autodealers,rule!getOffice()) }, submit: true, style: "PRIMARY" )