- Forum
- T24 Technical Discussions
- T24 Development & Customization
- Deletion of MultiValue on version via routin
Deletion of MultiValue on version via routin
- arslan
- Topic Author
- Offline
- Senior Member
-
- Posts: 42
- Thank you received: 1
According to controls wich i've build,if needed i need to delete a multivalue field and own value on version. as i know we do add new multi field with routine (R.NEW(FIELDNO)<1,2>) but what is the way to delete multivalue field.
Thanks in advance.
Please Log in or Create an account to join the conversation.
- jpb
-
- Offline
- Moderator
-
- retired . . . ¯\_(ツ)_/¯
- Posts: 2859
- Thank you received: 650
Use the DEL statement to remove a specified element of a dynamic array.
COMMAND SYNTAX
DEL variable<expression1{, expression2{, expression3}}>
SYNTAX ELEMENTS
The variable can be any previously assigned variable or matrix element. The expressions must evaluate
to a numeric value or a runtime error will occur.
expression1 specifies the field in the array to operate upon and must be present.
expression2 specifies the multivalue within the field to operate upon and is an optional parameter.
expression3 is optionally present when expression2 has been included. It specifies which subvalue to
delete within the specified multivalue.
NOTES
Truncates non-integer values for any of the expressions to integers
Ignores invalid numeric values for the expressions without warning
The command operates within the scope specified, i.e. if specifying only a field then it deletes the
entire field (including its multivalues and subvalues). If specifying a subvalue, then it deletes only the
subvalue leaving its parent multivalue and field intact.
EXAMPLES
FOR I = 1 TO 20
Numbers<I> = I ;*generate numbers
NEXT I
FOR I = 19 TO 1 STEP –2
DEL Numbers<I> ;*remove odd numbers
NEXT I
Please Log in or Create an account to join the conversation.
- arslan
- Topic Author
- Offline
- Senior Member
-
- Posts: 42
- Thank you received: 1
i use the command like ;
DEL R.NEW(178)<1,95>
*178 is a local.ref field on application and 95 is a multivalu field.
and as a result there is no effect.
The porpuse of what i am doing is if the user increases the multivalue field (if added 3 multivalue filed to input value) on application according to my rule i may need to remove 2 of them and as a result on version i need to see just one field in multivalue field.
i will be waiting for your answer, thanks again in advence.
Please Log in or Create an account to join the conversation.
- durai611
- Offline
- Elite Member
-
- Posts: 300
- Thank you received: 51
DEL can be used only on dynamic array.
R.NEW is a dimensional array so it won't work.
Use MATBUILD to convert to dynamic array and do the same. It works.
Please Log in or Create an account to join the conversation.
- jpb
-
- Offline
- Moderator
-
- retired . . . ¯\_(ツ)_/¯
- Posts: 2859
- Thank you received: 650
my.dym = R.NEW(178)
DEL my.dym<1,95,x>
R.NEW(178) = my.dym
Please Log in or Create an account to join the conversation.
- durai611
- Offline
- Elite Member
-
- Posts: 300
- Thank you received: 51
R.NEW(178) = DELETE(R.NEW(178),1,95)
Please Log in or Create an account to join the conversation.
- arslan
- Topic Author
- Offline
- Senior Member
-
- Posts: 42
- Thank you received: 1
i did as what you said and here is the code what i coded.
LOCAL.FIELD = R.NEW(178)
DEL LOCAL.FIELD<1,95,3>
R.NEW(178) = LOCAL.FIELD
but this is not working too just deleting value into the field but i want to delete field. and by the way how can i use "MATBUILD" command ?
Please Log in or Create an account to join the conversation.
- arslan
- Topic Author
- Offline
- Senior Member
-
- Posts: 42
- Thank you received: 1
***by the way i am tring to do this action on validation routine and on the other side what is the button command of "remove multi / sub value " into routine?
what about that "MATBUILD" command, how can i use it?
Please Log in or Create an account to join the conversation.
- durai611
- Offline
- Elite Member
-
- Posts: 300
- Thank you received: 51
Syntax: MATBUILD my.dyn FROM R.NEW
After doing your changes again you can convert by using MATPARSE, command to build dimensional array from dynamic array
Syntax: MATPARSE R.NEW FROM my.dyn
I am little confused with your requirement. If you want to remove the multivalue then the above mentioned DELETE command & jpb suggestions works fine.
"but this is not working too just deleting value into the field but i want to delete field."
delete field means you want to remove all the values in that field? If yes, then just do R.NEW(178) = ''
Please Log in or Create an account to join the conversation.
- arslan
- Topic Author
- Offline
- Senior Member
-
- Posts: 42
- Thank you received: 1
if i click the insert multi / sub value button on the version after that command it will add the fields how much i clicked.
on the version that will seem as shown below;
178.95.1 Personal Number = 234
178.95.2 Personal Number = 456
178.95.3 Personal Number = 589
178.95.4 Personal Number = 100
on the another field a validation routine will run and check the rule.and after that the routine may remove some multi fields not values.you can see at below i want routine to do after run.
178.95.1 Personal Number = 234
178.95.2 Personal Number = 589
as you see routine will remove fields on the screen not just values of fields and when i tried your ways it seems on the screen like below
178.95.1 Personal Number = 234
178.95.2 Personal Number =
178.95.3 Personal Number =
178.95.4 Personal Number =
now could i explain clearly the porpuse of what i am tring to do ? and again thank you for your helps.i will be glad if i can get the solution.
Please Log in or Create an account to join the conversation.
- jpb
-
- Offline
- Moderator
-
- retired . . . ¯\_(ツ)_/¯
- Posts: 2859
- Thank you received: 650
Please Log in or Create an account to join the conversation.
- arslan
- Topic Author
- Offline
- Senior Member
-
- Posts: 42
- Thank you received: 1
thanks.
Please Log in or Create an account to join the conversation.
- durai611
- Offline
- Elite Member
-
- Posts: 300
- Thank you received: 51
Are you using Browser or Desktop?
I have checked in Browser and it's working fine.
Please Log in or Create an account to join the conversation.
- arslan
- Topic Author
- Offline
- Senior Member
-
- Posts: 42
- Thank you received: 1
i am using desktop.
Please Log in or Create an account to join the conversation.
- durai611
- Offline
- Elite Member
-
- Posts: 300
- Thank you received: 51
Give a try by calling REBUILD.SCREEN as jpb suggested.
Please Log in or Create an account to join the conversation.
- jpb
-
- Offline
- Moderator
-
- retired . . . ¯\_(ツ)_/¯
- Posts: 2859
- Thank you received: 650
Do you have any doc about DELETE as function, I only know it as statement (for deleting records). It wasn't even listet in Universe ...?
Please Log in or Create an account to join the conversation.
- durai611
- Offline
- Elite Member
-
- Posts: 300
- Thank you received: 51
Please Log in or Create an account to join the conversation.
- Gigiipse
- Offline
- Senior Member
-
- Posts: 40
- Thank you received: 1
START.POS = INDEX(R.NEW(FIELDNO), @VM, 1)
END.POS = INDEX(R.NEW(FIELDNO), @VM, 2)
TOTAL.LENGHT = LEN(R.NEW(FIELDNO))
R.NEW(FIELDNO) = R.NEW(FIELDNO)[1,START.POS]:R.NEW(FIELDNO)[START.POS,TOTAL.LENGHT]
You may need to add an additional @VM, not sure. If field doen't disapear use START.POS -1
Please Log in or Create an account to join the conversation.
- jpb
-
- Offline
- Moderator
-
- retired . . . ¯\_(ツ)_/¯
- Posts: 2859
- Thank you received: 650
For those who are interested in :
Please Log in or Create an account to join the conversation.
- arslan
- Topic Author
- Offline
- Senior Member
-
- Posts: 42
- Thank you received: 1
at the end i got the solution with your helps. i read the deletefunction document and update the code and appended REBUILD.SCREEN code after that yes finalyy it worked :)
thanks again so much.
Please Log in or Create an account to join the conversation.
- Forum
- T24 Technical Discussions
- T24 Development & Customization
- Deletion of MultiValue on version via routin