cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to Prefill create wizards attributes?

Former Member
0 Likes
550

Hi I need to pre fill create wizards attribute, depending on logged in user, for e.g I logged in as an employee & I'm creating a customer, Now the customer model has an attribute called 'xyz' of type "CustomType".

This custom type has a relation with a user group, which holds certain employees.

->Now I logged in as an employee, when Im creating a customer , I need to pre populate the wizard 'xyz' attribute depending on the relation defined above.

Thanks,

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Likes

Hi,

please check the prepare section:

             <wz:prepare id="productPrepare">
                 <wz:initialize property="newProduct" type="ctx.TYPE_CODE"/>
                 <wz:assign property="newProduct.code" value="ctx.code"/>
                 <!-- more here -->
             </wz:prepare>

Cheers, Wojtek

Former Member
0 Likes

This might not work in all cases right ?Depending on the Logged in user , i need to fill. Logged in user is assigned to an user group which has relation with my custom type.

I mean how can we inject @CockpitUserService in xml ? I tried but didn't work