GetNewMemo Function

Hi,

I’m trying to create a new memo but I’m not sure how to pull the right MemoTableset. The below code creates a new line on the SQL table. Everything in the sql table populates correctly except for the column “RelatedToSysRowID” which is the column that relates the memo to an order in OrderHed. Any ideas on how to pull the right MemoTableset?

This is my code below:

foreach (DataRow row in ds.Tables["Results"].Rows) {
	Ice.Contracts.MemoSvcContract vh_Memo = null;
	vh_Memo = Ice.Assemblies.ServiceRenderer.GetService<Ice.Contracts.MemoSvcContract>(Db);
	string orderNum = row["OrderRel_OrderNum"].ToString();

	memoTS = new MemoTableset();
	vh_Memo.GetNewMemo(ref memoTS, "Erp", "OrderHed", "107566", "", "", DateTime.Now);
	//row["MemoUserID"] = "TEST";
	vh_Memo.Update(ref memoTS);
	
}

It’s pulling the right tableset, but you need to set the RelatedTosysRowID yourself equal to the record your are trying to attach the memo to.

Oh sweet. Do you know how I can update the Memo Table through bpm code?

Isn’t that exactly what you’re doing now?

Oh I guess what I mean is how do I set the RelatedToSysRowID?

just like you had set the commented out line “MemoUserID”.

row[“RelatedToSysRowID”] = yourGuid;
row[“RowMod”] = “A”;

vh_Memo.Update(ref memoTS);

You might need to play around with at what point you’re setting the table values, but that’s the idea at least

Sweet, I got it to work. Thank you so much Aaron!

1 Like