This topic is READ ONLY
import-bot (20212) [Avatar] Offline
#1
[Originally posted by lnarsimhan]

After reading the chapter 4 I was trying to add a another Hyperlink for Sales
order to Order Item. Now I want to pass two arguments to a function.
1. Sales Order number
2. Customer id
3. Sort
I was trying to pass like
'' + id + ''
But right now I used as one string argument and using MID, Left function I
reading the values. Is there anyway I can send two different Long argument to
the function and retrieve.

Please help me.

Thanks
Lakshmi
import-bot (20212) [Avatar] Offline
#2
Re: Drill down
[Originally posted by yannick]

I have always used a single argument when calling a function in this matter: I
don't know if you can pass more then argument. I have tried many different
combinations and I was never able to pass more then one argument. I have
always used the following workaround to get around this limitation:

Lets say I want to pass the session id and the report id to a function called
of_get_report. What I do is concatenate the session id and the report into
one string, separating them by a special characters like & (the ampersand).
Example:
ls_string = 'of_get_criteria?as_arg=' + as_session_id + '&' +
String(ll_report_id)

Then in the of_get_criteria function, I would retreive the session id and the
report id using the pos(), left() and right() PB functions
Example:
ll_position = pos(as_arg, "&")
ls_session_id = Left(as_arg, ll_position - 1)
ls_report_id = Right(as_arg, Len(as_arg) - ll_position)


This is one possible solution to your problem. If any one knows of a way to
pass more then one argument, please post a short example.

Yannick

> After reading the chapter 4 I was trying to add a another Hyperlink for Sales
> order to Order Item. Now I want to pass two arguments to a function.
> 1. Sales Order number
> 2. Customer id
> 3. Sort
> I was trying to pass like
> '' + id + ''
> But right now I used as one string argument and using MID, Left function I
> reading the values. Is there anyway I can send two different Long argument to
> the function and retrieve.
>
> Please help me.
>
> Thanks
> Lakshmi
import-bot (20212) [Avatar] Offline
#3
Re: Drill down
[Originally posted by yannick]

Just one more thing, don't use & (ampersand) as a separator (like in my
example). It does not always work (???) Use some other character you won't
find in the arguments string.

Yannick

> I have always used a single argument when calling a function in this matter: I
> don't know if you can pass more then argument. I have tried many different
> combinations and I was never able to pass more then one argument. I have
> always used the following workaround to get around this limitation:
>
> Lets say I want to pass the session id and the report id to a function called
> of_get_report. What I do is concatenate the session id and the report into
> one string, separating them by a special characters like & (the ampersand).
> Example:
> ls_string = 'of_get_criteria?as_arg=' + as_session_id + '&' +
> String(ll_report_id)
>
> Then in the of_get_criteria function, I would retreive the session id and the
> report id using the pos(), left() and right() PB functions
> Example:
> ll_position = pos(as_arg, "&"smilie
> ls_session_id = Left(as_arg, ll_position - 1)
> ls_report_id = Right(as_arg, Len(as_arg) - ll_position)
>
>
> This is one possible solution to your problem. If any one knows of a way to
> pass more then one argument, please post a short example.
>
> Yannick
>
> > After reading the chapter 4 I was trying to add a another Hyperlink for
Sales
> > order to Order Item. Now I want to pass two arguments to a function.
> > 1. Sales Order number
> > 2. Customer id
> > 3. Sort
> > I was trying to pass like
> > '' + id + ''
> > But right now I used as one string argument and using MID, Left function I
> > reading the values. Is there anyway I can send two different Long argument
to
> > the function and retrieve.
> >
> > Please help me.
> >
> > Thanks
> > Lakshmi
import-bot (20212) [Avatar] Offline
#4
Re: Drill down
[Originally posted by ezad1]

> After reading the chapter 4 I was trying to add a another Hyperlink for Sales
> order to Order Item. Now I want to pass two arguments to a function.
> 1. Sales Order number
> 2. Customer id
> 3. Sort
> I was trying to pass like
> '' + id + ''
> But right now I used as one string argument and using MID, Left function I
> reading the values. Is there anyway I can send two different Long argument to
> the function and retrieve.
>
> Please help me.
>
> Thanks
> Lakshmi

Yes there is. First of all lets name these arguments so I can build and example:

1. Sales Order number = al_order
2. Customer id = al_custid
3. Sort = as_sort

Now assuming that they are declared in the function in this order, the
following expression can be used in the datawindow:

'' + id + ''

Note that the '+' character is used to separate the arguments. An alternate
way to do this is to name the arguments and separate them with ampersands:

'' + id + ''
import-bot (20212) [Avatar] Offline
#5
Re: Drill down
[Originally posted by lnarsimhan]

Tom

You mean I can define in the function as Two different Long Argument and send
the value as Long. Right now I am sending the values by adding special
character in between two values and sending as one String value.

Please help me.
Thanks
Lakshmi

> > After reading the chapter 4 I was trying to add a another Hyperlink for
Sales
> > order to Order Item. Now I want to pass two arguments to a function.
> > 1. Sales Order number
> > 2. Customer id
> > 3. Sort
> > I was trying to pass like
> > '' + id + ''
> > But right now I used as one string argument and using MID, Left function I
> > reading the values. Is there anyway I can send two different Long argument
to
> > the function and retrieve.
> >
> > Please help me.
> >
> > Thanks
> > Lakshmi
>
> Yes there is. First of all lets name these arguments so I can build and
example:
>
> 1. Sales Order number = al_order
> 2. Customer id = al_custid
> 3. Sort = as_sort
>
> Now assuming that they are declared in the function in this order, the
> following expression can be used in the datawindow:
>
> '' + id + ''
>
> Note that the '+' character is used to separate the arguments. An alternate
> way to do this is to name the arguments and separate them with ampersands:
>
> '' + id + ''
import-bot (20212) [Avatar] Offline
#6
Re: Drill down
[Originally posted by ezad1]

>You mean I can define in the function as Two different Long Argument and send
>the value as Long. Right now I am sending the values by adding special
>character in between two values and sending as one String value.

Yes, you can define as many arguments as you'd like (as you would for any
function) and as long as you use the standard data types, you'll be alright.