cancel
Showing results for 
Search instead for 
Did you mean: 

Get last ServiceCall Added

Former Member
0 Kudos

Hi

I am using this code to retirve my last Service Call Added but retuning Blank

dim vlastServiceCall as string

vCmp.GetNewObjectCode (vlastServiceCall)

MsgBox ("Added QuoteNo:" & vlastServiceCall)

msgbox just shows:Added QuoteNo:

servicecall is added but not returning last Service Call

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

try to use

vlastServiceCall = vCmp.GetNewObjectKey()

Former Member
0 Kudos

no,these does not work

Former Member
0 Kudos

do you put this code after you add a ServiceCall by sdk?

usually we use this code after

oServiceCall.Add()

if you didn't add anything you need to use the RecordsetObject like Gilbert Ngo said

Former Member
0 Kudos

this is my code,right after add

RetVal = vServiceCall.Add

vCmp.GetNewObjectCode (vlastServiceCall)

Former Member
0 Kudos

is the retVal = 0???

Former Member
0 Kudos

no, Blank

gilbert_ngo2
Explorer
0 Kudos

Hello,

Try this one instead:

Dim vlastServiceCall as string

Dim gRec As SAPbobsCOM.Recordset

Set gRec = vCmp.GetBusinessObject(BoRecordset)

gRec.DoQuery "SELECT MAX(CALLID) AS MAX FROM OSCL"

If Not gRec.EOF Then

gRec.MoveFirst

vlastServiceCall=gRec.Fields.Item("MAX").Value

End If

MsgBox ("Added QuoteNo:" & vlastServiceCall)

Regards,

Gilbert Ngo

Former Member
0 Kudos

this would be alternate way but does any one know why

GetNewObjectCode method is not workign for service calls?

thanks

Former Member
0 Kudos

Hi,

May be i can give u the reason for the why part.....

Generally for all the marketing documents in SAP B1 we have DocNum and DocEntry but only for service calls and Employee master data we do not have these fields instead we only have callID and empID respectively, so i guees beacause of this the GetNewKey could not work.

Hope it helps,

Vasu Natari.