Back to forum list… Back to How Do I?...

Field references in common functions (1 reply and 1 comment)

Steve Bagnall
4 years ago
Steve Bagnall 4 years ago

As far as I understand, field references (eg: %cust_id) can't be used in common function script.

If that's correct, does anyone have suggestions on storing code snippets for re-use as functions where field references are required in the code?

A simplified example of a required function is

Function Create_GL_Code(sType)
Dim sCode
Select Case Lookup("Trans1","FLD02",%transaction_type_id,true)
  Case "01" sCode = Lookup("Defaults","FLD01",1,true)&"."&%client_id
  Case "02" sCode= Lookup("Defaults","FLD02",1,true)
End Select
Create_GL_Code = sCode
End Function

Support
4 years ago
Support 4 years ago

Use the GetValue function instead.

Function Create_GL_Code(sType)
Dim sCode
Select Case Lookup("Trans1","FLD02", GetValue("transaction_type_id") , true)
  Case "01" sCode = Lookup("Defaults","FLD01",1,true) & "." & GetValue("client_id")
  Case "02" sCode= Lookup("Defaults","FLD02",1,true)
End Select
Create_GL_Code = sCode
End Function

Steve Bagnall
4 years ago

That's wonderful. I never thought of trying it that way
Thanks.

Contact

Realisable Software Ltd provides code-free, cost-effective applications integration solutions for SMEs. Our core IMan product is designed to integrate almost any application with a number of Sage solutions and online payment processors.

Looking to purchase IMan, please see our resellers here.

Realisable Software
Ph: +44 (0) 208 123 1017

Copyright © Realisable. All rights reserved.
Realisable is a registered trademark

Close

Request Demo

Realisable Software Ltd provides code-free, cost-effective applications integration solutions for SMEs. Our core IMan product is designed to integrate almost any application with a number of Sage solutions and online payment processors.

Looking to purchase IMan, please see our resellers here.

Realisable Software
Ph: +44 (0) 208 123 1017

Copyright © Realisable. All rights reserved.
Realisable is a registered trademark

Close

Access Downloads

Realisable Software Ltd provides code-free, cost-effective applications integration solutions for SMEs. Our core IMan product is designed to integrate almost any application with a number of Sage solutions and online payment processors.

Looking to purchase IMan, please see our resellers here.

Realisable Software
Ph: +44 (0) 208 123 1017

Copyright © Realisable. All rights reserved.
Realisable is a registered trademark

Close