InsertingGoldMine Notes using SQL Stored Procedure

BrianFord used Ask the Experts™
I'm running GoldMine 6.7 using SQL Server as the back-end

I need to add Notes to a contact record from with a Stored Procedure.

I have the GoldMine API's and there is a module called GMW_WriteContactNotes which is supposed to do this but I can't figure out how to use it.

According to the documentation the syntax is: EXEC GMW_WriteContactNotes @gmnv

I need to pass the acctno and the notes into this, does anyone have any examples??

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
GMGeniusSoftware Development Manager/Developer

Hi BrianFord,
Here is the documentation snippet you need
            Write notes, including the required notes header, to a contact record.  Recid or Accountno can be passed to identify the record, although, RecID is the preferred method of identifying the record.
Syntax: EXEC GMW_WriteContactNotes @gmnv
@gmnv:  GMNV containing required and optional name/value pairs
Required NV’s:
The user scheduling or making the change to the activity.  If the USERID NV is not passed (the user the activity is to be scheduled for) then the activity will be scheduled for the USER NV.  
The notes to be added.  Cannot exceed 255 characters.
Optional NV’s:
The RecID of the record to be modified.  
Accountno of  Contact1 record
Username to be placed in Notes header if different than User
Return Status:
An invalid @gmnv parameter has been passed.  Be sure to use sp_CreateGMNV and sp_GMNVSetValue before calling sp_WriteSchedule
The required NV User was not passed.
Both Accountno and RecID were not passed.  At least one of these must be included in the gmnv.
The RecID or accountno passed does not exist in contact1


thanks, I have that but I'not sure how to setup the NV pairs, do you have any example T-SQL code?
Software Development Manager/Developer
This is not tested as I do not have the stored proceedures but i think it will work

declare @gmnv varchar(20)

EXEC GMW_NV_SetValue @gmnv, 'USER', ‘MASTER’
EXEC GMW_NV_SetValue @gmnv, 'NOTES', ‘This is a note that will be added’
EXEC GMW_NV_SetValue @gmnv, 'ACCOUNTNO', ‘A90....’  -- Accountno Of CONTACT1 record
EXEC GMW_WriteContactNotes @gmnv
EXEC GMW_NV_Delete @gmnv 

Open in new window

CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.


Thank you, this works great, the note gets entered but I do get the following message returned

The 'GMW_NV_SetValue' procedure attempted to return a status of NULL, which is not allowed. A status of 0 will be returned instead.
Have you seen this before?
GMGeniusSoftware Development Manager/Developer

Which line does it show that error?
I have not used the Stored Proceedures myself as I tend to create applications in VB for them


It's one of the SetValues but I'm not sure which. Buit I will continue to troubleshoot.

The good news is that everythng seems to get entered just fine and the SP does not throw an error, so for now I'm happy to work with it.

Thank you again for your help, very much appreciated :)
GMGeniusSoftware Development Manager/Developer

Do you have a MASTER user , possibly this is the issue, also make sure the speach marks are real speach marks  '  i noticed after my posting they show ` not '


thanks, I did correct the the speech marks :)
I'll double check the user

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial