Link to home
Start Free TrialLog in
Avatar of kalios
kalios

asked on

@ReplaceSubstring equivalent in LotusScript.

Hi,

I've the following code in my agent

Let Cnam = Trim$(doc.Custname(0))
Let CIAccount$ = Ucase(Cnam)                  

Set Collection = db.getView("*Counts\CBCN").getAllDocumentsByKey(CIAccount$)
If Collection.Count = 0 Then                          
     'Display MessageBox    
Else
    'Do Processing
End If      


Now In the view "*Counts\CBCN"  I've the first column as the following: @ReplaceSubstring(@UpperCase(@Trim(CustomerName)); " "; "+")
I'm replacing all spaces with +.

Now I've to do the same in CIAccount$.

Lets say if the user enters "IBM Data Services Inc" in the doc.Custname(0) field in the form
The CIAccount$ will have "IBM Data Services Inc".  I want it as IBM+Data+Services+Inc.

If I do not replace spaces with + here the search will not work.

Now you can tell me that just change the column formula to @UpperCase(@Trim(CustomerName)). But that is not what I want to do here becuase,
Lets say if the User is entering just "AA" in the doc.Custname(0) field and in the view "*Counts\CBCN" I've "AAA - R", It is still considering as a match which is incorrect. I guess it all becuase of the spaces.

Please advise.
thanks
Kalios
SOLUTION
Avatar of RanjeetRain
RanjeetRain

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kalios
kalios

ASKER

Thanks Hemanth and Ranjeet.

I've used Hemanths. It works great.

Kalios