2 added 46 characters in body
source | link

Change your 6 line to:

myJob1.Id = opportunity.records.Opportunityid;

myJob1.Id = opportunity.records[0].Opportunityid;

the "sforce.connection.query" don'tThe sforce.connection.query method doesn't return the specified field, but rather a List<SObject>.

Change your 6 line to:

myJob1.Id = opportunity.records.Opportunityid;

the "sforce.connection.query" don't return the specified field.

Change your 6 line to:

myJob1.Id = opportunity.records[0].Opportunityid;

The sforce.connection.query method doesn't return the specified field, but rather a List<SObject>.

1
source | link

Change your 6 line to:

myJob1.Id = opportunity.records.Opportunityid;

the "sforce.connection.query" don't return the specified field.