DI Jint

From Accelerator for SageCRM
Revision as of 11:26, 2 March 2026 by Sagecrmw (talk | contribs) (Created page with "There are specific commands in the Javascript Engine (JINT) relating to SageCRM Only. getID - This is used where you have the "Name" value and need the ID. You would use this for an integration where Id's would not map but you could map the Names. Only one result is returned so this depends on the Name value being unique. Otherwise use querydb. - Parameters (a) COLLECTION (b) FILTER - returns ID value EG >var _compId = di.getID('Company', 'Union Computer'); 2...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

There are specific commands in the Javascript Engine (JINT) relating to SageCRM Only.

getID - This is used where you have the "Name" value and need the ID. You would use this for an integration where Id's would not map but you could map the Names. Only one result is returned so this depends on the Name value being unique. Otherwise use querydb.

- Parameters (a) COLLECTION (b) FILTER
 - returns ID value
 

EG

>var _compId = di.getID('Company', 'Union Computer');

2. getLookupCode - In Sage CRM some fields are lookups/selects and they use codes and translations, to get the translation value from given code.

- Parameters (a) COLLECTION (b) SOURCE_FIELD (c) SOURCE_CODE
 - returns translation value from COLLECTION
 

EG

>var val=di.getlookupcode("Company", "Comp_Sector","Construction")