Creating Custom Input Parameter on Advanced Functions

popy febrian shared this question 2 years ago
Answered

Hi,


Now I am trying to create a Custom Advance Function, I am having trouble making more than one input parameter, now I have tried to create it and it appears but the user input is still empty. Attached is an example of a screenshot of the display I am working on.


For the sample code that I added is as follows


UserInputParameters.Parameter p = new UserInputParameters.Parameter();

p.setUniqueKey("PERODE");

p.setDisplayName("PERIODE");

p.setDescription("Jumlah Periode Yang Digunakan");

p.setDataType(1);

p.setDisplayType(2);

p.setDefaultValue(new Integer(4));

addParameter(p);

p = new UserInputParameters.Parameter();

p.setUniqueKey("TRANSDATE");

p.setDisplayName("TRANSDATE");

p.setDescription("Kolom Waktu");

p.setDataType(100);

p.setAcceptsFieldType(3, true);

p.setAcceptsFieldType(4, true);

p.setDisplayType(6);

addParameter(p);


p = new UserInputParameters.Parameter();

p.setUniqueKey("STOCK");

p.setDisplayName("STOCK");

p.setDescription("Stock Barang");

p.setDataType(100);

p.setAcceptsFieldType(7, true);

p.setAcceptsFieldType(8, true);

p.setDisplayType(9);

addParameter(p);


Please advise me so that I can choose the stock column that I want.

Thank You

Replies (3)

photo
1

Hi Popy,

Thank you for reaching out to us on this. This looks like it's a little beyond our support scope, but from what I understand only fields that fit underlying data type set by setAcceptsFieldType will display. In your code you have this set to Binary and GISPoint, and I wanted to confirm that the column in your report you want to use is of these types?

To try and confirm if this is the cause, for testing purposes please add all types via AcceptsFieldType. If the field you want does show, then it will be a matter of finding the matching type. Adding the following to the STOCK code block should do that:

		p.setAcceptsFieldType(1, true);
		p.setAcceptsFieldType(2, true);
		p.setAcceptsFieldType(3, true);
		p.setAcceptsFieldType(4, true);
		p.setAcceptsFieldType(5, true);
		p.setAcceptsFieldType(6, true);
		p.setAcceptsFieldType(7, true);
		p.setAcceptsFieldType(8, true);
		p.setAcceptsFieldType(9, true);
		p.setAcceptsFieldType(10, true);
		p.setAcceptsFieldType(11, true);
		p.setAcceptsFieldType(12, true);
		p.setAcceptsFieldType(13, true);
		p.setAcceptsFieldType(14, true);
		p.setAcceptsFieldType(15, true);
I will also note that the code pasted here has the displayType of Stock set to 9, which is not a valid type (I would suspect 6 is the type you need).

Please let me know how your testing goes and if you need any further help please let me know.

Cheers,

Neal

photo
1

Hi Popy,

Hope you are well. I wanted to see if the information I provided was able to help you get past this issue?

Cheers,

Neal

photo
1

Hi Popy,


I hope things are going well over there.


Just wanted to let you know I'll be closing this request due to inactivity. However, if you ever wanted to re-visit this or have anything else I can help you with, please let me know.


Cheers,

Neal

Leave a Comment
 
Attach a file