Multivaled individual XLATEs retreiving MV data (OpenInsight Specific)
At 02 AUG 2001 07:58:06PM Mike Parrish wrote:
I'm having some trouble retrieving MV data from a PRODUCTS file into MV XLATEs in a CUSTOMER_ORDERS edittable. To make a long story short, the results I'm getting in the Customer_Orders Form edittable are:
Style_No Plating Size Cost
V1001 B 1.5 $1.20 added somewhere and have tried it after {Style_No}, "PLATING" and after ")" of the XLATE command, none of which gave me the desired results.
Any suggestions?
Thanks,
Mike
At 03 AUG 2001 03:54AM Oystein Reigem wrote:
Mike,
I recognize the problem. You get something multivalued where each value again can be multivalued - a @VM-delimited thing where each value again is @VM-delimited. A mess.
One solution is to do the conversion to commas already in the PRODUCTS table. In the PRODUCTS table make a symbolic PLATING_COMMA_DELIMITED:
@Ans={PLATING}
convert @VM to "," in @Ans
Then use that symbolic in your Xlate:
@ANS=XLATE("PRODUCTS", {STYLE_NO}, "PLATING_COMMA_DELIMITED", "X")
- Oystein -
At 03 AUG 2001 09:38AM [url=http://www.sprezzatura.com" onMouseOver=window.status=Click here to visit our web site?';return(true)]The Sprezzatura Group[/url] wrote:
When working with multi-valued multi-values like this, something it's easier to see what the issues are by following two debugging steps.
One is to use the little known 5th XLATE parameter, delimiterLevel. By setting this value to a number, the system will drop the delimiters coming back from XLATE. So, if the answer would have contained @VM, it will now contain @SVM.
This is usefull when passing in @VM delimited data from the source field, since each results will be @SVM delmited, but still @VM delimited to match in the passed key.
For instance, in your example
@ANS=XLATE("PRODUCTS", {STYLE_NO}, "PLATING", "X")
changing this to
@ANS=XLATE("PRODUCTS", {STYLE_NO}, "PLATING", "X", 1)
will have all the platings for each style number @SVM delimited. They will be @VM delimited for each style. This allows you to easily match up the fields.
The second trick is changing your symbolic to call a function or subroutine. You can then use the debugger and actually debug the symbolic. After your done, it's best to put the code back into the symbolic or make the routine expendable as it starts to chew up program stack entries this way.
World Leaders in all things RevSoft
At 03 AUG 2001 09:42AM Oystein Reigem wrote:
Are you sure that 1 parameter works like you say?
First, the docs say 1 is default. The way I read it you must use 2.
Second, when I tried 2 I got all the @VMs to @SVM.
- Oystein -