Service Job - Events for Parts and serial number  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Service Job - Events for Parts and serial number

Postby Riyaz » Wed Aug 07, 2019 8:10 pm

Hi There

Creating a new plugin to update the serial numbers on the Parts section of the Tasks under Service Jobs.

1/ What happens is, the serial number field gets updated by plugin but when we save the job it goes back to blank

2/ Tried also with a custom field instead, but it does the same

3/ What will be event when we add / update a new inventory item under the parts section?

Pls see screenshot attached

Please help me to solve it.
and also please help me to add event while adding inventory.(if it is possible)
Attachments
image.png
Riyaz
Kohai
Kohai
 
Posts: 233
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2

Re: Service Job - Events for Parts and serial number

Postby Scott.Pearce » Thu Aug 08, 2019 9:51 am

1. How is the plugin updating the serial no? Please provide a code snippet or the plugin itself.
2. N/A (Not a question).
3. The event Job.Tasks.PartLineAdded(item As PartLine) fires when a part line is added. The event Job.Tasks.PartLineChanged(item As PartLine, e As System.ComponentModel.PropertyChangedEventArgs) fires when a part line is updated.
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 742
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 221

Re: Service Job - Events for Parts and serial number

Postby Riyaz » Thu Aug 08, 2019 4:07 pm

Hi Scott

Thanks for your reply, because is code snippet that being used

JiwaFinancials.Jiwa.JiwaServiceManager.Job Job=(JiwaFinancials.Jiwa.JiwaServiceManager.Job)sender;
JiwaFinancials.Jiwa.JiwaServiceManagerUI.Jobs JobForm=(JiwaFinancials.Jiwa.JiwaServiceManagerUI .Jobs)Job.Client;
string PartNo="";
string TaskNo="123";
string JobNo=Job.JobNo;

for(int i=0; i < JobForm.PartLinesJiwaGrid.ActiveSheet.RowCount; i++)
{
JobForm.PartLinesJiwaGrid.LockColumn(false, "SerialNos", i) ;
PartNo=JobForm.PartLinesJiwaGrid.get_GridText("PartNo", i).ToString();

JobForm.PartLinesJiwaGrid.set_GridText("SerialNos", i, JobNo+"/"+TaskNo);
}
Riyaz
Kohai
Kohai
 
Posts: 233
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2

Re: Service Job - Events for Parts and serial number  Topic is solved

Postby Scott.Pearce » Thu Aug 08, 2019 4:44 pm

It appears that you are "hi-jacking" the Serial Nos. cell at the UI level. The Serial Nos. cell is a read-only cell, so if you programmatically push values into it the underlying business logic will not be affected (and therefore will not save away the value you pushed in there). Further, you should not be using the UI for operations, but rather you should be manipulating the underlying business logic. Think of the UI layer (buttons, text fields, grids, etc.) as just a dumb layer that simply displays the information that is contained in the business logic layer.

The Serial Nos. cell shows which serial numbers have been taken from stock for those part lines. Here is an example of what happens using the Jiwa demonstration data:

1. Use Jiwa Demonstration data from 7.2.0.0
2. Go to Service Manager Job No. 0000000002
3. Add part 'SN1140409'. This is an inventory item which has been marked as "serialised", meaning each individual piece of stock-on-hand has a unique serial no.
4. A dialog appears asking for you to choose which serial numbers to grab from stock. Lets get 1 of serial number 343453 and 1 of 54157.
5. You will see that the part line is now in the grid, with a Qty of 2. This line is actually made up of 2 "detail" lines - one for each serial number. By clicking on the lookup button next to the Serial Nos. cell, we can see these "detail" lines (the lines with 0 quantity selected are not attached to the part line though). The Serial Nos. cell itself just displays a comma separated list of the "detail" line serial numbers.

So that's a primer on how serial numbers work with the parts grid in Service Manager.

Now, it sounds like you don't actually want to do anything with serial numbers as such, but in fact want to store some other piece of data against each part line. For this, a Service Manager Part Line custom field would be appropriate. I have attached a plugin that demonstrates use of a Service Manager Part Line custom field that gets populated whenever a part line is added.
Attachments
Plugin SM Part Custom Field.xml
(33.52 KiB) Downloaded 55 times
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 742
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 221

Re: Service Job - Events for Parts and serial number

Postby Riyaz » Thu Aug 08, 2019 4:47 pm

Thanks Scott, appreciate it, will let you know if you have any questions.
Riyaz
Kohai
Kohai
 
Posts: 233
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 2 guests

cron