Replicating user profile  Topic is solved

Discussions relating to Jiwa 7 plugin development, and the Jiwa 7 API.

Replicating user profile

Postby Atronics » Mon Apr 04, 2016 3:24 pm

How can I incorporate a SQL script to replicate a "standard user"profile to the user logging in to Jiwa? i.e the user's profile is updated on login.
Atronics
Frequent Contributor
Frequent Contributor
 
Posts: 119
Joined: Fri Feb 29, 2008 4:40 pm
Topics Solved: 10

Re: Replicating user profile  Topic is solved

Postby Mike.Sheen » Mon Apr 04, 2016 4:38 pm

Atronics wrote:How can I incorporate a SQL script to replicate a "standard user"profile to the user logging in to Jiwa? i.e the user's profile is updated on login.


The attached plugin will do this.

Once imported and enabled, You will need to set a system setting to nominate which staff member is the model user to copy system profile data from.
Attachments
Plugin User Profile Copy On Login.xml
Sample plugin
(34.04 KiB) Downloaded 1392 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: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807

Re: Replicating user profile

Postby Atronics » Tue Apr 05, 2016 9:19 am

Thanks, Mike. That's a very neat solution.
Atronics
Frequent Contributor
Frequent Contributor
 
Posts: 119
Joined: Fri Feb 29, 2008 4:40 pm
Topics Solved: 10

Re: Replicating user profile

Postby pricerc » Wed Jun 02, 2021 2:22 pm

This seems to not work so good in 7.2.1 SR4.

Getting a NullReferenceException at when trying to lookup the template staff member in System Config on the staff.Search line.

Code: Select all
    public void ButtonClicked(JiwaFinancials.Jiwa.JiwaApplication.IJiwaBusinessLogic BusinessLogicHost, JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid GridObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm FormObject, int Col, int Row, JiwaFinancials.Jiwa.JiwaApplication.SystemSettings.Setting SystemSetting)
    {
      if (SystemSetting.IDKey == "ModelUser") {
         var staff = new JiwaFinancials.Jiwa.JiwaApplication.Entities.Staff.Staff();
         staff.Search(FormObject.Form);
         SystemSetting.Contents = staff.RecID;
         SystemSetting.DisplayContents = staff.DisplayName;
      }
    }
/Ryan

ERP Consultant,
Advanced ERP Limited, NZ
https://aerp.co.nz
User avatar
pricerc
Senpai
Senpai
 
Posts: 518
Joined: Mon Aug 10, 2009 12:22 pm
Location: Auckland, NZ
Topics Solved: 21

Re: Replicating user profile

Postby Mike.Sheen » Wed Jun 02, 2021 2:45 pm

This isn't right anymore:
Code: Select all
var staff = new JiwaFinancials.Jiwa.JiwaApplication.Entities.Staff.Staff();


We now require factories to create entities.

I'll update the plugin and post it back here.
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: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807

Re: Replicating user profile

Postby Mike.Sheen » Wed Jun 02, 2021 2:57 pm

Plugin updated to work with the changes introduced since the original plugin was published. Tested and verified as working on 7.2.1.
Attachments
Plugin User Profile Copy On Login - 7.2.1.xml
(28.46 KiB) Downloaded 1300 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: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807

Re: Replicating user profile

Postby pricerc » Wed Jun 02, 2021 3:33 pm

Mike.Sheen wrote:Plugin updated to work with the changes introduced since the original plugin was published. Tested and verified as working on 7.2.1.


Thanks Mike.

Thought it would be something simple - but you got it sorted for me on my drive home, and it would have taken me longer than that to figure it out!
/Ryan

ERP Consultant,
Advanced ERP Limited, NZ
https://aerp.co.nz
User avatar
pricerc
Senpai
Senpai
 
Posts: 518
Joined: Mon Aug 10, 2009 12:22 pm
Location: Auckland, NZ
Topics Solved: 21

Re: Replicating user profile

Postby pricerc » Thu Jun 03, 2021 9:07 pm

Do the saved TabControlSettings for a user only store modifications from the default that a user has made, or is it everything that could potentially be customised?

e.g. If I have a user who only deals with sales, and has modified the details grid on their S/O entry, but none of the other screens in the system, will their profile only include SO customisations, or would it also include, say, purchasing settings, even if they never use purchasing ?

Where I'm heading with this is: is there scope for having a 'merge' profile variation on this plugin, where we can customise/standardise parts of the UI, but leave other parts for individual management?

(I'm happy to tackle the work, but don't want to waste time trying to figure out how if it would be a pointless exercise).
/Ryan

ERP Consultant,
Advanced ERP Limited, NZ
https://aerp.co.nz
User avatar
pricerc
Senpai
Senpai
 
Posts: 518
Joined: Mon Aug 10, 2009 12:22 pm
Location: Auckland, NZ
Topics Solved: 21

Re: Replicating user profile

Postby pricerc » Fri Jun 04, 2021 12:01 am

So here's a slightly more sophisticated version of the plugin.

Changes from Mike's code:
(1) in addition to a global setting, adds a staff record custom field that allows selection of another staff member to use as a profile source. So you could have several different 'template' users, and assign users to different templates.
(2) adds another (optional) global setting for choosing a user group. If the user logging on is a member of this group, then they will *not* load the global profile.
(3) if the model profile is not found, then the process is aborted without first clearing the user settings, i.e. they will get the 'default' settings for the user.

Notes:
Setting a user profile to the same user is the same as not specifying one at all, and the user will be subject to the global setting if they are not also a member of the "personal profile" user group.
Attachments
Plugin AERP - Copy user profile on logon.xml
(37.4 KiB) Downloaded 1136 times
/Ryan

ERP Consultant,
Advanced ERP Limited, NZ
https://aerp.co.nz
User avatar
pricerc
Senpai
Senpai
 
Posts: 518
Joined: Mon Aug 10, 2009 12:22 pm
Location: Auckland, NZ
Topics Solved: 21

Re: Replicating user profile

Postby pricerc » Fri Jun 11, 2021 11:18 am

I just want to 'bump' this question, which I think may have gotten lost by my subsequent post.

pricerc wrote:Do the saved TabControlSettings for a user only store modifications from the default that a user has made, or is it everything that could potentially be customised?

e.g. If I have a user who only deals with sales, and has modified the details grid on their S/O entry, but none of the other screens in the system, will their profile only include SO customisations, or would it also include, say, purchasing settings, even if they never use purchasing ?

Where I'm heading with this is: is there scope for having a 'merge' profile variation on this plugin, where we can customise/standardise parts of the UI, but leave other parts for individual management?

(I'm happy to tackle the work, but don't want to waste time trying to figure out how if it would be a pointless exercise).
(it would be a pointless exercise if a profile contains *all* items not just *customised* items)
/Ryan

ERP Consultant,
Advanced ERP Limited, NZ
https://aerp.co.nz
User avatar
pricerc
Senpai
Senpai
 
Posts: 518
Joined: Mon Aug 10, 2009 12:22 pm
Location: Auckland, NZ
Topics Solved: 21

Next

Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 4 guests