Service Manager Job - Obtain Task details of a task  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Re: Service Manager Job - Obtain Task details of a task  Topic is solved

Postby Mike.Sheen » Mon Aug 25, 2014 10:51 pm

indikad wrote:code attached. Thanks.


Ok - the plugin you supplied hooks into the SaveEnding event of the job, and sets a custom field value and then calls the job save method. I said previously not to call the custom field save method, but instead use the job save method - but what I didn't realise was that you were doing this in a SaveEnding handler.

You should instead be setting your custom field values in the SaveStart event. Add a handler to that instead, and then set your custom field contents there - and don't call the save method at all - that will happen for you.

To understand the sequence of events:

  • User clicks the Save toolbar ribbon
  • Form controller invokes the form Save method
  • Form invokes the business logic save method
  • Business logic starts a new SQL transaction if one is not already started
  • Business logic raises a SaveStart event
  • Business logic issues insert/update/delete to SQL
  • Business logic raises a SaveEnding event
  • Business logic commits or rollbacks transaction (if it started the transaction)
  • Business logic raises a SaveEnd event

In the above flow, your plugin added a handler for the business logic SaveEnding event - so your plugin gets invoked after the updates have taken place. You need to modify your custom field contents before the SQL is issued, so that would be at the SaveStart.

Attached is a modified version of your plugin which works for me. Note that in your code you were checking for the custom field name = "Test Field", but the actual custom field name is "Test field" - string comparisons are case sensitive, so I modified your code to have the correct casing.
Attachments
idkTester.rar
(4.59 KiB) Downloaded 127 times
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2440
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 755

Re: Service Manager Job - Obtain Task details of a task

Postby indikad » Tue Aug 26, 2014 11:18 am

Hi Mike - its the main tab addresses I need. Not the Billing - ( I need to grab that address and send off in a message ) - The customer types in different addresses and Billing is not the same as the main tab address always - in their case.
indikad
Frequent Contributor
Frequent Contributor
 
Posts: 182
Joined: Thu Jun 18, 2009 1:14 pm
Topics Solved: 2

Re: Service Manager Job - Obtain Task details of a task

Postby Mike.Sheen » Tue Aug 26, 2014 11:24 am

indikad wrote:Hi Mike - its the main tab addresses I need. Not the Billing - ( I need to grab that address and send off in a message ) - The customer types in different addresses and Billing is not the same as the main tab address always - in their case.


Use the DeliveryAddress property then.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2440
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 755

Re: Service Manager Job - Obtain Task details of a task

Postby indikad » Tue Aug 26, 2014 4:36 pm

Mike.Sheen wrote:
indikad wrote:Hi Mike - its the main tab addresses I need. Not the Billing - ( I need to grab that address and send off in a message ) - The customer types in different addresses and Billing is not the same as the main tab address always - in their case.


Use the DeliveryAddress property then.


ah yes - apologies for my ignorance!


will test the saving code soon.
indikad
Frequent Contributor
Frequent Contributor
 
Posts: 182
Joined: Thu Jun 18, 2009 1:14 pm
Topics Solved: 2

Previous

Return to Technical and or Programming

Who is online

Users browsing this forum: Google [Bot] and 3 guests

cron