Creditor Purchase Lines Custom Fields - copying  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Creditor Purchase Lines Custom Fields - copying

Postby neil.interactit » Wed Jun 27, 2018 12:35 pm

Hi guys,

Closely related, but rather than tacking this onto viewtopic.php?f=26&t=977#p3665, I'll post separately to avoid thread blurring.

Per that thread "BPay CRN" data entry is possible in the new column, but the client has just discovered that copying a creditor purchase does not copy the custom column values.

Should I specifically code the copying up, or is it ultimately more intuitive if you bake this into the various "Lines Custom Fields" throughout Jiwa? If you do, would it be worth an additional bool setting column on the plugin custom fields tab "Copyable" (or some better term!) to determine if the custom field values are copied or not when the parent is duplicated?

Cheers,
Neil.
neil.interactit
Kohai
Kohai
 
Posts: 227
Joined: Wed Dec 03, 2014 2:36 pm
Topics Solved: 6

Re: Creditor Purchase Lines Custom Fields - copying  Topic is solved

Postby Mike.Sheen » Wed Jun 27, 2018 6:32 pm

neil.interactit wrote:Should I specifically code the copying up, or is it ultimately more intuitive if you bake this into the various "Lines Custom Fields" throughout Jiwa? If you do, would it be worth an additional bool setting column on the plugin custom fields tab "Copyable" (or some better term!) to determine if the custom field values are copied or not when the parent is duplicated?


Hi Neil,

We found several different camps our customers were in:
  • Always want to copy custom fields
  • Never want to copy custom fields
  • Conditionally want to copy custom fields
  • Want to copy select custom fields (not all of them!)
  • Want to conditionally copy select custom fields (not all of them - and only sometimes!)

And then the rules are mixed and matched between line custom fields and custom fields. So we so far have relied on plugins being implemented to suit the various needs.

But I like your idea of just adding a checkbox next to the custom field to indicate if the default behaviour should be to copy it or not - that would meet 90% of requirements - so that's logged as improvement DEV-6705.

In the meantime, attached is a plugin which copies all the line custom fields for creditor batch transactions when a creditor batch is copied.

Mike
Plugin Copy CR Batch Line Custom Fields.xml
Sample Plugin
(33.06 KiB) Downloaded 91 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: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: Creditor Purchase Lines Custom Fields - copying

Postby neil.interactit » Thu Jun 28, 2018 11:54 am

Sweet! Many thanks Mike.
neil.interactit
Kohai
Kohai
 
Posts: 227
Joined: Wed Dec 03, 2014 2:36 pm
Topics Solved: 6

Re: Creditor Purchase Lines Custom Fields - copying

Postby neil.interactit » Thu Jun 28, 2018 12:11 pm

Actually ... did you try hitting save after copying? Here, I'm seeing values appear OK after hitting copy, then disappear on save.
neil.interactit
Kohai
Kohai
 
Posts: 227
Joined: Wed Dec 03, 2014 2:36 pm
Topics Solved: 6

Re: Creditor Purchase Lines Custom Fields - copying

Postby Mike.Sheen » Thu Jun 28, 2018 12:49 pm

neil.interactit wrote:Actually ... did you try hitting save after copying? Here, I'm seeing values appear OK after hitting copy, then disappear on save.


Yes - that's the behaviour without the plugin I supplied (which is a bug) - but with the supplied plugin saving after copying sees the values retained.
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: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: Creditor Purchase Lines Custom Fields - copying

Postby neil.interactit » Thu Jun 28, 2018 2:06 pm

Duh, I hadn't added CreditorBatchTrans to the business logic factory in my plugin. All good now!
neil.interactit
Kohai
Kohai
 
Posts: 227
Joined: Wed Dec 03, 2014 2:36 pm
Topics Solved: 6


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 6 guests

cron