Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to add a code dynamically

I have a scipt which is,

If(Match(Book, '101', '102', '103') and Year(RecordDate) = '2016', '1') as BookRecordFlag

I want to use a input box to dynamically add more data in this statement and store as BookRecordFlag. If I enter 110 in the input box, it should add that value in the match statement where the statement will look like this If(Match(Book, '101', '102', '103', '110') and Year(RecordDate) = '2016', '1') as BookRecordFlag. I am pulling this BookRecordFlag in a frontend object and I want this object to reflect the new code. Is it possible?

5 Replies
marcus_sommer

You could try:

If(Match(Book, '101', '102', '103', '$(vInputboxVariable)') and Year(RecordDate) = '2016', '1') as BookRecordFlag


- Marcus

Not applicable
Author

Thanks Marcos, I tried this but it did not work. I created a input box and entered a value for vInputboxVariable, it does not show the entered value. is there any other way?

Anonymous
Not applicable
Author

Hi Enthu,

You can add a variable, and concatenate with last value of the same variable if the new input value doen't exists on it, for example:

If(Len(YourVarName)=0,InputBoxValue,

If(SubStringCount(YourVarName,InputBoxValue)=0,YourVarName&','&chr(39)&InputBoxValue&chr(39),YourVarName))

Then, on your expression, If(Match(Book, '$(YourVarName)') and Year(RecordDate) = '2016', '1') as BookRecordFlag


Regards!

marcus_sommer

What didn't work? Which client do you use? How do you execute the reloal?

- Marcus

Anil_Babu_Samineni

Marcus solution solution should work

If(Match(Book, '101', '102', '103', '$(vInputboxVariable)') and Year(RecordDate) = '2016', '1') as BookRecordFlag


Have you created this variable on your machine vInputboxVariable?


OR Else please share more information which part you stucked after using Marcus solutions

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful