Error
This content is not currently supported on this browser.
+ Start a Discussion
gorky2gorky2 

How create a task assigned to an accountid with asp(non net)?

Hi!

I'm trying to create a task using the SForceOfficeToolkit object using the createobject function to create a task and then assign the values that i want for this new task and use the object create to "make a task" in SF

But i have a problem the field "accountid" from task table is not updatable I can not assign a value.

There is a way using this object to create a task assigned to an accountid?

 

This is an example that how i'm trying to create a task with Asp (non.net)

Dim SforceApi
Dim sobject (0)
Dim fld

Set SforceApi = server.CreateObject("SForceOfficeToolkit.SForceSession")
 
 if SforceApi.Login("mylogin","mypass",false) then
  
  Set sobject = SforceApi.CreateObject("task")
  
  For Each fld In sobject.fields
   

    if fld.name = "AccountId" then

    If (fld.Createable) Then 'this is always false and i can not assign a value to the accountid field

      fld.value="001600000018C8OBBU"

    end if

    end if


   if fld.name = "Description" then
    If (fld.Createable) Then
     fld.value="Prova de insert"
    end if
   end if
   if fld.name = "Subject" then
    If (fld.Createable) Then
     fld.value="testejant insertar dades"
    end if
   end if
   
 next
  
  
  if SforceApi.Create(sobject,false) then
   Response.Write "Correct insert " & "<BR>"
  else
   Response.Write "Error on insert" & "<BR>"  
  end if
 end if

Set SforceApi = nothing
set sobject(0) = nothing

If anyone find a way to do this with the SForceOfficeToolkit object

 

cheers

gorky2

gorky2gorky2

I found a way to do what i want.

I use the WhatId field and it works the task now are assigned to the account that i want.

Cheers

Gorky2