Empty values for macro in variable editor

harshvardhan_11
Giga Expert

Hi,

I have created a UI macro, having an input field, which I am using in a variable in record producer.

After submitting the item, and checking record created. The variable editor have empty values in those input fields.

How should I bring the data entered in UI macro variable to the variable editor. I want to show exact same field data with the same style in record table.

1 ACCEPTED SOLUTION

What I am saying is that your input field "<input type="text" name="newsal" />" is in the context of the macro, and not the Record Producer, so the producer script I don't believe can read that value and do anything with it. You would actually need to have an onchange script in your macro write the value to a variable in your producer (the variable can be hidden) so that it is available to the producer script.


View solution in original post

10 REPLIES 10

Thanks for suggestion.



As you have quoted, "You would actually need to have an onchange script in your macro "


I am not sure of how to create onChange script in macro because the macro have a button which is doing major function.




But, as per above suggestion, I have created an onSubmit client script in record producer which is calling a function on UI macro. That function is   returning values, which I want, to record producer, and I am saving them in multi text field.



Now I have the values in multi text field, which I can show in variable editor, but still the macro is visible with empty values in variable editor in form.


I created onLoad client script with below line to hide the macro, but I think with macro it doesn't work.



g_form.setVisible('variables.<macro_name>',false);



Any idea how can we hide UI macro in variable editor


Unfortunately in a UI Macro you might have to handle it all yourself. I believe in Fuji and before setting a UI Macro variable in a formatter didn't work, but you can use DOM manipulation inside your macro to hide all content (knowing this isn't best practice, but it does what you want)


HI Harshvardhan Joshi ,



were you ale to achieve this ?,please share the code you used we have similar requirement .Thanks in advance


I have created a new hidden field(multi line text) and copied the data of the macro fields to this new multi line text field. Because the data in macro will not be visible in variable editor.



In variable editor I have hidden the macro and shown the multi line text field.




If you can specify your requirement a little bit, may be I can suggest according to that.


we created table thr' UI Macro, how it can be done? could you please share .thanks


find_real_file.png